Clean up headers.
/* cross compilers should define both AC_INT{2,4}_TYPE in CPPFLAGS */
-#if !defined( AC_INT4_TYPE )
+#if !defined( AC_INT4_TYPE )
/* use autoconf defines to provide sized typedefs */
# if SIZEOF_LONG == 4
# define AC_INT4_TYPE long
typedef signed AC_INT4_TYPE ac_sint4;
typedef unsigned AC_INT4_TYPE ac_uint4;
-#if !defined( AC_INT2_TYPE )
+#if !defined( AC_INT2_TYPE )
# if SIZEOF_SHORT == 2
# define AC_INT2_TYPE short
# elif SIZEOF_INT == 2
/* # error "AC_INT2_TYPE?" */
# endif
#endif
-
-#if defined( AC_INT2_TYPE )
+
+#if defined( AC_INT2_TYPE )
typedef AC_INT2_TYPE ac_int2;
typedef signed AC_INT2_TYPE ac_sint2;
typedef unsigned AC_INT2_TYPE ac_uint2;
/* no sys_errlist */
# define sys_nerr 0
# define sys_errlist ((char **)0)
-#elif DECL_SYS_ERRLIST
+#elif DECL_SYS_ERRLIST
/* have sys_errlist but need declaration */
LDAP_LIBC_V(int) sys_nerr;
LDAP_LIBC_V(char) *sys_errlist[];
#error "No POSIX REGEX available."
#elif HAVE_GNUREGEX_H
- /* system has GNU gnuregex.h */
+ /* system has GNU gnuregex.h */
# include <gnuregex.h>
#else
/* have regex.h, assume it's POSIX compliant */
* two signals reserved for user applications. This forces
* OpenLDAP to use other signals reserved for other uses.
*/
-
+
# if defined( SIGSTKFLT )
# define LDAP_SIGUSR1 SIGSTKFLT
# elif defined ( SIGSYS )
#ifdef HAVE_PIPE
/*
- * Only use pipe() on systems where file and socket descriptors
+ * Only use pipe() on systems where file and socket descriptors
* are interchangable
*/
# define USE_PIPE HAVE_PIPE
BER_MEMFREE_FN bmf_free;
} BerMemoryFunctions;
-/* LBER Sockbuf_IO options */
+/* LBER Sockbuf_IO options */
#define LBER_SB_OPT_GET_FD 1
#define LBER_SB_OPT_SET_FD 2
#define LBER_SB_OPT_HAS_IO 3
int (*sbi_setup)( Sockbuf_IO_Desc *sbiod, void *arg );
int (*sbi_remove)( Sockbuf_IO_Desc *sbiod );
int (*sbi_ctrl)( Sockbuf_IO_Desc *sbiod, int opt, void *arg);
-
+
ber_slen_t (*sbi_read)( Sockbuf_IO_Desc *sbiod, void *buf,
ber_len_t len );
ber_slen_t (*sbi_write)( Sockbuf_IO_Desc *sbiod, void *buf,
ber_len_t len );
-
+
int (*sbi_close)( Sockbuf_IO_Desc *sbiod );
};
LDAP_CONST char *last ));
LBER_F( ber_tag_t )
-ber_scanf LDAP_P((
+ber_scanf LDAP_P((
BerElement *ber,
LDAP_CONST char *fmt,
... ));
/*
* We'll use 2000+draft revision for our API version number
- * As such, the number will be above the old RFC but below
+ * As such, the number will be above the old RFC but below
* whatever number does finally get assigned
*/
#define LDAP_API_VERSION 2004
#define LDAP_TAG_EXOP_X_MODIFY_PASSWD_NEW ((ber_tag_t) 0x82U)
#define LDAP_TAG_EXOP_X_MODIFY_PASSWD_GEN ((ber_tag_t) 0x80U)
-/*
+/*
* specific LDAP instantiations of BER types we know about
*/
#define LDAP_REQ_ADD ((ber_tag_t) 0x68U) /* application + constructed */
#define LDAP_REQ_DELETE ((ber_tag_t) 0x4aU) /* application + primitive */
#define LDAP_REQ_MODDN ((ber_tag_t) 0x6cU) /* application + constructed */
-#define LDAP_REQ_MODRDN LDAP_REQ_MODDN
-#define LDAP_REQ_RENAME LDAP_REQ_MODDN
+#define LDAP_REQ_MODRDN LDAP_REQ_MODDN
+#define LDAP_REQ_RENAME LDAP_REQ_MODDN
#define LDAP_REQ_COMPARE ((ber_tag_t) 0x6eU) /* application + constructed */
#define LDAP_REQ_ABANDON ((ber_tag_t) 0x50U) /* application + primitive */
#define LDAP_REQ_EXTENDED ((ber_tag_t) 0x77U) /* application + constructed */
#define LDAP_SUBSTRING_ANY ((ber_tag_t) 0x81U) /* context specific */
#define LDAP_SUBSTRING_FINAL ((ber_tag_t) 0x82U) /* context specific */
-/*
+/*
* possible error codes we can return
*/
#define LDAP_ADMINLIMIT_EXCEEDED 0x0b /* LDAPv3 */
#define LDAP_UNAVAILABLE_CRITICAL_EXTENSION 0x0c /* LDAPv3 */
#define LDAP_CONFIDENTIALITY_REQUIRED 0x0d /* LDAPv3 */
-#define LDAP_SASL_BIND_IN_PROGRESS 0x0e /* LDAPv3 */
+#define LDAP_SASL_BIND_IN_PROGRESS 0x0e /* LDAPv3 */
#define LDAP_ATTR_ERROR(n) LDAP_RANGE((n),0x10,0x15) /* 16-21 */
/*
* in controls.c:
*/
-LDAP_F( int )
-ldap_create_control LDAP_P((
- const char *requestOID,
- BerElement *ber,
+LDAP_F( int )
+ldap_create_control LDAP_P((
+ const char *requestOID,
+ BerElement *ber,
int iscritical,
LDAPControl **ctrlp ));
int port ));
LDAP_F( int )
-ldap_create LDAP_P((
+ldap_create LDAP_P((
LDAP **ldp ));
LDAP_F( int )
unsigned flags ));
LDAP_F( int )
-ldap_str2rdn LDAP_P((
- const char *str,
- LDAPRDN **rdn,
+ldap_str2rdn LDAP_P((
+ const char *str,
+ LDAPRDN **rdn,
const char **next,
unsigned flags ));
LDAP_F( int )
-ldap_rdn2str LDAP_P((
- LDAPRDN *rdn,
- char **str,
+ldap_rdn2str LDAP_P((
+ LDAPRDN *rdn,
+ char **str,
unsigned flags ));
LDAP_F( int )
* in getattr.c
*/
LDAP_F( char * )
-ldap_first_attribute LDAP_P((
+ldap_first_attribute LDAP_P((
LDAP *ld,
LDAPMessage *entry,
BerElement **ber ));
ldap_init_getfilter LDAP_P(( /* deprecated */
LDAP_CONST char *fname ));
-LDAP_F( LDAPFiltDesc * )
-ldap_init_getfilter_buf LDAP_P(( /* deprecated */
- /* LDAP_CONST */ char *buf,
- ber_len_t buflen ));
-
LDAP_F( LDAPFiltInfo * )
ldap_getfirstfilter LDAP_P(( /* deprecated */
LDAPFiltDesc *lfdp,
ldap_getnextfilter LDAP_P(( /* deprecated */
LDAPFiltDesc *lfdp ));
-LDAP_F( void )
-ldap_setfilteraffixes LDAP_P(( /* deprecated */
- LDAPFiltDesc *lfdp,
- LDAP_CONST char *prefix,
- LDAP_CONST char *suffix ));
-
-LDAP_F( void )
-ldap_build_filter LDAP_P(( /* deprecated */
- char *buf,
- ber_len_t buflen,
- LDAP_CONST char *pattern,
- LDAP_CONST char *prefix,
- LDAP_CONST char *suffix,
- LDAP_CONST char *attr,
- LDAP_CONST char *value,
- char **valwords ));
-
/*
* in free.c
struct timeval *timeout,
LDAPMessage **res ));
-/*
- * in sortctrl.c
+/*
+ * in sortctrl.c
*/
/*
- * structure for a sort-key
+ * structure for a sort-key
*/
typedef struct ldapsortkey {
char * attributeType;
LDAPSortKey **sortkeylist ));
LDAP_F( int )
-ldap_create_sort_control LDAP_P((
- LDAP *ld,
+ldap_create_sort_control LDAP_P((
+ LDAP *ld,
LDAPSortKey **keyList,
int ctl_iscritical,
LDAPControl **ctrlp ));
LDAP_F( int )
ldap_parse_sort_control LDAP_P((
- LDAP *ld,
- LDAPControl **ctrlp,
+ LDAP *ld,
+ LDAPControl **ctrlp,
unsigned long *result,
char **attribute ));
-/*
- * in vlvctrl.c
+/*
+ * in vlvctrl.c
*/
/*
*/
typedef struct ldapvlvinfo {
int ldvlv_version;
- unsigned long ldvlv_before_count;
- unsigned long ldvlv_after_count;
- unsigned long ldvlv_offset;
+ unsigned long ldvlv_before_count;
+ unsigned long ldvlv_after_count;
+ unsigned long ldvlv_offset;
unsigned long ldvlv_count;
struct berval *ldvlv_attrvalue;
struct berval *ldvlv_context;
void *ldvlv_extradata;
} LDAPVLVInfo;
-LDAP_F( int )
+LDAP_F( int )
ldap_create_vlv_control LDAP_P((
- LDAP *ld,
+ LDAP *ld,
LDAPVLVInfo *ldvlistp,
LDAPControl **ctrlp ));
LDAP_F( int )
-ldap_parse_vlv_control LDAP_P((
- LDAP *ld,
+ldap_parse_vlv_control LDAP_P((
+ LDAP *ld,
LDAPControl **ctrls,
- unsigned long *target_posp,
- unsigned long *list_countp,
+ unsigned long *target_posp,
+ unsigned long *list_countp,
struct berval **contextp,
int *errcodep ));
/* timeout for searches */
#define FINGER_TIMEOUT 60
/* number of DN components to show in entry displays */
-#define FINGER_RDNCOUNT DEFAULT_RDNCOUNT
+#define FINGER_RDNCOUNT DEFAULT_RDNCOUNT
/*
* GO500 GOPHER GATEWAY DEFINITIONS
*/
/* #define GO500_HOSTNAME "fully.qualified.hostname.here" */
/* number of DN components to show in entry displays */
-#define GO500_RDNCOUNT DEFAULT_RDNCOUNT
+#define GO500_RDNCOUNT DEFAULT_RDNCOUNT
/*
* GO500GW GOPHER GATEWAY DEFINITIONS
*/
/* #define GO500GW_HOSTNAME "fully.qualified.hostname.here" */
/* number of DN components to show in entry displays */
-#define GO500GW_RDNCOUNT DEFAULT_RDNCOUNT
+#define GO500GW_RDNCOUNT DEFAULT_RDNCOUNT
/*
* RCPT500 MAIL RESPONDER GATEWAY DEFINITIONS
#define RCPT500_UFN
#endif
/* number of DN components to show in entry displays */
-#define RCPT500_RDNCOUNT DEFAULT_RDNCOUNT
+#define RCPT500_RDNCOUNT DEFAULT_RDNCOUNT
/*
* MAIL500 MAILER DEFINITIONS
#define SLAPD_DEFAULT_CONFIGFILE LDAP_SYSCONFDIR LDAP_DIRSEP "slapd.conf"
#define SLAPD_DEFAULT_UCDATA LDAP_DATADIR LDAP_DIRSEP "ucdata"
/* default max deref depth for aliases */
-#define SLAPD_DEFAULT_MAXDEREFDEPTH 15
+#define SLAPD_DEFAULT_MAXDEREFDEPTH 15
/* default sizelimit on number of entries from a search */
#define SLAPD_DEFAULT_SIZELIMIT 500
/* default timelimit to spend on a search */
LDAP_F( int )
ldap_pvt_gethostbyname_a LDAP_P((
- const char *name,
+ const char *name,
struct hostent *resbuf,
char **buf,
struct hostent **result,
#define LDAP_PVT_THREAD_STACK_SIZE (16*1024*1024)
#endif
-LDAP_F( int )
+LDAP_F( int )
ldap_pvt_thread_create LDAP_P((
- ldap_pvt_thread_t * thread,
+ ldap_pvt_thread_t * thread,
int detach,
- void *(*start_routine)( void * ),
+ void *(*start_routine)( void * ),
void *arg));
-LDAP_F( void )
+LDAP_F( void )
ldap_pvt_thread_exit LDAP_P(( void *retval ));
LDAP_F( int )
LDAP_F( int )
ldap_pvt_thread_cond_wait LDAP_P((
- ldap_pvt_thread_cond_t *cond,
+ ldap_pvt_thread_cond_t *cond,
ldap_pvt_thread_mutex_t *mutex ));
LDAP_F( int )
LDAP_BEGIN_DECL
-/*
+/*
* UTF-8 (in utf-8.c)
*/
* TOP-LEVEL DIRECTORY OF THE DISTRIBUTION. ANY USE OR EXPLOITATION OF THIS
* WORK OTHER THAN AS AUTHORIZED IN VERSION 2.0.1 OF THE OPENLDAP PUBLIC
* LICENSE, OR OTHER PRIOR WRITTEN CONSENT FROM NOVELL, COULD SUBJECT THE
- * PERPETRATOR TO CRIMINAL AND CIVIL LIABILITY.
+ * PERPETRATOR TO CRIMINAL AND CIVIL LIABILITY.
******************************************************************************/
#ifndef _LDAP_UTF8_H
#include <lber_types.h> /* get ber_*_t */
-/*
+/*
* UTF-8 Utility Routines
*/
typedef MDBM *LDBM;
LDAP_END_DECL
-
+
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
typedef struct {
uint32 state[5];
- uint32 count[2];
+ uint32 count[2];
unsigned char buffer[64];
} lutil_SHA1_CTX;
-
+
LDAP_LUTIL_F( void )
lutil_SHA1Transform
LDAP_P((uint32 state[5], const unsigned char buffer[64]));
#define SLIST_HEAD_INITIALIZER(head) \
{ NULL }
-
+
#define SLIST_ENTRY(type) \
struct { \
struct type *sle_next; /* next element */ \
}
-
+
/*
* Singly-linked List functions.
*/
* 3. Altered versions must be plainly marked as such, and must not be
* misrepresented as being the original software. Since few users
* ever read sources, credits should appear in the documentation.
- *
+ *
* 4. This notice may not be removed or altered.
*
******************************************************************************/
/*
* Rewrite modes (input values for rewrite_info_init); determine the
* behavior in case a null or non existent context is required:
- *
+ *
* REWRITE_MODE_ERR error
* REWRITE_MODE_OK no error but no rewrite
* REWRITE_MODE_COPY_INPUT a copy of the input is returned
/*
* Rewrite status returns
- *
+ *
* REWRITE_REGEXEC_OK success (result may be empty in case
* of no match)
* REWRITE_REGEXEC_ERR error (internal error,
*
* What to do in case of non-existing rewrite context is still an issue.
* Four possibilities:
- * - error,
- * - ok with NULL result,
+ * - error,
+ * - ok with NULL result,
* - ok with copy of string as result,
* - use the default rewrite context.
*/
struct berval *value
);
-/*
+/*
* Destroys the parameter tree
*/
LDAP_REWRITE_F (int)
#define FILT_MAX_LINE_LEN 1024
-LDAPFiltDesc *
-ldap_init_getfilter( LDAP_CONST char *fname )
-{
- FILE *fp;
- char *buf;
- long rlen, len;
- int eof;
- LDAPFiltDesc *lfdp;
-
- if (( fp = fopen( fname, "r" )) == NULL ) {
- return( NULL );
- }
-
- if ( fseek( fp, 0L, SEEK_END ) != 0 ) { /* move to end to get len */
- fclose( fp );
- return( NULL );
- }
-
- len = ftell( fp );
-
- if ( fseek( fp, 0L, SEEK_SET ) != 0 ) { /* back to start of file */
- fclose( fp );
- return( NULL );
- }
-
- if (( buf = LDAP_MALLOC( (size_t)len )) == NULL ) {
- fclose( fp );
- return( NULL );
- }
-
- rlen = fread( buf, 1, (size_t)len, fp );
- eof = feof( fp );
- fclose( fp );
-
- if ( rlen != len && !eof ) { /* error: didn't get the whole file */
- LDAP_FREE( buf );
- return( NULL );
- }
-
-
- lfdp = ldap_init_getfilter_buf( buf, rlen );
- LDAP_FREE( buf );
-
- return( lfdp );
-}
-
-
-LDAPFiltDesc *
+static LDAPFiltDesc *
ldap_init_getfilter_buf( char *buf, ber_len_t buflen )
{
LDAPFiltDesc *lfdp;
return( lfdp );
}
-
-void
-ldap_setfilteraffixes( LDAPFiltDesc *lfdp, LDAP_CONST char *prefix, LDAP_CONST char *suffix )
+LDAPFiltDesc *
+ldap_init_getfilter( LDAP_CONST char *fname )
{
- if ( lfdp->lfd_filtprefix != NULL ) {
- LDAP_FREE( lfdp->lfd_filtprefix );
+ FILE *fp;
+ char *buf;
+ long rlen, len;
+ int eof;
+ LDAPFiltDesc *lfdp;
+
+ if (( fp = fopen( fname, "r" )) == NULL ) {
+ return( NULL );
}
- lfdp->lfd_filtprefix = ( prefix == NULL ) ? NULL : LDAP_STRDUP( prefix );
- if ( lfdp->lfd_filtsuffix != NULL ) {
- LDAP_FREE( lfdp->lfd_filtsuffix );
+ if ( fseek( fp, 0L, SEEK_END ) != 0 ) { /* move to end to get len */
+ fclose( fp );
+ return( NULL );
+ }
+
+ len = ftell( fp );
+
+ if ( fseek( fp, 0L, SEEK_SET ) != 0 ) { /* back to start of file */
+ fclose( fp );
+ return( NULL );
+ }
+
+ if (( buf = LDAP_MALLOC( (size_t)len )) == NULL ) {
+ fclose( fp );
+ return( NULL );
}
- lfdp->lfd_filtsuffix = ( suffix == NULL ) ? NULL : LDAP_STRDUP( suffix );
-}
+ rlen = fread( buf, 1, (size_t)len, fp );
+ eof = feof( fp );
+ fclose( fp );
+
+ if ( rlen != len && !eof ) { /* error: didn't get the whole file */
+ LDAP_FREE( buf );
+ return( NULL );
+ }
+
+
+ lfdp = ldap_init_getfilter_buf( buf, rlen );
+ LDAP_FREE( buf );
+
+ return( lfdp );
+}
LDAPFiltInfo *
ldap_getfirstfilter(
return( ldap_getnextfilter( lfdp ));
}
+static void
+ldap_build_filter(
+ char *filtbuf,
+ ber_len_t buflen,
+ LDAP_CONST char *pattern,
+ LDAP_CONST char *prefix,
+ LDAP_CONST char *suffix,
+ LDAP_CONST char *attr,
+ LDAP_CONST char *value,
+ char **valwords );
LDAPFiltInfo *
ldap_getnextfilter( LDAPFiltDesc *lfdp )
return( &lfdp->lfd_retfi );
}
-
-void
+static void
ldap_build_filter(
char *filtbuf,
ber_len_t buflen,
}
}
-
static int
break_into_words( /* LDAP_CONST */ char *str, LDAP_CONST char *delims, char ***wordsp )
{