]> git.sur5r.net Git - openldap/blob - include/ldap.h
Initial checkin of ldap_search_ext() and friends.
[openldap] / include / ldap.h
1 /*
2  * Copyright 1998,1999 The OpenLDAP Foundation, Redwood City, California, USA
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms are permitted only
6  * as authorized by the OpenLDAP Public License.  A copy of this
7  * license is available at http://www.OpenLDAP.org/license.html or
8  * in file LICENSE in the top-level directory of the distribution.
9  */
10 /* Portions
11  * Copyright (c) 1990 Regents of the University of Michigan.
12  * All rights reserved.
13  *
14  * Redistribution and use in source and binary forms are permitted
15  * provided that this notice is preserved and that due credit is given
16  * to the University of Michigan at Ann Arbor. The name of the University
17  * may not be used to endorse or promote products derived from this
18  * software without specific prior written permission. This software
19  * is provided ``as is'' without express or implied warranty.
20  */
21
22 #ifndef _LDAP_H
23 #define _LDAP_H
24
25 #include <ldap_cdefs.h>
26
27 LDAP_BEGIN_DECL
28
29 #define LDAP_VERSION1   1
30 #define LDAP_VERSION2   2
31 #define LDAP_VERSION3   3
32
33 #define LDAP_VERSION            LDAP_VERSION2
34 #define LDAP_VERSION_MIN        LDAP_VERSION2
35 #define LDAP_VERSION_MAX        LDAP_VERSION2
36
37 /*
38  * We'll use 2000+draft revision for our API version number
39  * As such, the number will be above the old RFC but below 
40  * whatever number does finally get assigned
41  */
42 #define LDAP_API_VERSION        2002
43 #define LDAP_VENDOR_NAME        "OpenLDAP"
44 /* We'll eventually release as 200 */
45 #define LDAP_VENDOR_VERSION     192
46
47 /* OpenLDAP API Features */
48 #define LDAP_API_FEATURE_X_OPENLDAP LDAP_VENDOR_VERSION
49
50 /* include LDAP_API_FEATURE defines */
51 #include <ldap_features.h>
52
53 #if defined( LDAP_API_FEATURE_X_OPENLDAP_REENTRANT ) || \
54         ( defined( LDAP_THREAD_SAFE ) && \
55                 defined( LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE ) )
56         /* -lldap may or may not be thread safe */
57         /* -lldap_r, if available, is always thread safe */
58 #       define  LDAP_API_FEATURE_THREAD_SAFE 1
59 #endif
60 #if defined( LDAP_THREAD_SAFE ) && \
61         defined( LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE )
62 /* #define LDAP_API_FEATURE_SESSION_SAFE        1       */
63 /* #define LDAP_API_OPERATION_SESSION_SAFE      1       */
64 #endif
65
66 #define LDAP_PORT               389
67
68 #define LDAP_ROOT_DSE                           ""
69 #define LDAP_NO_ATTRS                           "1.1"
70 #define LDAP_ALL_USER_ATTRIBUTES        "*"
71
72 #define LDAP_COMPAT20
73 #define LDAP_COMPAT30
74 #if defined(LDAP_COMPAT20) || defined(LDAP_COMPAT30)
75 #define LDAP_COMPAT
76 #endif
77
78 /* LDAP_OPTions defined by draft-ldapext-ldap-c-api-02 */
79 #define LDAP_OPT_API_INFO                       0x0000
80 #define LDAP_OPT_DESC                           0x0001
81 #define LDAP_OPT_DEREF                          0x0002
82 #define LDAP_OPT_SIZELIMIT                      0x0003
83 #define LDAP_OPT_TIMELIMIT                      0x0004
84 /* 0x05 - 0x07 not defined by current draft */
85 #define LDAP_OPT_REFERRALS                      0x0008
86 #define LDAP_OPT_RESTART                        0x0009
87 /* 0x0a - 0x10 not defined by current draft */
88 #define LDAP_OPT_PROTOCOL_VERSION       0x0011
89 #define LDAP_OPT_SERVER_CONTROLS        0x0012
90 #define LDAP_OPT_CLIENT_CONTROLS        0x0013
91 /* 0x14 not defined by current draft */
92 #define LDAP_OPT_API_FEATURE_INFO       0x0015
93
94 /* 0x16 - 0x2f not defined by current draft */
95 #define LDAP_OPT_HOST_NAME                      0x0030
96 #define LDAP_OPT_ERROR_NUMBER           0x0031
97 #define LDAP_OPT_ERROR_STRING           0x0032
98
99 /* not defined by current draft */
100 /*      for LDAPv2 compatibility */
101 #define LDAP_OPT_DNS                            0x1001  /* use DN & DNS */
102
103 /* OpenLDAP specific options */
104 #define LDAP_OPT_DEBUG_LEVEL            0x4001  /* OpenLDAP - debug level */
105
106 /* on/off values */
107 #define LDAP_OPT_ON             ((void *) 1)
108 #define LDAP_OPT_OFF    ((void *) 0)
109
110 #define LDAP_OPT_SUCCESS        0
111 #define LDAP_OPT_ERROR          (-1)
112
113 #define LDAP_API_INFO_VERSION   1
114 typedef struct ldapapiinfo {
115         int             ldapai_info_version;            /* version of LDAPAPIInfo (1) */
116         int             ldapai_api_version;                     /* revision of API supported */
117         int             ldapai_protocol_version;        /* highest LDAP version supported */
118         char    **ldapai_extensions;            /* names of API extensions */
119         char    *ldapai_vendor_name;            /* name of supplier */
120         int             ldapai_vendor_version;          /* supplier-specific version * 100 */
121 } LDAPAPIInfo;
122
123 #define LDAP_FEATURE_INFO_VERSION 1 /* version of api feature structure */
124 typedef struct ldap_apifeature_info {
125         int             ldapaif_info_version; /* version of this struct (1) */
126         char*   ldapaif_name;    /* matches LDAP_API_FEATURE_... less the prefix */
127         int             ldapaif_version; /* matches the value LDAP_API_FEATURE_... */
128 } LDAPAPIFeatureInfo;
129
130 typedef struct ldapcontrol {
131         char *                  ldctl_oid;
132         struct berval   ldctl_value;
133         char                    ldctl_iscritical;
134 } LDAPControl, *PLDAPControl;
135
136 #define LDAP_MAX_ATTR_LEN       100
137
138 /* 
139  * specific LDAP instantiations of BER types we know about
140  */
141
142 /* Overview of LBER tag construction
143  *
144  *      Bits
145  *      ______
146  *      8 7 | CLASS
147  *      0 0 = UNIVERSAL
148  *      0 1 = APPLICATION
149  *      1 0 = CONTEXT-SPECIFIC
150  *      1 1 = PRIVATE
151  *              _____
152  *              | 6 | DATA-TYPE
153  *                0 = PRIMITIVE
154  *                1 = CONSTRUCTED
155  *                      ___________
156  *                      | 5 ... 1 | TAG-NUMBER
157  */
158
159 /* general stuff */
160 #define LDAP_TAG_MESSAGE        0x30UL  /* constructed + 16 */
161 #define OLD_LDAP_TAG_MESSAGE    0x10UL  /* forgot the constructed bit  */
162 #define LDAP_TAG_MSGID          0x02UL  /* integer */
163 #define LDAP_TAG_LDAPDN         0x04UL  /* octect string */
164 #define LDAP_TAG_CONTROLS       0xa0UL  /* context specific + constructed + 0 */
165 #define LDAP_TAG_REFERRAL       0xa3UL  /* context specific + constructed + 3 */
166 #define LDAP_TAG_NEWSUPERIOR    0x80UL  /* context-specific + primitive + 0 */
167
168 #define LDAP_TAG_SASL_RES_CREDS 0x87UL  /* context specific + primitive */
169
170 /* possible operations a client can invoke */
171 #define LDAP_REQ_BIND                   0x60UL  /* application + constructed */
172 #define LDAP_REQ_UNBIND                 0x42UL  /* application + primitive   */
173 #define LDAP_REQ_SEARCH                 0x63UL  /* application + constructed */
174 #define LDAP_REQ_MODIFY                 0x66UL  /* application + constructed */
175 #define LDAP_REQ_ADD                    0x68UL  /* application + constructed */
176 #define LDAP_REQ_DELETE                 0x4aUL  /* application + primitive   */
177 #define LDAP_REQ_MODRDN                 0x6cUL  /* application + constructed */
178 #define LDAP_REQ_MODDN                  LDAP_REQ_MODRDN 
179 #define LDAP_REQ_RENAME                 LDAP_REQ_MODRDN 
180 #define LDAP_REQ_COMPARE                0x6eUL  /* application + constructed */
181 #define LDAP_REQ_ABANDON                0x50UL  /* application + primitive   */
182 #define LDAP_REQ_EXTENDED               0x77UL  /* application + constructed */
183
184 /* U-Mich version 3.0 compatibility stuff */
185 #define LDAP_REQ_UNBIND_30              0x62UL
186 #define LDAP_REQ_DELETE_30              0x6aUL
187 #define LDAP_REQ_ABANDON_30             0x70UL
188
189 /* 
190  * old broken stuff for backwards compatibility - forgot application tag
191  * and constructed/primitive bit
192  */
193 #define OLD_LDAP_REQ_BIND               0x00UL
194 #define OLD_LDAP_REQ_UNBIND             0x02UL
195 #define OLD_LDAP_REQ_SEARCH             0x03UL
196 #define OLD_LDAP_REQ_MODIFY             0x06UL
197 #define OLD_LDAP_REQ_ADD                0x08UL
198 #define OLD_LDAP_REQ_DELETE             0x0aUL
199 #define OLD_LDAP_REQ_MODRDN             0x0cUL
200 #define OLD_LDAP_REQ_COMPARE            0x0eUL
201 #define OLD_LDAP_REQ_ABANDON            0x10UL
202
203 /* possible result types a server can return */
204 #define LDAP_RES_BIND                   0x61UL  /* application + constructed */
205 #define LDAP_RES_SEARCH_ENTRY           0x64UL  /* application + constructed */
206 #define LDAP_RES_SEARCH_REFERENCE       0x73UL  /* V3: application + constructed */
207 #define LDAP_RES_SEARCH_RESULT          0x65UL  /* application + constructed */
208 #define LDAP_RES_MODIFY                 0x67UL  /* application + constructed */
209 #define LDAP_RES_ADD                    0x69UL  /* application + constructed */
210 #define LDAP_RES_DELETE                 0x6bUL  /* application + constructed */
211 #define LDAP_RES_MODRDN                 0x6dUL  /* application + constructed */
212 #define LDAP_RES_MODDN                  LDAP_RES_MODRDN /* application + constructed */
213 #define LDAP_RES_RENAME                 LDAP_RES_MODRDN /* application + constructed */
214 #define LDAP_RES_COMPARE                0x6fUL  /* application + constructed */
215 #define LDAP_RES_EXTENDED               0x78UL  /* V3: application + constructed */
216 #define LDAP_RES_ANY                    ((unsigned long)(-1))
217
218 /* old broken stuff for backwards compatibility */
219 #define OLD_LDAP_RES_BIND               0x01UL
220 #define OLD_LDAP_RES_SEARCH_ENTRY       0x04UL
221 #define OLD_LDAP_RES_SEARCH_RESULT      0x05UL
222 #define OLD_LDAP_RES_MODIFY             0x07UL
223 #define OLD_LDAP_RES_ADD                0x09UL
224 #define OLD_LDAP_RES_DELETE             0x0bUL
225 #define OLD_LDAP_RES_MODRDN             0x0dUL
226 #define OLD_LDAP_RES_MODDN              OLD_LDAP_RES_MODRDN
227 #define OLD_LDAP_RES_COMPARE            0x0fUL
228
229 /* sasl methods */
230 #define LDAP_SASL_SIMPLE                        NULL
231
232 /* authentication methods available */
233 #define LDAP_AUTH_NONE          0x00UL  /* no authentication              */
234 #define LDAP_AUTH_SIMPLE        0x80UL  /* context specific + primitive   */
235 #define LDAP_AUTH_SASL          0xa3UL  /* context specific + primitive   */
236 #define LDAP_AUTH_KRBV4         0xffUL  /* means do both of the following */
237 #define LDAP_AUTH_KRBV41        0x81UL  /* context specific + primitive   */
238 #define LDAP_AUTH_KRBV42        0x82UL  /* context specific + primitive   */
239
240 /* U-Mich version 3.0 compatibility auth methods */
241 #define LDAP_AUTH_SIMPLE_30     0xa0UL  /* context specific + constructed */
242 #define LDAP_AUTH_KRBV41_30     0xa1UL  /* context specific + constructed */
243 #define LDAP_AUTH_KRBV42_30     0xa2UL  /* context specific + constructed */
244
245 /* old broken stuff */
246 #define OLD_LDAP_AUTH_SIMPLE    0x00UL
247 #define OLD_LDAP_AUTH_KRBV4     0x01UL
248 #define OLD_LDAP_AUTH_KRBV42    0x02UL
249
250 /* filter types */
251 #define LDAP_FILTER_AND         0xa0UL  /* context specific + constructed */
252 #define LDAP_FILTER_OR          0xa1UL  /* context specific + constructed */
253 #define LDAP_FILTER_NOT         0xa2UL  /* context specific + constructed */
254 #define LDAP_FILTER_EQUALITY    0xa3UL  /* context specific + constructed */
255 #define LDAP_FILTER_SUBSTRINGS  0xa4UL  /* context specific + constructed */
256 #define LDAP_FILTER_GE          0xa5UL  /* context specific + constructed */
257 #define LDAP_FILTER_LE          0xa6UL  /* context specific + constructed */
258 #define LDAP_FILTER_PRESENT     0x87UL  /* context specific + primitive   */
259 #define LDAP_FILTER_APPROX      0xa8UL  /* context specific + constructed */
260 #define LDAP_FILTER_EXTENDED    0xa9UL  /* context specific + constructed */
261
262 /* U-Mich version 3.0 compatibility filter types */
263 #define LDAP_FILTER_PRESENT_30  0xa7UL  /* context specific + constructed */
264
265 /* old broken stuff */
266 #define OLD_LDAP_FILTER_AND             0x00UL
267 #define OLD_LDAP_FILTER_OR              0x01UL
268 #define OLD_LDAP_FILTER_NOT             0x02UL
269 #define OLD_LDAP_FILTER_EQUALITY        0x03UL
270 #define OLD_LDAP_FILTER_SUBSTRINGS      0x04UL
271 #define OLD_LDAP_FILTER_GE              0x05UL
272 #define OLD_LDAP_FILTER_LE              0x06UL
273 #define OLD_LDAP_FILTER_PRESENT         0x07UL
274 #define OLD_LDAP_FILTER_APPROX          0x08UL
275
276 /* extended filter component types */
277 #define LDAP_FILTER_EXTENDED_OID        0x81UL  /* context specific */
278 #define LDAP_FILTER_EXTENDED_TYPE       0x82UL  /* context specific */
279 #define LDAP_FILTER_EXTENDED_VALUE      0x83UL  /* context specific */
280 #define LDAP_FILTER_EXTENDED_DNATTRS    0x84UL  /* context specific */
281
282 /* substring filter component types */
283 #define LDAP_SUBSTRING_INITIAL  0x80UL  /* context specific */
284 #define LDAP_SUBSTRING_ANY      0x81UL  /* context specific */
285 #define LDAP_SUBSTRING_FINAL    0x82UL  /* context specific */
286
287 /* U-Mich version 3.0 compatibility substring filter component types */
288 #define LDAP_SUBSTRING_INITIAL_30       0xa0UL  /* context specific */
289 #define LDAP_SUBSTRING_ANY_30           0xa1UL  /* context specific */
290 #define LDAP_SUBSTRING_FINAL_30         0xa2UL  /* context specific */
291
292 /* old broken stuff */
293 #define OLD_LDAP_SUBSTRING_INITIAL      0x00UL
294 #define OLD_LDAP_SUBSTRING_ANY          0x01UL
295 #define OLD_LDAP_SUBSTRING_FINAL        0x02UL
296
297 /* search scopes */
298 #define LDAP_SCOPE_BASE         0x0000
299 #define LDAP_SCOPE_ONELEVEL     0x0001
300 #define LDAP_SCOPE_SUBTREE      0x0002
301
302 /* for modifications */
303 typedef struct ldapmod {
304         int             mod_op;
305 #define LDAP_MOD_ADD            0x0000
306 #define LDAP_MOD_DELETE         0x0001
307 #define LDAP_MOD_REPLACE        0x0002
308 #define LDAP_MOD_BVALUES        0x0080
309         char            *mod_type;
310         union mod_vals_u {
311                 char            **modv_strvals;
312                 struct berval   **modv_bvals;
313         } mod_vals;
314 #define mod_values      mod_vals.modv_strvals
315 #define mod_bvalues     mod_vals.modv_bvals
316 } LDAPMod;
317
318 /* 
319  * possible error codes we can return
320  */
321
322 #define LDAP_SUCCESS                    0x00
323 #define LDAP_OPERATIONS_ERROR           0x01
324 #define LDAP_PROTOCOL_ERROR             0x02
325 #define LDAP_TIMELIMIT_EXCEEDED         0x03
326 #define LDAP_SIZELIMIT_EXCEEDED         0x04
327 #define LDAP_COMPARE_FALSE              0x05
328 #define LDAP_COMPARE_TRUE               0x06
329 #define LDAP_STRONG_AUTH_NOT_SUPPORTED  0x07
330 #define LDAP_AUTH_METHOD_NOT_SUPPORTED LDAP_STRONG_AUTH_NOT_SUPPORTED
331 #define LDAP_STRONG_AUTH_REQUIRED       0x08
332 #define LDAP_PARTIAL_RESULTS            0x09    /* not listed in v3 */
333
334 #define LDAP_REFERRAL                           0x0a /* LDAPv3 */
335 #define LDAP_ADMINLIMIT_EXCEEDED        0x0b /* LDAPv3 */
336 #define LDAP_UNAVAILABLE_CRITICIAL_EXTENSION    0x0c /* LDAPv3 */
337 #define LDAP_CONFIDENTIALITY_REQUIRED   0x0d /* LDAPv3 */
338 #define LDAP_SASL_BIND_IN_PROGRESS      0x0e /* LDAPv3 */       
339
340 #define LDAP_NO_SUCH_ATTRIBUTE          0x10
341 #define LDAP_UNDEFINED_TYPE             0x11
342 #define LDAP_INAPPROPRIATE_MATCHING     0x12
343 #define LDAP_CONSTRAINT_VIOLATION       0x13
344 #define LDAP_TYPE_OR_VALUE_EXISTS       0x14
345 #define LDAP_INVALID_SYNTAX             0x15
346
347 #define LDAP_NO_SUCH_OBJECT             0x20
348 #define LDAP_ALIAS_PROBLEM              0x21
349 #define LDAP_INVALID_DN_SYNTAX          0x22
350 #define LDAP_IS_LEAF                    0x23 /* not LDAPv3 */
351 #define LDAP_ALIAS_DEREF_PROBLEM        0x24
352
353 #define LDAP_NAME_ERROR(n)      (((n) & 0x00f0) == 0x0020)
354
355 #define LDAP_INAPPROPRIATE_AUTH         0x30
356 #define LDAP_INVALID_CREDENTIALS        0x31
357 #define LDAP_INSUFFICIENT_ACCESS        0x32
358 #define LDAP_BUSY                       0x33
359 #define LDAP_UNAVAILABLE                0x34
360 #define LDAP_UNWILLING_TO_PERFORM       0x35
361 #define LDAP_LOOP_DETECT                0x36
362
363 #define LDAP_NAMING_VIOLATION           0x40
364 #define LDAP_OBJECT_CLASS_VIOLATION     0x41
365 #define LDAP_NOT_ALLOWED_ON_NONLEAF     0x42
366 #define LDAP_NOT_ALLOWED_ON_RDN         0x43
367 #define LDAP_ALREADY_EXISTS             0x44
368 #define LDAP_NO_OBJECT_CLASS_MODS       0x45
369 #define LDAP_RESULTS_TOO_LARGE          0x46 /* CLDAP */
370 #define LDAP_AFFECTS_MULTIPLE_DSAS      0x47 /* LDAPv3 */
371
372 #define LDAP_OTHER                      0x50
373 #define LDAP_SERVER_DOWN                0x51
374 #define LDAP_LOCAL_ERROR                0x52
375 #define LDAP_ENCODING_ERROR             0x53
376 #define LDAP_DECODING_ERROR             0x54
377 #define LDAP_TIMEOUT                    0x55
378 #define LDAP_AUTH_UNKNOWN               0x56
379 #define LDAP_FILTER_ERROR               0x57
380 #define LDAP_USER_CANCELLED             0x58
381 #define LDAP_PARAM_ERROR                0x59
382 #define LDAP_NO_MEMORY                  0x5a
383
384 #define LDAP_CONNECT_ERROR                              0x5b    /* new */
385 #define LDAP_NOT_SUPPORTED                              0x5c    /* new */
386 #define LDAP_CONTROL_NOT_FOUND                  0x5d    /* new */
387 #define LDAP_NO_RESULTS_RETURNED                0x5e    /* new */
388 #define LDAP_MORE_RESULTS_TO_RETURN             0x5f    /* new */
389 #define LDAP_CLIENT_LOOP                                0x60    /* new */
390 #define LDAP_REFERRAL_LIMIT_EXCEEDED    0x61    /* new */
391
392 /* default limit on nesting of referrals */
393 #define LDAP_DEFAULT_REFHOPLIMIT        5
394
395 /*
396  * This structure represents both ldap messages and ldap responses.
397  * These are really the same, except in the case of search responses,
398  * where a response has multiple messages.
399  */
400
401 typedef struct ldapmsg LDAPMessage;
402
403 /*
404  * structures for ldap getfilter routines
405  */
406
407 typedef struct ldap_filt_info {
408         char                    *lfi_filter;
409         char                    *lfi_desc;
410         int                     lfi_scope;      /* LDAP_SCOPE_BASE, etc */
411         int                     lfi_isexact;    /* exact match filter? */
412         struct ldap_filt_info   *lfi_next;
413 } LDAPFiltInfo;
414
415 typedef struct ldap_filt_list {
416     char                        *lfl_tag;
417     char                        *lfl_pattern;
418     char                        *lfl_delims;
419     LDAPFiltInfo                *lfl_ilist;
420     struct ldap_filt_list       *lfl_next;
421 } LDAPFiltList;
422
423
424 #define LDAP_FILT_MAXSIZ        1024
425
426 typedef struct ldap_filt_desc {
427         LDAPFiltList            *lfd_filtlist;
428         LDAPFiltInfo            *lfd_curfip;
429         LDAPFiltInfo            lfd_retfi;
430         char                    lfd_filter[ LDAP_FILT_MAXSIZ ];
431         char                    *lfd_curval;
432         char                    *lfd_curvalcopy;
433         char                    **lfd_curvalwords;
434         char                    *lfd_filtprefix;
435         char                    *lfd_filtsuffix;
436 } LDAPFiltDesc;
437
438
439 /*
440  * structure representing an ldap connection
441  */
442
443 typedef struct ldap LDAP;
444
445 #define LDAP_DEREF_NEVER        0x00
446 #define LDAP_DEREF_SEARCHING    0x01
447 #define LDAP_DEREF_FINDING      0x02
448 #define LDAP_DEREF_ALWAYS       0x03
449
450 #define LDAP_NO_LIMIT           0
451
452 /* how many messages to retrieve results for */
453 #define LDAP_MSG_ONE            0x00
454 #define LDAP_MSG_ALL            0x01
455 #define LDAP_MSG_RECEIVED       0x02
456
457 /*
458  * structure for ldap friendly mapping routines
459  */
460
461 typedef struct ldap_friendly {
462         char    *lf_unfriendly;
463         char    *lf_friendly;
464 } LDAPFriendlyMap;
465
466 /*
467  * types for ldap URL handling
468  */
469 typedef struct ldap_url_desc {
470     char        *lud_host;
471     int         lud_port;
472     char        *lud_dn;
473     char        **lud_attrs;
474     int         lud_scope;
475     char        *lud_filter;
476     char        *lud_string;    /* for internal use only */
477 } LDAPURLDesc;
478
479 #define LDAP_URL_ERR_NOTLDAP    0x01    /* URL doesn't begin with "ldap://" */
480 #define LDAP_URL_ERR_NODN       0x02    /* URL has no DN (required) */
481 #define LDAP_URL_ERR_BADSCOPE   0x03    /* URL scope string is invalid */
482 #define LDAP_URL_ERR_MEM        0x04    /* can't allocate memory space */
483
484 /* avoid pulling in headers */
485 struct timeval;
486
487 /*
488  * in options.c:
489  */
490 LDAP_F( int )
491 ldap_get_option LDAP_P((
492         LDAP *ld,
493         int option,
494         void *outvalue));
495
496 LDAP_F( int )
497 ldap_set_option LDAP_P((
498         LDAP *ld,
499         int option,
500         LDAP_CONST void *invalue));
501
502
503 /*
504  * in controls.c:
505  */
506 LDAP_F( void )
507 ldap_control_free LDAP_P((
508         LDAPControl *ctrl ));
509
510 LDAP_F( void )
511 ldap_controls_free LDAP_P((
512         LDAPControl **ctrls ));
513
514   
515 /*
516  * in extended.c:
517  */
518 LDAP_F( int )
519 ldap_extended_operation LDAP_P((
520         LDAP                    *ld,
521         LDAP_CONST char *exoid,
522         struct berval   *exdata,
523         LDAPControl             **serverctrls,
524         LDAPControl             **clientctrls,
525         int                             *msgidp ));
526
527 LDAP_F( int )
528 ldap_extended_operation_s LDAP_P((
529         LDAP                    *ld,
530         LDAP_CONST char *exoid,
531         struct berval   *exdata,
532         LDAPControl             **serverctrls,
533         LDAPControl             **clientctrls,
534         char                    **retoidp,
535         struct berval   **retdatap ));
536
537 /*
538  * in abandon.c:
539  */
540 LDAP_F( int )
541 ldap_abandon LDAP_P((
542         LDAP *ld,
543         int msgid ));
544
545 LDAP_F( int )
546 ldap_abandon_ext LDAP_P((
547         LDAP                    *ld,
548         int                             msgid,
549         LDAPControl             **serverctrls,
550         LDAPControl             **clientctrls ));
551
552
553 /*
554  * in add.c:
555  */
556 LDAP_F( int )
557 ldap_add_ext LDAP_P((
558         LDAP                    *ld,
559         LDAP_CONST char *dn,
560         LDAPMod                 **attrs,
561         LDAPControl             **serverctrls,
562         LDAPControl             **clientctrls,
563         int                     *msgidp ));
564
565 LDAP_F( int )
566 ldap_add_ext_s LDAP_P((
567         LDAP                    *ld,
568         LDAP_CONST char *dn,
569         LDAPMod                 **attrs,
570         LDAPControl             **serverctrls,
571         LDAPControl             **clientctrls ));
572
573 LDAP_F( int )
574 ldap_add LDAP_P((
575         LDAP *ld,
576         LDAP_CONST char *dn,
577         LDAPMod **attrs ));
578
579 LDAP_F( int )
580 ldap_add_s LDAP_P((
581         LDAP *ld,
582         LDAP_CONST char *dn,
583         LDAPMod **attrs ));
584
585
586 /*
587  * in saslbind.c:
588  */
589 LDAP_F( int )
590 ldap_sasl_bind LDAP_P((
591         LDAP                    *ld,
592         LDAP_CONST char *dn,
593         LDAP_CONST char *mechanism,
594         struct berval   *cred,
595         LDAPControl             **serverctrls,
596         LDAPControl             **clientctrls,
597         int                             msgidp ));
598
599 LDAP_F( int )
600 ldap_sasl_bind_s LDAP_P((
601         LDAP                    *ld,
602         LDAP_CONST char *dn,
603         LDAP_CONST char *mechanism,
604         struct berval   *cred,
605         LDAPControl             **serverctrls,
606         LDAPControl             **clientctrls,
607         struct berval   **servercredp ));
608
609
610 /*
611  * in bind.c:
612  *      (deprecated)
613  */
614 LDAP_F( int )
615 ldap_bind LDAP_P((
616         LDAP *ld,
617         LDAP_CONST char *who,
618         LDAP_CONST char *passwd,
619         int authmethod ));
620
621 LDAP_F( int )
622 ldap_bind_s LDAP_P((
623         LDAP *ld,
624         LDAP_CONST char *who,
625         LDAP_CONST char *cred,
626         int authmethod ));
627
628 LDAP_F( void )
629 ldap_set_rebind_proc LDAP_P((
630         LDAP *ld,
631         int (*rebindproc) LDAP_P((
632                 LDAP *ld,
633                 char **dnp,
634                 char **passwdp,
635                 int *authmethodp,
636                 int freeit ))));
637
638
639 /*
640  * in sbind.c:
641  */
642 LDAP_F( int )
643 ldap_simple_bind LDAP_P((
644         LDAP *ld,
645         LDAP_CONST char *who,
646         LDAP_CONST char *passwd ));
647
648 LDAP_F( int )
649 ldap_simple_bind_s LDAP_P((
650         LDAP *ld,
651         LDAP_CONST char *who,
652         LDAP_CONST char *passwd ));
653
654
655 /*
656  * in kbind.c:
657  *      (deprecated)
658  */
659 LDAP_F( int )
660 ldap_kerberos_bind_s LDAP_P((
661         LDAP *ld,
662         LDAP_CONST char *who ));
663
664 LDAP_F( int )
665 ldap_kerberos_bind1 LDAP_P((
666         LDAP *ld,
667         LDAP_CONST char *who ));
668
669 LDAP_F( int )
670 ldap_kerberos_bind1_s LDAP_P((
671         LDAP *ld,
672         LDAP_CONST char *who ));
673
674 LDAP_F( int )
675 ldap_kerberos_bind2 LDAP_P((
676         LDAP *ld,
677         LDAP_CONST char *who ));
678
679 LDAP_F( int )
680 ldap_kerberos_bind2_s LDAP_P((
681         LDAP *ld,
682         LDAP_CONST char *who ));
683
684 /*
685  * in cache.c
686  * DEPRECATED
687  */
688 LDAP_F( int )
689 ldap_enable_cache LDAP_P(( LDAP *ld, long timeout, long maxmem ));
690
691 LDAP_F( void )
692 ldap_disable_cache LDAP_P(( LDAP *ld ));
693
694 LDAP_F( void )
695 ldap_set_cache_options LDAP_P(( LDAP *ld, unsigned long opts ));
696
697 LDAP_F( void )
698 ldap_destroy_cache LDAP_P(( LDAP *ld ));
699
700 LDAP_F( void )
701 ldap_flush_cache LDAP_P(( LDAP *ld ));
702
703 LDAP_F( void )
704 ldap_uncache_entry LDAP_P(( LDAP *ld, LDAP_CONST char *dn ));
705
706 LDAP_F( void )
707 ldap_uncache_request LDAP_P(( LDAP *ld, int msgid ));
708
709
710 /*
711  * in compare.c:
712  */
713 LDAP_F( int )
714 ldap_compare_ext LDAP_P((
715         LDAP                    *ld,
716         LDAP_CONST char *dn,
717         LDAP_CONST char *attr,
718         struct berval   *bvalue,
719         LDAPControl             **serverctrls,
720         LDAPControl             **clientctrls,
721         int                     *msgidp ));
722
723 LDAP_F( int )
724 ldap_compare_ext_s LDAP_P((
725         LDAP                    *ld,
726         LDAP_CONST char *dn,
727         LDAP_CONST char *attr,
728         struct berval   *bvalue,
729         LDAPControl             **serverctrls,
730         LDAPControl             **clientctrls ));
731
732 LDAP_F( int )
733 ldap_compare LDAP_P((
734         LDAP *ld,
735         LDAP_CONST char *dn,
736         LDAP_CONST char *attr,
737         LDAP_CONST char *value ));
738
739 LDAP_F( int )
740 ldap_compare_s LDAP_P((
741         LDAP *ld,
742         LDAP_CONST char *dn,
743         LDAP_CONST char *attr,
744         LDAP_CONST char *value ));
745
746
747 /*
748  * in delete.c:
749  */
750 LDAP_F( int )
751 ldap_delete_ext LDAP_P((
752         LDAP                    *ld,
753         LDAP_CONST char *dn,
754         LDAPControl             **serverctrls,
755         LDAPControl             **clientctrls,
756         int                     *msgidp ));
757
758 LDAP_F( int )
759 ldap_delete_ext_s LDAP_P((
760         LDAP                    *ld,
761         LDAP_CONST char *dn,
762         LDAPControl             **serverctrls,
763         LDAPControl             **clientctrls ));
764
765 LDAP_F( int )
766 ldap_delete LDAP_P((
767         LDAP *ld,
768         LDAP_CONST char *dn ));
769
770 LDAP_F( int )
771 ldap_delete_s LDAP_P((
772         LDAP *ld,
773         LDAP_CONST char *dn ));
774
775
776 /*
777  * in error.c:
778  */
779 LDAP_F( int )
780 ldap_result2error LDAP_P(( LDAP *ld, LDAPMessage *r, int freeit ));
781 LDAP_F( char *)
782 ldap_err2string LDAP_P(( int err ));
783 LDAP_F( void )
784 ldap_perror LDAP_P((
785         LDAP *ld,
786         LDAP_CONST char *s ));
787
788
789 /*
790  * in modify.c:
791  */
792 LDAP_F( int )
793 ldap_modify_ext LDAP_P((
794         LDAP                    *ld,
795         LDAP_CONST char *dn,
796         LDAPMod                 **mods,
797         LDAPControl             **serverctrls,
798         LDAPControl             **clientctrls,
799         int                     *msgidp ));
800
801 LDAP_F( int )
802 ldap_modify_ext_s LDAP_P((
803         LDAP                    *ld,
804         LDAP_CONST char *dn,
805         LDAPMod                 **mods,
806         LDAPControl             **serverctrls,
807         LDAPControl             **clientctrls ));
808
809 LDAP_F( int )
810 ldap_modify LDAP_P((
811         LDAP *ld,
812         LDAP_CONST char *dn,
813         LDAPMod **mods ));
814
815 LDAP_F( int )
816 ldap_modify_s LDAP_P((
817         LDAP *ld,
818         LDAP_CONST char *dn,
819         LDAPMod **mods ));
820
821
822 /*
823  * in rename.c:
824  */
825 LDAP_F( int )
826 ldap_rename_ext LDAP_P((
827         LDAP                    *ld,
828         LDAP_CONST char *dn,
829         LDAP_CONST char *newrdn,
830         LDAP_CONST char *newparent,
831         int                             deleteoldrdn,
832         LDAPControl             **serverctrls,
833         LDAPControl             **clientctrls,
834         int                     *msgidp ));
835
836 LDAP_F( int )
837 ldap_rename_ext_s LDAP_P((
838         LDAP                    *ld,
839         LDAP_CONST char *dn,
840         LDAP_CONST char *newrdn,
841         LDAP_CONST char *newparent,
842         int                             deleteoldrdn,
843         LDAPControl             **serverctrls,
844         LDAPControl             **clientctrls ));
845
846
847 /*
848  * in modrdn.c:
849  */
850 LDAP_F( int )
851 ldap_modrdn LDAP_P((
852         LDAP *ld,
853         LDAP_CONST char *dn,
854         LDAP_CONST char *newrdn ));
855
856 LDAP_F( int )
857 ldap_modrdn_s LDAP_P((
858         LDAP *ld,
859         LDAP_CONST char *dn,
860         LDAP_CONST char *newrdn ));
861
862 LDAP_F( int )
863 ldap_modrdn2 LDAP_P((
864         LDAP *ld,
865         LDAP_CONST char *dn,
866         LDAP_CONST char *newrdn,
867         int deleteoldrdn ));
868
869 LDAP_F( int )
870 ldap_modrdn2_s LDAP_P((
871         LDAP *ld,
872         LDAP_CONST char *dn,
873         LDAP_CONST char *newrdn,
874         int deleteoldrdn));
875
876 LDAP_F( int )
877 ldap_rename2 LDAP_P((
878         LDAP *ld,
879         LDAP_CONST char *dn,
880         LDAP_CONST char *newrdn,
881         int deleteoldrdn,
882         LDAP_CONST char *newSuperior ));
883
884 LDAP_F( int )
885 ldap_rename2_s LDAP_P((
886         LDAP *ld,
887         LDAP_CONST char *dn,
888         LDAP_CONST char *newrdn,
889         int deleteoldrdn,
890         LDAP_CONST char *newSuperior));
891
892 /*
893  * in open.c:
894  */
895 LDAP_F( LDAP *)
896 ldap_open LDAP_P((
897         LDAP_CONST char *host,
898         int port ));
899
900 LDAP_F( LDAP *)
901 ldap_init LDAP_P((
902         LDAP_CONST char *host,
903         int port ));
904
905
906 /*
907  * in messages.c:
908  */
909 LDAP_F( LDAPMessage *)
910 ldap_first_message LDAP_P((
911         LDAP *ld,
912         LDAPMessage *chain ));
913
914 LDAP_F( LDAPMessage *)
915 ldap_next_message LDAP_P((
916         LDAP *ld,
917         LDAPMessage *msg ));
918
919 LDAP_F( int )
920 ldap_count_messages LDAP_P((
921         LDAP *ld,
922         LDAPMessage *chain ));
923
924
925 /*
926  * in references.c:
927  */
928 LDAP_F( LDAPMessage *)
929 ldap_first_reference LDAP_P((
930         LDAP *ld,
931         LDAPMessage *chain ));
932
933 LDAP_F( LDAPMessage *)
934 ldap_next_reference LDAP_P((
935         LDAP *ld,
936         LDAPMessage *ref ));
937
938 LDAP_F( int )
939 ldap_count_references LDAP_P((
940         LDAP *ld,
941         LDAPMessage *chain ));
942
943 LDAP_F( int )
944 ldap_parse_reference LDAP_P((
945         LDAP                    *ld,
946         LDAPMessage             *ref,
947         char                    ***referralsp,
948         LDAPControl             ***serverctrls,
949         int                             freeit));
950
951
952 /*
953  * in getentry.c:
954  */
955 LDAP_F( LDAPMessage *)
956 ldap_first_entry LDAP_P((
957         LDAP *ld,
958         LDAPMessage *chain ));
959
960 LDAP_F( LDAPMessage *)
961 ldap_next_entry LDAP_P((
962         LDAP *ld,
963         LDAPMessage *entry ));
964
965 LDAP_F( int )
966 ldap_count_entries LDAP_P((
967         LDAP *ld,
968         LDAPMessage *chain ));
969
970 LDAP_F( int )
971 ldap_get_entry_controls LDAP_P((
972         LDAP                    *ld,
973         LDAPMessage             *entry,
974         LDAPControl             ***serverctrls));
975
976
977 /*
978  * in addentry.c
979  */
980 LDAP_F( LDAPMessage *)
981 ldap_delete_result_entry LDAP_P((
982         LDAPMessage **list,
983         LDAPMessage *e ));
984
985 LDAP_F( void )
986 ldap_add_result_entry LDAP_P((
987         LDAPMessage **list,
988         LDAPMessage *e ));
989
990
991 /*
992  * in getdn.c
993  */
994 LDAP_F( char *)
995 ldap_get_dn LDAP_P((
996         LDAP *ld,
997         LDAPMessage *entry ));
998
999 LDAP_F( char *)
1000 ldap_dn2ufn LDAP_P((
1001         LDAP_CONST char *dn ));
1002
1003 LDAP_F( char **)
1004 ldap_explode_dn LDAP_P((
1005         LDAP_CONST char *dn,
1006         int notypes ));
1007
1008 LDAP_F( char **)
1009 ldap_explode_rdn LDAP_P((
1010         LDAP_CONST char *rdn,
1011         int notypes ));
1012
1013 LDAP_F( char *)
1014 ldap_parent_dn LDAP_P(( /* new (from slapd) */
1015         LDAP_CONST char *dn ));
1016
1017 LDAP_F( char *)
1018 ldap_relative_dn LDAP_P((       /* new (from slapd) */
1019         LDAP_CONST char *dn ));
1020
1021 LDAP_F( char *)
1022 ldap_normalize_dn LDAP_P((      /* new (from slapd) */
1023         LDAP_CONST char *dn ));
1024
1025 LDAP_F( char **)
1026 ldap_explode_dns LDAP_P(( /* deprecated */
1027         LDAP_CONST char *dn ));
1028
1029 LDAP_F( int )
1030 ldap_is_dns_dn LDAP_P(( /* deprecated */
1031         LDAP_CONST char *dn ));
1032
1033
1034 /*
1035  * in getattr.c
1036  */
1037 LDAP_F( char *)
1038 ldap_first_attribute LDAP_P((                                                                    
1039         LDAP *ld,
1040         LDAPMessage *entry,
1041         BerElement **ber ));
1042
1043 LDAP_F( char *)
1044 ldap_next_attribute LDAP_P((
1045         LDAP *ld,
1046         LDAPMessage *entry,
1047         BerElement *ber ));
1048
1049
1050 /*
1051  * in getvalues.c
1052  */
1053 LDAP_F( char **)
1054 ldap_get_values LDAP_P((
1055         LDAP *ld,
1056         LDAPMessage *entry,
1057         LDAP_CONST char *target ));
1058
1059 LDAP_F( struct berval **)
1060 ldap_get_values_len LDAP_P((
1061         LDAP *ld,
1062         LDAPMessage *entry,
1063         LDAP_CONST char *target ));
1064
1065 LDAP_F( int )
1066 ldap_count_values LDAP_P((
1067         char **vals ));
1068
1069 LDAP_F( int )
1070 ldap_count_values_len LDAP_P((
1071         struct berval **vals ));
1072
1073 LDAP_F( void )
1074 ldap_value_free LDAP_P((
1075         char **vals ));
1076
1077 LDAP_F( void )
1078 ldap_value_free_len LDAP_P((
1079         struct berval **vals ));
1080
1081 /*
1082  * in result.c:
1083  */
1084 LDAP_F( int )
1085 ldap_result LDAP_P((
1086         LDAP *ld,
1087         int msgid,
1088         int all,
1089         struct timeval *timeout,
1090         LDAPMessage **result ));
1091
1092 LDAP_F( int )
1093 ldap_msgtype LDAP_P((
1094         LDAPMessage *lm ));
1095
1096 LDAP_F( int )
1097 ldap_msgid   LDAP_P((
1098         LDAPMessage *lm ));
1099
1100 LDAP_F( int )
1101 ldap_msgfree LDAP_P((
1102         LDAPMessage *lm ));
1103
1104 LDAP_F( int )
1105 ldap_msgdelete LDAP_P((
1106         LDAP *ld,
1107         int msgid ));
1108
1109
1110 /*
1111  * in search.c:
1112  */
1113 LDAP_F( int )
1114 ldap_search_ext LDAP_P((
1115         LDAP                    *ld,
1116         LDAP_CONST char *base,
1117         int                             scope,
1118         LDAP_CONST char *filter,
1119         char                    **attrs,
1120         int                             attrsonly,
1121         LDAPControl             **serverctrls,
1122         LDAPControl             **clientctrls,
1123         struct timeval  *timeout,
1124         int                             sizelimit,
1125         int                             *msgidp ));
1126
1127 LDAP_F( int )
1128 ldap_search_ext_s LDAP_P((
1129         LDAP                    *ld,
1130         LDAP_CONST char *base,
1131         int                             scope,
1132         LDAP_CONST char *filter,
1133         char                    **attrs,
1134         int                             attrsonly,
1135         LDAPControl             **serverctrls,
1136         LDAPControl             **clientctrls,
1137         struct timeval  *timeout,
1138         int                             sizelimit,
1139         LDAPMessage             **res ));
1140
1141 LDAP_F( int )
1142 ldap_search LDAP_P((
1143         LDAP *ld,
1144         LDAP_CONST char *base,
1145         int scope,
1146         LDAP_CONST char *filter,
1147         char **attrs,
1148         int attrsonly ));
1149
1150 LDAP_F( int )
1151 ldap_search_s LDAP_P((
1152         LDAP *ld,
1153         LDAP_CONST char *base,
1154         int scope,
1155         LDAP_CONST char *filter,
1156         char **attrs,
1157         int attrsonly,
1158         LDAPMessage **res ));
1159
1160 LDAP_F( int )
1161 ldap_search_st LDAP_P((                                                  
1162         LDAP *ld,
1163         LDAP_CONST char *base,
1164         int scope,
1165         LDAP_CONST char *filter,
1166     char **attrs,
1167         int attrsonly,
1168         struct timeval *timeout,
1169         LDAPMessage **res ));
1170
1171
1172 /*
1173  * in ufn.c
1174  */
1175 LDAP_F( int )
1176 ldap_ufn_search_c LDAP_P((
1177         LDAP *ld,
1178         LDAP_CONST char *ufn,
1179         char **attrs,
1180         int attrsonly,
1181         LDAPMessage **res,
1182         int (*cancelproc)( void *cl ),
1183         void *cancelparm ));
1184
1185 LDAP_F( int )
1186 ldap_ufn_search_ct LDAP_P((
1187         LDAP *ld,
1188         LDAP_CONST char *ufn,
1189         char **attrs,
1190         int attrsonly,
1191         LDAPMessage **res,
1192         int (*cancelproc)( void *cl ),
1193         void *cancelparm,
1194         char *tag1,
1195         char *tag2,
1196         char *tag3 ));
1197
1198 LDAP_F( int )
1199 ldap_ufn_search_s LDAP_P((
1200         LDAP *ld,
1201         LDAP_CONST char *ufn,
1202         char **attrs,
1203         int attrsonly,
1204         LDAPMessage **res ));
1205
1206 LDAP_F( LDAPFiltDesc *)
1207 ldap_ufn_setfilter LDAP_P((
1208         LDAP *ld,
1209         LDAP_CONST char *fname ));
1210
1211 LDAP_F( void )
1212 ldap_ufn_setprefix LDAP_P((
1213         LDAP *ld,
1214         LDAP_CONST char *prefix ));
1215
1216 LDAP_F( int )
1217 ldap_ufn_timeout LDAP_P((
1218         void *tvparam ));
1219
1220
1221 /*
1222  * in unbind.c
1223  */
1224 LDAP_F( int )
1225 ldap_unbind LDAP_P((
1226         LDAP *ld ));
1227
1228 LDAP_F( int )
1229 ldap_unbind_s LDAP_P((
1230         LDAP *ld ));
1231
1232 LDAP_F( int )
1233 ldap_unbind_ext LDAP_P((
1234         LDAP                    *ld,
1235         LDAPControl             **serverctrls,
1236         LDAPControl             **clientctrls));
1237
1238 LDAP_F( int )
1239 ldap_unbind_ext_s LDAP_P((
1240         LDAP                    *ld,
1241         LDAPControl             **serverctrls,
1242         LDAPControl             **clientctrls));
1243
1244 /*
1245  * in getfilter.c
1246  */
1247 LDAP_F( LDAPFiltDesc *)
1248 ldap_init_getfilter LDAP_P((
1249         LDAP_CONST char *fname ));
1250
1251 LDAP_F( LDAPFiltDesc *)
1252 ldap_init_getfilter_buf LDAP_P((
1253         /* LDAP_CONST */ char *buf,
1254         long buflen ));
1255
1256 LDAP_F( LDAPFiltInfo *)
1257 ldap_getfirstfilter LDAP_P((
1258         LDAPFiltDesc *lfdp,
1259         /* LDAP_CONST */ char *tagpat,
1260         /* LDAP_CONST */ char *value ));
1261
1262 LDAP_F( LDAPFiltInfo *)
1263 ldap_getnextfilter LDAP_P((
1264         LDAPFiltDesc *lfdp ));
1265
1266 LDAP_F( void )
1267 ldap_setfilteraffixes LDAP_P((
1268         LDAPFiltDesc *lfdp,
1269         LDAP_CONST char *prefix,
1270         LDAP_CONST char *suffix ));
1271
1272 LDAP_F( void )
1273 ldap_build_filter LDAP_P((
1274         char *buf,
1275         unsigned long buflen,
1276         LDAP_CONST char *pattern,
1277         LDAP_CONST char *prefix,
1278         LDAP_CONST char *suffix,
1279         LDAP_CONST char *attr,
1280         LDAP_CONST char *value,
1281         char **valwords ));
1282
1283
1284 /*
1285  * in free.c
1286  */
1287 LDAP_F( void )
1288 ldap_memfree LDAP_P((
1289         void *p ));
1290
1291 LDAP_F( void )
1292 ldap_getfilter_free LDAP_P((
1293         LDAPFiltDesc *lfdp ));
1294
1295 LDAP_F( void )
1296 ldap_mods_free LDAP_P((
1297         LDAPMod **mods,
1298         int freemods ));
1299
1300
1301 /*
1302  * in friendly.c
1303  */
1304 LDAP_F( char * )
1305 ldap_friendly_name LDAP_P((
1306         LDAP_CONST char *filename,
1307         /* LDAP_CONST */ char *uname,
1308         LDAPFriendlyMap **map ));
1309
1310 LDAP_F( void )
1311 ldap_free_friendlymap LDAP_P((
1312         LDAPFriendlyMap **map ));
1313
1314
1315 /*
1316  * in cldap.c
1317  */
1318 LDAP_F( LDAP * )
1319 cldap_open LDAP_P((
1320         LDAP_CONST char *host,
1321         int port ));
1322
1323 LDAP_F( void )
1324 cldap_close LDAP_P((
1325         LDAP *ld ));
1326
1327 LDAP_F( int )
1328 cldap_search_s LDAP_P(( LDAP *ld,
1329         LDAP_CONST char *base,
1330         int scope,
1331         LDAP_CONST char *filter,
1332         char **attrs,
1333         int attrsonly,
1334         LDAPMessage **res,
1335         char *logdn ));
1336
1337 LDAP_F( void )
1338 cldap_setretryinfo LDAP_P((
1339         LDAP *ld,
1340         int tries,
1341         int timeout ));
1342
1343
1344 /*
1345  * in sort.c
1346  */
1347 LDAP_F( int )
1348 ldap_sort_entries LDAP_P(( LDAP *ld,
1349         LDAPMessage **chain,
1350         LDAP_CONST char *attr,
1351         int (*cmp) (LDAP_CONST char *, LDAP_CONST char *) ));
1352
1353 LDAP_F( int )
1354 ldap_sort_values LDAP_P((
1355         LDAP *ld,
1356         char **vals,
1357         int (*cmp) (LDAP_CONST void *, LDAP_CONST void *) ));
1358
1359 LDAP_F( int )
1360 ldap_sort_strcasecmp LDAP_P((
1361         LDAP_CONST void *a,
1362         LDAP_CONST void *b ));
1363
1364
1365 /*
1366  * in url.c
1367  *
1368  * need _ext varients
1369  */
1370 LDAP_F( int )
1371 ldap_is_ldap_url LDAP_P((
1372         LDAP_CONST char *url ));
1373
1374 LDAP_F( int )
1375 ldap_url_parse LDAP_P((
1376         LDAP_CONST char *url,
1377         LDAPURLDesc **ludpp ));
1378
1379 LDAP_F( void )
1380 ldap_free_urldesc LDAP_P((
1381         LDAPURLDesc *ludp ));
1382
1383 LDAP_F( int )
1384 ldap_url_search LDAP_P((
1385         LDAP *ld,
1386         LDAP_CONST char *url,
1387         int attrsonly ));
1388
1389 LDAP_F( int )
1390 ldap_url_search_s LDAP_P((
1391         LDAP *ld,
1392         LDAP_CONST char *url,
1393         int attrsonly,
1394         LDAPMessage **res ));
1395
1396 LDAP_F( int )
1397 ldap_url_search_st LDAP_P((
1398         LDAP *ld,
1399         LDAP_CONST char *url,
1400         int attrsonly,
1401         struct timeval *timeout,
1402         LDAPMessage **res ));
1403
1404
1405 /*
1406  * in charset.c
1407  *      DEPRECATED
1408  */
1409 LDAP_F( void )
1410 ldap_set_string_translators LDAP_P((
1411         LDAP *ld,
1412         BERTranslateProc encode_proc,
1413         BERTranslateProc decode_proc ));
1414
1415 LDAP_F( int )
1416 ldap_translate_from_t61 LDAP_P((
1417         LDAP *ld,
1418         char **bufp,
1419         unsigned long *lenp,
1420         int free_input ));
1421
1422 LDAP_F( int )
1423 ldap_translate_to_t61 LDAP_P((
1424         LDAP *ld,
1425         char **bufp,
1426         unsigned long *lenp, int free_input ));
1427
1428 LDAP_F( void )
1429 ldap_enable_translation LDAP_P((
1430         LDAP *ld,
1431         LDAPMessage *entry,
1432         int enable ));
1433
1434 LDAP_F( int )
1435 ldap_t61_to_8859 LDAP_P((
1436         char **bufp,
1437         unsigned long *buflenp,
1438         int free_input ));
1439
1440 LDAP_F( int )
1441 ldap_8859_to_t61 LDAP_P((
1442         char **bufp,
1443         unsigned long *buflenp,
1444         int free_input ));
1445
1446 LDAP_END_DECL
1447
1448 #endif /* _LDAP_H */