]> git.saurik.com Git - apple/libinfo.git/blob - netinfo.subproj/ni.h
Libinfo-222.3.3.tar.gz
[apple/libinfo.git] / netinfo.subproj / ni.h
1 /*
2 * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * Portions Copyright (c) 1999 Apple Computer, Inc. All Rights
7 * Reserved. This file contains Original Code and/or Modifications of
8 * Original Code as defined in and that are subject to the Apple Public
9 * Source License Version 1.1 (the "License"). You may not use this file
10 * except in compliance with the License. Please obtain a copy of the
11 * License at http://www.apple.com/publicsource and read it before using
12 * this file.
13 *
14 * The Original Code and all software distributed under the License are
15 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
16 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
17 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the
19 * License for the specific language governing rights and limitations
20 * under the License.
21 *
22 * @APPLE_LICENSE_HEADER_END@
23 */
24 /*
25 * NetInfo library entry points
26 * Copyright (C) 1989 by NeXT, Inc.
27 */
28
29 #ifndef __NI_HEADER__
30 #define __NI_HEADER__
31
32 #ifndef SUN_RPC
33 #define SUN_RPC 1
34 #endif
35
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39
40 #include <rpc/rpc.h>
41 #include <netinfo/ni_prot.h>
42 #include <netinfo/nibind_prot.h>
43 typedef const char *ni_name_const;
44 #include <netinfo/ni_util.h>
45
46 /*
47 * Define some shortcuts
48 */
49 #define ninl_len ni_namelist_len
50 #define ninl_val ni_namelist_val
51
52 #define nipl_len ni_proplist_len
53 #define nipl_val ni_proplist_val
54
55 #define niil_len ni_idlist_len
56 #define niil_val ni_idlist_val
57
58 #define niel_len ni_entrylist_len
59 #define niel_val ni_entrylist_val
60
61 #define nipll_len ni_proplist_list_len
62 #define nipll_val ni_proplist_list_val
63
64 /*
65 * Arg struct for ni_fancyopen
66 */
67 typedef struct ni_fancyopenargs {
68 int rtimeout; /* read timeout - 0 for default */
69 int wtimeout; /* write timeout - 0 for default */
70 int abort; /* give up on timeout or failure? */
71 int needwrite; /* need to do writes on this handle? */
72 } ni_fancyopenargs;
73
74
75 void *ni_new(void *, const char *);
76 void *ni_connect(struct sockaddr_in *, const char *);
77 ni_status ni_addrtag(void *, struct sockaddr_in *, ni_name *);
78 void ni_free(void *);
79 const char *ni_error(ni_status);
80
81 ni_status ni_statistics(void *, ni_proplist *);
82 ni_status ni_root(void *, ni_id *);
83 ni_status ni_self(void *, ni_id *);
84 ni_status ni_parent(void *, ni_id *, ni_index *);
85
86 ni_status ni_create(void *, ni_id *, ni_proplist, ni_id *, ni_index);
87 ni_status ni_destroy(void *, ni_id *, ni_id);
88
89 ni_status ni_read(void *, ni_id *, ni_proplist *);
90 ni_status ni_write(void *, ni_id *, ni_proplist);
91
92 ni_status ni_children(void *, ni_id *, ni_idlist *);
93 ni_status ni_list(void *, ni_id *, ni_name_const, ni_entrylist *);
94 ni_status ni_listall(void *, ni_id *, ni_proplist_list *);
95 ni_status ni_lookup(void *, ni_id *, ni_name_const, ni_name_const,
96 ni_idlist *);
97 ni_status ni_lookupread(void *, ni_id *, ni_name_const, ni_name_const,
98 ni_proplist *);
99 ni_status ni_lookupprop(void *, ni_id *, ni_name_const, ni_namelist *);
100 ni_status ni_renameprop(void *, ni_id *, ni_index, ni_name_const);
101 ni_status ni_listprops(void *, ni_id *, ni_namelist *);
102
103 ni_status ni_createprop(void *, ni_id *, ni_property, ni_index);
104 ni_status ni_destroyprop(void *, ni_id *, ni_index);
105 ni_status ni_readprop(void *, ni_id *, ni_index, ni_namelist *);
106 ni_status ni_writeprop(void *, ni_id *, ni_index, ni_namelist);
107
108 ni_status ni_createname(void *, ni_id *, ni_index, ni_name_const, ni_index);
109 ni_status ni_destroyname(void *, ni_id *, ni_index, ni_index);
110 ni_status ni_readname(void *, ni_id *, ni_index, ni_index, ni_name *);
111 ni_status ni_writename(void *, ni_id *, ni_index, ni_index, ni_name_const);
112
113 ni_status ni_pathsearch(void *, ni_id *, ni_name_const);
114 ni_status ni_open(void *, ni_name_const, void **);
115 ni_status ni_fancyopen(void *, ni_name_const, void **, ni_fancyopenargs *);
116
117 ni_status ni_pwdomain(void *, ni_name *);
118
119 ni_status ni_resync(void *);
120
121 ni_status ni_setuser(void *, ni_name_const);
122 ni_status ni_setpassword(void *, ni_name_const);
123 void ni_setreadtimeout(void *, int);
124 void ni_setwritetimeout(void *, int);
125 void ni_setabort(void *, int);
126 void ni_needwrite(void *, int);
127
128 #ifdef __cplusplus
129 }
130 #endif
131
132 #endif __NI_HEADER__
133