3 * Copyright 1998,1999 The OpenLDAP Foundation, Redwood City, California, USA
6 * Redistribution and use in source and binary forms are permitted only
7 * as authorized by the OpenLDAP Public License. A copy of this
8 * license is available at http://www.OpenLDAP.org/license.html or
9 * in file LICENSE in the top-level directory of the distribution.
12 * ldap-pvt.h - Header for ldap_pvt_ functions. These are meant to be used
13 * by the OpenLDAP distribution only.
19 #include <ldap_cdefs.h>
20 #include <lber.h> /* get ber_slen_t */
24 struct hostent; /* avoid pulling in <netdb.h> */
29 # define LDAP_F_PRE extern __declspec(LIBLDAP_DECL)
31 # define LDAP_F_PRE extern
36 ldap_pvt_ctime LDAP_P((
41 ldap_pvt_gethostbyname_a LDAP_P((
43 struct hostent *resbuf,
45 struct hostent **result,
49 ldap_pvt_gethostbyaddr_a LDAP_P((
53 struct hostent *resbuf,
55 struct hostent **result,
62 ldap_charray_add LDAP_P((
67 ldap_charray_merge LDAP_P((
72 ldap_charray_free LDAP_P(( char **a ));
75 ldap_charray_inlist LDAP_P((
80 ldap_charray_dup LDAP_P(( char **a ));
83 ldap_str2charray LDAP_P((
88 void ldap_pvt_hex_unescape LDAP_P(( char *s ));
89 int ldap_pvt_unhex( int c );
91 /* these macros assume 'x' is an ASCII x */
92 #define LDAP_DNSEPARATOR(c) ((c) == ',' || (c) == ';')
93 #define LDAP_SEPARATOR(c) ((c) == ',' || (c) == ';' || (c) == '+')
94 #define LDAP_SPACE(c) ((c) == ' ' || (c) == '\n')
96 #define LDAP_LOWER(c) ( (c) >= 'a' && (c) <= 'z' )
97 #define LDAP_UPPER(c) ( (c) >= 'A' && (c) <= 'Z' )
98 #define LDAP_ALPHA(c) ( LDAP_LOWER(c) || LDAP_UPPER(c) )
99 #define LDAP_DIGIT(c) ( (c) >= '0' && (c) <= '9' )
100 #define LDAP_ALNUM(c) ( LDAP_ALPHA(c) || LDAP_DIGIT(c) )
102 #define LDAP_LEADKEYCHAR(c) ( LDAP_ALPHA(c) )
103 #define LDAP_KEYCHAR(c) ( LDAP_ALNUM(c) || (c) == '-' )
104 #define LDAP_LEADOIDCHAR(c) ( LDAP_DIGIT(c) )
105 #define LDAP_OIDCHAR(c) ( LDAP_DIGIT(c) || (c) == '.' )
107 #define LDAP_LEADATTRCHAR(c) ( LDAP_LEADKEYCHAR(c) || LDAP_LEADOIDCHAR(c) )
108 #define LDAP_ATTRCHAR(c) ( LDAP_KEYCHAR((c)) || (c) == '.' )
110 #define LDAP_NEEDSESCAPE(c) ((c) == '\\' || (c) == '"')
114 ldap_pvt_find_wildcard LDAP_P(( char *s ));
117 ldap_pvt_filter_value_unescape LDAP_P(( char *filter ));
121 ldap_pvt_str2upper LDAP_P(( char *str ));
124 ldap_pvt_str2lower LDAP_P(( char *str ));