]> git.sur5r.net Git - openldap/blob - include/ldap_pvt.h
Delete obsolete symbols acl_access_allowed and acl_get_applicable
[openldap] / include / ldap_pvt.h
1 /* $OpenLDAP$ */
2 /*
3  * Copyright 1998,1999 The OpenLDAP Foundation, Redwood City, California, USA
4  * All rights reserved.
5  *
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.
10  */
11 /*
12  * ldap-pvt.h - Header for ldap_pvt_ functions. These are meant to be used
13  *              by the OpenLDAP distribution only.
14  */
15
16 #ifndef _LDAP_PVT_H
17 #define _LDAP_PVT_H 1
18
19 #include <ldap_cdefs.h>
20 #include <lber.h>                               /* get ber_slen_t */
21
22 LDAP_BEGIN_DECL
23
24 struct hostent; /* avoid pulling in <netdb.h> */
25
26 #ifdef __MINGW32__
27 #   undef LDAP_F_PRE
28 #   ifdef LIBLDAP_DECL
29 #       define LDAP_F_PRE       extern __declspec(LIBLDAP_DECL)
30 #   else
31 #       define LDAP_F_PRE       extern
32 #   endif
33 #endif
34
35 LDAP_F( char * )
36 ldap_pvt_ctime LDAP_P((
37         const time_t *tp,
38         char *buf ));
39
40 LDAP_F( int )
41 ldap_pvt_gethostbyname_a LDAP_P((
42         const char *name, 
43         struct hostent *resbuf,
44         char **buf,
45         struct hostent **result,
46         int *herrno_ptr ));
47
48 LDAP_F( int )
49 ldap_pvt_gethostbyaddr_a LDAP_P((
50         const char *addr,
51         int len,
52         int type,
53         struct hostent *resbuf,
54         char **buf,
55         struct hostent **result,
56         int *herrno_ptr ));
57
58
59 /* charray.c */
60
61 LDAP_F( int )
62 ldap_charray_add LDAP_P((
63     char        ***a,
64     char        *s ));
65
66 LDAP_F( int )
67 ldap_charray_merge LDAP_P((
68     char        ***a,
69     char        **s ));
70
71 LDAP_F( void )
72 ldap_charray_free LDAP_P(( char **a ));
73
74 LDAP_F( int )
75 ldap_charray_inlist LDAP_P((
76     char        **a,
77     char        *s ));
78
79 LDAP_F( char ** )
80 ldap_charray_dup LDAP_P(( char **a ));
81
82 LDAP_F( char ** )
83 ldap_str2charray LDAP_P((
84         char *str,
85         char *brkstr ));
86
87 /* url.c */
88 void ldap_pvt_hex_unescape LDAP_P(( char *s ));
89 int ldap_pvt_unhex( int c );
90
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')
95
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) )
101
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) == '.' )
106
107 #define LDAP_LEADATTRCHAR(c)    ( LDAP_LEADKEYCHAR(c) || LDAP_LEADOIDCHAR(c) )
108 #define LDAP_ATTRCHAR(c)                ( LDAP_KEYCHAR((c)) || (c) == '.' )
109
110 #define LDAP_NEEDSESCAPE(c)     ((c) == '\\' || (c) == '"')
111
112 /* search.c */
113 LDAP_F( char * )
114 ldap_pvt_find_wildcard LDAP_P(( char *s ));
115
116 LDAP_F( ber_slen_t )
117 ldap_pvt_filter_value_unescape LDAP_P(( char *filter ));
118
119 /* string.c */
120 LDAP_F( char * )
121 ldap_pvt_str2upper LDAP_P(( char *str ));
122
123 LDAP_F( char * )
124 ldap_pvt_str2lower LDAP_P(( char *str ));
125
126 LDAP_END_DECL
127
128 #endif
129