4093afb2bc614f8dd40f94c3221e8d8493587e47
[tprouty/samba.git] / source / include / smb_launchd.h
1 /*
2    Unix SMB/CIFS implementation.
3    Launchd integration wrapper API
4
5    Copyright (C) James Peach 2007
6
7    This program is free software; you can redistribute it and/or modify
8    it under the terms of the GNU General Public License as published by
9    the Free Software Foundation; either version 3 of the License, or
10    (at your option) any later version.
11
12    This program is distributed in the hope that it will be useful,
13    but WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15    GNU General Public License for more details.
16
17    You should have received a copy of the GNU General Public License
18    along with this program; if not, write to the Free Software
19    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 */
21
22 struct smb_launch_info
23 {
24         int idle_timeout_secs;
25         int num_sockets;
26         int *socket_list;
27 };
28
29 /* Retrieve launchd configuration. Returns True if we are running under
30  * launchd, False otherwise. NOTE this does not guarantee to provide a list of
31  * sockets since this is a user configuration option.
32  */
33 BOOL smb_launchd_checkin(struct smb_launch_info *linfo);
34
35 /* Retrieve launchd configuration. The variadic arguments are a list of
36  * constant null-terminated strings. The strings are the names of the socket
37  * dictionaries to retrieve sockets from. The list of names is terminated by a
38  * NULL.
39  */
40 BOOL smb_launchd_checkin_names(struct smb_launch_info *linfo, ...);
41
42 /* Free any data or state associated with a successful launchd checkin. */
43 void smb_launchd_checkout(struct smb_launch_info *linfo);