Libinfo-324.1.tar.gz
[apple/libinfo.git] / lookup.subproj / libinfo.h
1 /*
2 * Copyright (c) 2008 Apple Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23
24 #include <si_module.h>
25
26 /*
27 * Most of these async callbacks get data that's held in thread-specific
28 * memory (specific to the callback thread) that will be re-used by that
29 * thread automatically on the next call - synchronous or asynchronous -
30 * of the same routine. For example, an async getpwnam call will use a
31 * slot in the caller's thread-specifc data to save the returned struct passwd.
32 * A subsequent call to getpwnam will release the previous entry
33 *
34 * Callers of getaddrinfo must free the returned addrinfo list using freeaddrinfo.
35 * Callbacks for async getaddrinfo lookups must also free the returned addrinfo list.
36 *
37 * Callers of getnameinfo supply their own memory for the node and serv names.
38 * Callbacks for async getnameinfo lookups get node and serv names that reside in
39 * thread-specific memory that is reclaimed by the libraray. The results must not be freed.
40 */
41 typedef void (*si_user_async_callback)(struct passwd *, void *context);
42 typedef void (*si_group_async_callback)(struct group *, void *context);
43 typedef void (*si_grouplist_async_callback)(struct grouplist_s *, void *context);
44 typedef void (*si_alias_async_callback)(struct aliasent *, void *context);
45 typedef void (*si_host_async_callback)(struct hostent *, void *context);
46 typedef void (*si_ipnode_async_callback)(struct hostent *, int32_t status, void *context);
47 typedef void (*si_network_async_callback)(struct netent *, void *context);
48 typedef void (*si_service_async_callback)(struct servent *, void *context);
49 typedef void (*si_protocol_async_callback)(struct protoent *, void *context);
50 typedef void (*si_rpc_async_callback)(struct rpcent *, void *context);
51 typedef void (*si_fs_async_callback)(struct fstab *, void *context);
52 typedef void (*si_addrinfo_async_callback)(int32_t status, struct addrinfo *res, void *context);
53 typedef void (*si_nameinfo_async_callback)(int32_t status, char *node, char *serv, void *context);
54 typedef void (*si_setent_async_callback)(void *context);