]> git.saurik.com Git - apple/launchd.git/blob - liblaunch/launch_internal.h
aa6576f8e2772a9866e92d1d3f30d80304b38b0f
[apple/launchd.git] / liblaunch / launch_internal.h
1 /*
2 * Copyright (c) 2007 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_APACHE_LICENSE_HEADER_START@
5 *
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 *
18 * @APPLE_APACHE_LICENSE_HEADER_END@
19 */
20
21 #ifndef __LAUNCH_INTERNAL_H__
22 #define __LAUNCH_INTERNAL_H__
23
24 #include <paths.h>
25
26 #pragma GCC visibility push(default)
27
28 #define LAUNCHD_DB_PREFIX "/private/var/db/launchd.db"
29 #define LAUNCHD_LOG_PREFIX "/private/var/log"
30
31 typedef struct _launch *launch_t;
32
33 launch_t launchd_fdopen(int, int);
34 int launchd_getfd(launch_t);
35 void launchd_close(launch_t, __typeof__(close) closefunc);
36
37 launch_data_t launch_data_new_errno(int);
38 bool launch_data_set_errno(launch_data_t, int);
39
40 int launchd_msg_send(launch_t, launch_data_t);
41 int launchd_msg_recv(launch_t, void (*)(launch_data_t, void *), void *);
42
43 size_t launch_data_pack(launch_data_t d, void *where, size_t len, int *fd_where, size_t *fdslotsleft);
44 launch_data_t launch_data_unpack(void *data, size_t data_size, int *fds, size_t fd_cnt, size_t *data_offset, size_t *fdoffset);
45
46 #pragma GCC visibility pop
47
48 #endif /* __LAUNCH_INTERNAL_H__*/