From: Kurt Zeilenga Date: Mon, 26 Oct 1998 01:49:56 +0000 (+0000) Subject: More header work toward draft-ietf-ldapext-ldap-c-api-01. X-Git-Tag: PHP3_TOOL_0_0~10 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=43f29c3cb85f252b3c6aaf39e85a5d02bffb51e0;p=openldap More header work toward draft-ietf-ldapext-ldap-c-api-01. --- diff --git a/clients/fax500/main.c b/clients/fax500/main.c index cb458ccb3a..7f526dd794 100644 --- a/clients/fax500/main.c +++ b/clients/fax500/main.c @@ -30,6 +30,12 @@ #include "lber.h" #include "ldap.h" + +#if LDAP_VERSION < LDAP_VERSION3 +/* quick fix until we have ldap_set_options */ +#include "../libraries/libldap/ldap-int.h" +#endif + #include #define USER 0 diff --git a/clients/fax500/rp500.c b/clients/fax500/rp500.c index 540554cfba..f29f23fab6 100644 --- a/clients/fax500/rp500.c +++ b/clients/fax500/rp500.c @@ -26,6 +26,11 @@ #include #include +#if LDAP_VERSION < LDAP_VERSION3 +/* quick fix until we have ldap_set_options */ +#include "../libraries/libldap/ldap-int.h" +#endif + #include #define DEFAULT_PORT 79 diff --git a/clients/finger/main.c b/clients/finger/main.c index 90d3f0c0ed..be4e7778ca 100644 --- a/clients/finger/main.c +++ b/clients/finger/main.c @@ -27,6 +27,12 @@ #include "lber.h" #include "ldap.h" + +#if LDAP_VERSION < LDAP_VERSION3 +/* quick fix until we have ldap_set_options */ +#include "../libraries/libldap/ldap-int.h" +#endif + #include "disptmpl.h" #include "ldapconfig.h" diff --git a/clients/gopher/go500.c b/clients/gopher/go500.c index 6a8a70c528..bbd64abefe 100644 --- a/clients/gopher/go500.c +++ b/clients/gopher/go500.c @@ -32,6 +32,12 @@ #include "ldapconfig.h" #include "lber.h" #include "ldap.h" + +#if LDAP_VERSION < LDAP_VERSION3 +/* quick fix until we have ldap_set_options */ +#include "../libraries/libldap/ldap-int.h" +#endif + #include "disptmpl.h" int debug; diff --git a/clients/gopher/go500gw.c b/clients/gopher/go500gw.c index df804c5024..0fa939cccd 100644 --- a/clients/gopher/go500gw.c +++ b/clients/gopher/go500gw.c @@ -31,6 +31,12 @@ #include "lber.h" #include "ldap.h" + +#if LDAP_VERSION < LDAP_VERSION3 +/* quick fix until we have ldap_set_options */ +#include "../libraries/libldap/ldap-int.h" +#endif + #include "disptmpl.h" #include "ldapconfig.h" diff --git a/clients/mail500/main.c b/clients/mail500/main.c index 534eb0111d..a994d52fc4 100644 --- a/clients/mail500/main.c +++ b/clients/mail500/main.c @@ -30,6 +30,12 @@ #include "lber.h" #include "ldap.h" + +#if LDAP_VERSION < LDAP_VERSION3 +/* quick fix until we have ldap_set_options */ +#include "../libraries/libldap/ldap-int.h" +#endif + #include "ldapconfig.h" #define USER 0x01 diff --git a/clients/rcpt500/query.c b/clients/rcpt500/query.c index 85b0f5b5f8..aac3e22532 100644 --- a/clients/rcpt500/query.c +++ b/clients/rcpt500/query.c @@ -17,6 +17,12 @@ #include "lber.h" #include "ldap.h" + +#if LDAP_VERSION < LDAP_VERSION3 +/* quick fix until we have ldap_set_options */ +#include "../libraries/libldap/ldap-int.h" +#endif + #include "disptmpl.h" #include "rcpt500.h" diff --git a/clients/ud/main.c b/clients/ud/main.c index 53465fc602..2eb650b64e 100644 --- a/clients/ud/main.c +++ b/clients/ud/main.c @@ -35,6 +35,7 @@ #include #include + #include #include "ud.h" diff --git a/clients/ud/ud.h b/clients/ud/ud.h index 9a54cafae3..f381e9e200 100644 --- a/clients/ud/ud.h +++ b/clients/ud/ud.h @@ -12,6 +12,11 @@ #include "portable.h" +#if LDAP_VERSION < LDAP_VERSION3 +/* quick fix until we have ldap_set_options */ +#include "../libraries/libldap/ldap-int.h" +#endif + #ifdef DOS #define MAX_VALUES 8 #else diff --git a/include/lber.h b/include/lber.h index d003873135..0a028f980c 100644 --- a/include/lber.h +++ b/include/lber.h @@ -83,6 +83,9 @@ typedef struct berelement BerElement; typedef struct sockbuf Sockbuf; #define READBUFSIZ 8192 +typedef struct seqorset Seqorset; +#define NULLSEQORSET ((Seqorset *) 0) + /* structure for returning a sequence of octet strings + length */ struct berval { unsigned long bv_len; diff --git a/include/ldap.h b/include/ldap.h index a82b7fa51d..2486fe07fb 100644 --- a/include/ldap.h +++ b/include/ldap.h @@ -54,8 +54,7 @@ LDAP_BEGIN_DECL #define LDAP_OPT_SUCCESS 0 #define LDAP_OPT_ERROR (-1) -LDAP_F int ldap_get_option LDAP_P((LDAP *ld, int option, void *outvalue)); -LDAP_F int ldap_set_option LDAP_P((LDAP *ld, int option, void *invalue)); +extern int ldap_debug; typedef struct ldapapiinfo { int ldapai_info_version; /* version of LDAPAPIInfo (1) */ @@ -72,10 +71,6 @@ typedef struct ldapcontrol { char ldctl_iscritical; } LDAPControl, *PLDAPControl; -LDAP_F void ldap_control_free LDAP_P(( LDAPControl *ctrl )); -LDAP_F void ldap_controls_free LDAP_P(( LDAPControl **ctrls )); - - #define LDAP_MAX_ATTR_LEN 100 /* @@ -457,6 +452,12 @@ typedef struct ldap_url_desc { in function param list warning */ typedef struct timeval LDAPtv; +LDAP_F int ldap_get_option LDAP_P((LDAP *ld, int option, void *outvalue)); +LDAP_F int ldap_set_option LDAP_P((LDAP *ld, int option, void *invalue)); + +LDAP_F void ldap_control_free LDAP_P(( LDAPControl *ctrl )); +LDAP_F void ldap_controls_free LDAP_P(( LDAPControl **ctrls )); + /* * in abandon.c: */ diff --git a/include/ldap_log.h b/include/ldap_log.h index 7efc5872c7..08dab9cd08 100644 --- a/include/ldap_log.h +++ b/include/ldap_log.h @@ -63,4 +63,4 @@ extern void Debug( int level, char* fmt, ... ); LDAP_END_DECL -#endif /* _LDAP_H */ +#endif /* _LDAP_LOG_H */ diff --git a/libraries/liblber/lber-int.h b/libraries/liblber/lber-int.h index eef5e18b39..66e5084d84 100644 --- a/libraries/liblber/lber-int.h +++ b/libraries/liblber/lber-int.h @@ -17,7 +17,7 @@ LDAP_BEGIN_DECL -typedef struct berelement { +struct berelement { char *ber_buf; char *ber_ptr; char *ber_end; @@ -32,10 +32,10 @@ typedef struct berelement { char *ber_rwptr; BERTranslateProc ber_encode_translate_proc; BERTranslateProc ber_decode_translate_proc; -} BerElement; +}; #define NULLBER ((BerElement *) 0) -typedef struct sockbuf { +struct sockbuf { #ifndef MACOS int sb_sd; #else /* MACOS */ @@ -56,17 +56,17 @@ typedef struct sockbuf { #define LBER_NO_READ_AHEAD 0x08 /* read only as much as requested */ int sb_fd; long sb_max_incoming; -} Sockbuf; +}; #define READBUFSIZ 8192 -typedef struct seqorset { +struct seqorset { BerElement *sos_ber; unsigned long sos_clen; unsigned long sos_tag; char *sos_first; char *sos_ptr; struct seqorset *sos_next; -} Seqorset; +}; #define NULLSEQORSET ((Seqorset *) 0) #endif /* _LBER_INT_H */ diff --git a/libraries/libldap/ldap-int.h b/libraries/libldap/ldap-int.h index f211429984..dfe459f241 100644 --- a/libraries/libldap/ldap-int.h +++ b/libraries/libldap/ldap-int.h @@ -5,6 +5,8 @@ * ldap-int.h - defines & prototypes internal to the LDAP library */ +#ifndef _LDAP_INT_H +#define _LDAP_INT_H 1 #include "../liblber/lber-int.h" #include "ldap_log.h" @@ -34,20 +36,20 @@ LDAP_BEGIN_DECL * where a response has multiple messages. */ -typedef struct ldapmsg { +struct ldapmsg { int lm_msgid; /* the message id */ int lm_msgtype; /* the message type */ BerElement *lm_ber; /* the ber encoded message contents */ struct ldapmsg *lm_chain; /* for search - next msg in the resp */ struct ldapmsg *lm_next; /* next response */ unsigned int lm_time; /* used to maintain cache */ -} LDAPMessage; +}; /* * structure representing an ldap connection */ -typedef struct ldap { +struct ldap { Sockbuf ld_sb; /* socket descriptor & buffer */ char *ld_host; int ld_version; @@ -95,7 +97,7 @@ typedef struct ldap { char **passwdp, int *authmethodp, int freeit ); /* routine to get info needed for re-bind */ #endif /* LDAP_REFERRALS */ -} LDAP; +}; /* * in cache.c @@ -210,3 +212,5 @@ int ldap_8859_to_t61( char **bufp, unsigned long *buflenp, int free_input ); LDAP_END_DECL #endif /* STR_TRANSLATION && LDAP_DEFAULT_CHARSET */ + +#endif /* _LDAP_INT_H */ diff --git a/libraries/libldap/test.c b/libraries/libldap/test.c index 34c1eb9250..f530906555 100644 --- a/libraries/libldap/test.c +++ b/libraries/libldap/test.c @@ -20,9 +20,6 @@ #include -#include "lber.h" -#include "ldap.h" - /* including the "internal" defs is legit and nec. since this test routine has * a-priori knowledge of libldap internal workings. * hodges@stanford.edu 5-Feb-96 diff --git a/libraries/libldap/tmplout.c b/libraries/libldap/tmplout.c index 823b36a30c..84ae94c90e 100644 --- a/libraries/libldap/tmplout.c +++ b/libraries/libldap/tmplout.c @@ -8,9 +8,8 @@ #include #include -#include -#include #include +#include #include #ifdef HAVE_SYS_FILE_H @@ -18,7 +17,8 @@ #endif #include "lber.h" -#include "ldap.h" +#include "ldap-int.h" +#include "ldap_log.h" #include "disptmpl.h" #include "ldapconfig.h" diff --git a/servers/slapd/slap.h b/servers/slapd/slap.h index 150d384e7c..f8cba4ce1d 100644 --- a/servers/slapd/slap.h +++ b/servers/slapd/slap.h @@ -17,6 +17,10 @@ #include "avl.h" #include "lber.h" #include "ldap.h" +#include "ldap_log.h" + +#include "../libraries/libldap/ldap-int.h" + #include "lthread.h" #include "lthread_rdwr.h" #include "ldif.h" diff --git a/servers/slurpd/slurp.h b/servers/slurpd/slurp.h index efc9856502..8c29837875 100644 --- a/servers/slurpd/slurp.h +++ b/servers/slurpd/slurp.h @@ -26,6 +26,8 @@ #include "lber.h" #include "ldap.h" +#include "ldap_log.h" +#include "../libraries/libldap/ldap-int.h" #include "lthread.h" #include "ldapconfig.h" #include "ldif.h"