3 * Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved.
4 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
7 * Copyright (c) 1990 Regents of the University of Michigan.
10 * Redistribution and use in source and binary forms are permitted
11 * provided that this notice is preserved and that due credit is given
12 * to the University of Michigan at Ann Arbor. The name of the University
13 * may not be used to endorse or promote products derived from this
14 * software without specific prior written permission. This software
15 * is provided ``as is'' without express or implied warranty.
27 LBER_F (BER_ERRNO_FN) ber_int_errno_fn;
31 unsigned short lbo_options;
36 #define LBER_UNINITIALIZED 0x0
37 #define LBER_INITIALIZED 0x1
38 #define LBER_VALID_BERELEMENT 0x2
39 #define LBER_VALID_SOCKBUF 0x3
41 LBER_F (struct lber_options) ber_int_options;
42 #define ber_int_debug ber_int_options.lbo_debug
45 struct lber_options ber_opts;
46 #define ber_valid ber_opts.lbo_valid
47 #define ber_options ber_opts.lbo_options
48 #define ber_debug ber_opts.lbo_debug
50 ber_tag_t ber_usertag;
59 struct seqorset *ber_sos;
62 #define BER_VALID(ber) ((ber)->ber_valid==LBER_VALID_BERELEMENT)
64 #define ber_pvt_ber_bytes(ber) ((ber)->ber_ptr - (ber)->ber_buf)
65 #define ber_pvt_ber_remaining(ber) ((ber)->ber_end - (ber)->ber_ptr)
68 struct lber_options sb_opts;
69 Sockbuf_IO_Desc *sb_iod; /* I/O functions */
70 #define sb_valid sb_opts.lbo_valid
71 #define sb_options sb_opts.lbo_options
72 #define sb_debug sb_opts.lbo_debug
74 int sb_trans_needs_read:1;
75 int sb_trans_needs_write:1;
78 #define SOCKBUF_VALID( sb ) ( (sb)->sb_valid == LBER_VALID_SOCKBUF )
80 #define READBUFSIZ 8192
88 struct seqorset *sos_next;
95 int ber_realloc LDAP_P((
102 #define ber_log_printf ber_pvt_log_printf
105 ber_log_bprint LDAP_P((
112 ber_log_dump LDAP_P((
119 ber_log_sos_dump LDAP_P((
126 /* simple macros to realloc for now */
127 LBER_F (BerMemoryFunctions *) ber_int_memory_fns;
130 #define LBER_INT_MALLOC malloc
131 #define LBER_INT_CALLOC calloc
132 #define LBER_INT_REALLOC realloc
133 #define LBER_INT_FREE free
134 #define LBER_INT_VFREE ber_memvfree
135 #define LBER_INT_STRDUP strdup
137 #define LBER_MALLOC malloc
138 #define LBER_CALLOC calloc
139 #define LBER_REALLOC realloc
140 #define LBER_FREE free
141 #define LBER_VFREE ber_memvfree
142 #define LBER_STRDUP strdup
145 #define LBER_INT_MALLOC(s) ber_memalloc((s))
146 #define LBER_INT_CALLOC(n,s) ber_memcalloc((n),(s))
147 #define LBER_INT_REALLOC(p,s) ber_memrealloc((p),(s))
148 #define LBER_INT_FREE(p) ber_memfree((p))
149 #define LBER_INT_VFREE(v) ber_memvfree((void**)(v))
150 #define LBER_INT_STRDUP(s) ber_strdup((s))
152 #define LBER_MALLOC(s) ber_memalloc((s))
153 #define LBER_CALLOC(n,s) ber_memcalloc((n),(s))
154 #define LBER_REALLOC(p,s) ber_memrealloc((p),(s))
155 #define LBER_FREE(p) ber_memfree((p))
156 #define LBER_VFREE(v) ber_memvfree((void**)(v))
157 #define LBER_STRDUP(s) ber_strdup((s))
163 ber_int_sb_init LDAP_P(( Sockbuf *sb ));
166 ber_int_sb_close LDAP_P(( Sockbuf *sb ));
169 ber_int_sb_destroy LDAP_P(( Sockbuf *sb ));
172 ber_int_sb_read LDAP_P(( Sockbuf *sb, void *buf, ber_len_t len ));
175 ber_int_sb_write LDAP_P(( Sockbuf *sb, void *buf, ber_len_t len ));
179 #endif /* _LBER_INT_H */