Commit 9ef1a740 authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

Round one of LDAP_F() macro changes. In this round we rename

macros into our namespace and limit use to headers.  A subsequent
round will add macros to separately handle forward declarations
of variables from declaration of function prototypes.  The last
round will add additional macros for declaring actual variables and
functions.
parent a8144d55
......@@ -8,7 +8,7 @@ OBJS = ldapsearch.o ldapmodify.o ldapdelete.o ldapmodrdn.o ldappasswd.o
LDAP_INCDIR= ../../include
LDAP_LIBDIR= ../../libraries
NT_DYN_DEFS = -DLIBLBER_DECL=dllimport -DLIBLDAP_DECL=dllimport
NT_DYN_DEFS = -DLBER_DECL=dllimport -DLDAP_DECL=dllimport
CPPFLAGS = $(@PLAT@_@LIB_LINKAGE@_DEFS)
XLIBS = -llutil -lldif -lldap -llber
......
......@@ -11,7 +11,7 @@ PROGRAMS= ud
LDAP_INCDIR= ../../include
LDAP_LIBDIR= ../../libraries
NT_DYN_DEFS = -DLIBLBER_DECL=dllimport -DLIBLDAP_DECL=dllimport
NT_DYN_DEFS = -DLBER_DECL=dllimport -DLDAP_DECL=dllimport
CPPFLAGS = $(@PLAT@_@LIB_LINKAGE@_DEFS)
XLIBS = -llutil -lldif -lldap -llber
......
......@@ -25,8 +25,8 @@
# define sys_errlist ((char **)0)
#elif DECL_SYS_ERRLIST
/* have sys_errlist but need declaration */
LIBC_F (int) sys_nerr;
LIBC_F (char) *sys_errlist[];
LDAP_LIBC_F (int) sys_nerr;
LDAP_LIBC_F (char) *sys_errlist[];
#endif
#ifdef HAVE_STRERROR
......
......@@ -19,10 +19,10 @@
# include <libutil.h>
#else
/* use lutil version */
LIBLUTIL_F (void) (setproctitle) LDAP_P((const char *fmt, ...)) \
LDAP_LUTIL_F (void) (setproctitle) LDAP_P((const char *fmt, ...)) \
LDAP_GCCATTR((format(printf, 1, 2)));
LIBLUTIL_F (int) Argc;
LIBLUTIL_F (char) **Argv;
LDAP_LUTIL_F (int) Argc;
LDAP_LUTIL_F (char) **Argv;
#endif
#endif /* LDAP_PROCTITLE */
......
......@@ -148,7 +148,7 @@ LIBLBER_F (char *) ber_pvt_wsa_err2string LDAP_P((int));
#if !defined( HAVE_INET_ATON ) && !defined( inet_aton )
#define inet_aton ldap_pvt_inet_aton
struct in_addr;
LIBLDAP_F (int) ldap_pvt_inet_aton LDAP_P(( const char *, struct in_addr * ));
LDAP_F (int) ldap_pvt_inet_aton LDAP_P(( const char *, struct in_addr * ));
#endif
#if defined(__WIN32) && defined(_ALPHA)
......
......@@ -43,7 +43,7 @@
#endif
/* use ldap_pvt_strtok instead of strtok or strtok_r! */
LIBLDAP_F(char *) ldap_pvt_strtok LDAP_P(( char *str, const char *delim,
LDAP_F(char *) ldap_pvt_strtok LDAP_P(( char *str, const char *delim,
char **pos ));
#ifndef HAVE_STRDUP
......@@ -52,7 +52,7 @@ LIBLDAP_F(char *) ldap_pvt_strtok LDAP_P(( char *str, const char *delim,
# define strdup(s) ber_strdup(s)
#else
/* some systems fail to declare strdup */
LIBC_F(char *) (strdup)();
LDAP_LIBC_F(char *) (strdup)();
#endif
/*
......
......@@ -28,11 +28,11 @@
/* note: callers of crypt(3) should include <ac/crypt.h> */
#if defined(HAVE_GETPASSPHRASE)
LIBC_F(char*)(getpassphrase)();
LDAP_LIBC_F(char*)(getpassphrase)();
#elif defined(HAVE_GETPASS)
#define getpassphrase(p) getpass(p)
LIBC_F(char*)(getpass)();
LDAP_LIBC_F(char*)(getpass)();
#else
#define NEED_GETPASSPHRASE 1
......@@ -50,13 +50,14 @@ LIBLUTIL_F(char*)(lutil_getpass) LDAP_P((const char *getpass));
#else
/* assume we need to declare these externs */
LIBC_F (char *) optarg;
LIBC_F (int) optind, opterr, optopt;
LDAP_LIBC_F (char *) optarg;
LDAP_LIBC_F (int) optind, opterr, optopt;
#endif
#ifndef HAVE_TEMPNAM
LIBLUTIL_F(char *)(tempnam) LDAP_P(( const char *tmpdir,
const char *prefix));
LDAP_LUTIL_F(char *)(tempnam) LDAP_P((
const char *tmpdir,
const char *prefix));
#endif
/* use lutil file locking */
......
......@@ -61,39 +61,39 @@ typedef int (*AVL_CMP) LDAP_P((const void*, const void*));
typedef int (*AVL_DUP) LDAP_P((void*, void*));
typedef void (*AVL_FREE) LDAP_P((void*));
LIBAVL_F( int )
LDAP_AVL_F( int )
avl_free LDAP_P(( Avlnode *root, AVL_FREE dfree ));
LIBAVL_F( int )
LDAP_AVL_F( int )
avl_insert LDAP_P((Avlnode **, void*, AVL_CMP, AVL_DUP));
LIBAVL_F( void* )
LDAP_AVL_F( void* )
avl_delete LDAP_P((Avlnode **, void*, AVL_CMP));
LIBAVL_F( void* )
LDAP_AVL_F( void* )
avl_find LDAP_P((Avlnode *, const void*, AVL_CMP));
LIBAVL_F( void* )
LDAP_AVL_F( void* )
avl_find_lin LDAP_P((Avlnode *, const void*, AVL_CMP));
#ifdef AVL_NONREENTRANT
LIBAVL_F( void* )
LDAP_AVL_F( void* )
avl_getfirst LDAP_P((Avlnode *));
LIBAVL_F( void* )
LDAP_AVL_F( void* )
avl_getnext LDAP_P((void));
#endif
LIBAVL_F( int )
LDAP_AVL_F( int )
avl_dup_error LDAP_P((void*, void*));
LIBAVL_F( int )
LDAP_AVL_F( int )
avl_dup_ok LDAP_P((void*, void*));
LIBAVL_F( int )
LDAP_AVL_F( int )
avl_apply LDAP_P((Avlnode *, AVL_APPLY, void*, int, int));
LIBAVL_F( int )
LDAP_AVL_F( int )
avl_prefixapply LDAP_P((Avlnode *, void*, AVL_CMP, void*, AVL_CMP, void*, int));
/* apply traversal types */
......
......@@ -225,88 +225,88 @@ struct ldap_disptmpl {
typedef int (*ldap_writeptype) LDAP_P((
void *writeparm, char *p, ber_len_t len ));
LIBLDAP_F( int )
LDAP_F( int )
ldap_init_templates LDAP_P(( char *file, struct ldap_disptmpl **tmpllistp ));
LIBLDAP_F( int )
LDAP_F( int )
ldap_init_templates_buf LDAP_P(( char *buf,
ber_len_t buflen,
struct ldap_disptmpl **tmpllistp ));
LIBLDAP_F( void )
LDAP_F( void )
ldap_free_templates LDAP_P(( struct ldap_disptmpl *tmpllist ));
LIBLDAP_F( struct ldap_disptmpl * )
LDAP_F( struct ldap_disptmpl * )
ldap_first_disptmpl LDAP_P(( struct ldap_disptmpl *tmpllist ));
LIBLDAP_F( struct ldap_disptmpl * )
LDAP_F( struct ldap_disptmpl * )
ldap_next_disptmpl LDAP_P(( struct ldap_disptmpl *tmpllist,
struct ldap_disptmpl *tmpl ));
LIBLDAP_F( struct ldap_disptmpl * )
LDAP_F( struct ldap_disptmpl * )
ldap_name2template LDAP_P(( char *name,
struct ldap_disptmpl *tmpllist ));
LIBLDAP_F( struct ldap_disptmpl * )
LDAP_F( struct ldap_disptmpl * )
ldap_oc2template LDAP_P(( char **oclist,
struct ldap_disptmpl *tmpllist ));
LIBLDAP_F( char ** )
LDAP_F( char ** )
ldap_tmplattrs LDAP_P(( struct ldap_disptmpl *tmpl,
char **includeattrs,
int exclude,
unsigned long syntaxmask ));
LIBLDAP_F( struct ldap_tmplitem * )
LDAP_F( struct ldap_tmplitem * )
ldap_first_tmplrow LDAP_P(( struct ldap_disptmpl *tmpl ));
LIBLDAP_F( struct ldap_tmplitem * )
LDAP_F( struct ldap_tmplitem * )
ldap_next_tmplrow LDAP_P(( struct ldap_disptmpl *tmpl,
struct ldap_tmplitem *row ));
LIBLDAP_F( struct ldap_tmplitem * )
LDAP_F( struct ldap_tmplitem * )
ldap_first_tmplcol LDAP_P(( struct ldap_disptmpl *tmpl,
struct ldap_tmplitem *row ));
LIBLDAP_F( struct ldap_tmplitem * )
LDAP_F( struct ldap_tmplitem * )
ldap_next_tmplcol LDAP_P(( struct ldap_disptmpl *tmpl,
struct ldap_tmplitem *row,
struct ldap_tmplitem *col ));
LIBLDAP_F( int )
LDAP_F( int )
ldap_entry2text LDAP_P(( LDAP *ld,
char *buf, LDAPMessage *entry,
struct ldap_disptmpl *tmpl, char **defattrs, char ***defvals,
ldap_writeptype writeproc, void *writeparm, char *eol, int rdncount,
unsigned long opts ));
LIBLDAP_F( int )
LDAP_F( int )
ldap_vals2text LDAP_P(( LDAP *ld,
char *buf, char **vals, char *label, int labelwidth,
unsigned long syntaxid, ldap_writeptype writeproc, void *writeparm,
char *eol, int rdncount ));
LIBLDAP_F( int )
LDAP_F( int )
ldap_entry2text_search LDAP_P(( LDAP *ld,
char *dn, char *base, LDAPMessage *entry,
struct ldap_disptmpl *tmpllist, char **defattrs, char ***defvals,
ldap_writeptype writeproc, void *writeparm, char *eol, int rdncount,
unsigned long opts ));
LIBLDAP_F( int )
LDAP_F( int )
ldap_entry2html LDAP_P(( LDAP *ld,
char *buf, LDAPMessage *entry,
struct ldap_disptmpl *tmpl, char **defattrs, char ***defvals,
ldap_writeptype writeproc, void *writeparm, char *eol, int rdncount,
unsigned long opts, char *urlprefix, char *base ));
LIBLDAP_F( int )
LDAP_F( int )
ldap_vals2html LDAP_P(( LDAP *ld,
char *buf, char **vals, char *label, int labelwidth,
unsigned long syntaxid, ldap_writeptype writeproc, void *writeparm,
char *eol, int rdncount, char *urlprefix ));
LIBLDAP_F( int )
LDAP_F( int )
ldap_entry2html_search LDAP_P(( LDAP
*ld, char *dn, char *base, LDAPMessage *entry,
struct ldap_disptmpl *tmpllist, char **defattrs, char ***defvals,
......
......@@ -25,10 +25,9 @@ LDAP_BEGIN_DECL
#define optopt lutil_optopt
#define getopt lutil_getopt
LIBLUTIL_F (char *) optarg;
LIBLUTIL_F (int) optind, opterr, optopt;
LIBLUTIL_F (int) getopt LDAP_P(( int, char * const [], const char *));
LDAP_LUTIL_F (char *) optarg;
LDAP_LUTIL_F (int) optind, opterr, optopt;
LDAP_LUTIL_F (int) getopt LDAP_P(( int, char * const [], const char *));
LDAP_END_DECL
......
......@@ -202,19 +202,19 @@ typedef struct berval {
/*
* in bprint.c:
*/
LIBLBER_F( void )
LBER_F( void )
ber_error_print LDAP_P((
LDAP_CONST char *data ));
LIBLBER_F( void )
LBER_F( void )
ber_bprint LDAP_P((
LDAP_CONST char *data, ber_len_t len ));
LIBLBER_F( void )
LBER_F( void )
ber_dump LDAP_P((
BerElement *ber, int inout ));
LIBLBER_F( void )
LBER_F( void )
ber_sos_dump LDAP_P((
Seqorset *sos ));
......@@ -227,74 +227,74 @@ typedef int (*BERDecodeCallback) LDAP_P((
void *data,
int mode ));
LIBLBER_F( ber_tag_t )
LBER_F( ber_tag_t )
ber_get_tag LDAP_P((
BerElement *ber ));
LIBLBER_F( ber_tag_t )
LBER_F( ber_tag_t )
ber_skip_tag LDAP_P((
BerElement *ber,
ber_len_t *len ));
LIBLBER_F( ber_tag_t )
LBER_F( ber_tag_t )
ber_peek_tag LDAP_P((
BerElement *ber,
ber_len_t *len ));
LIBLBER_F( ber_tag_t )
LBER_F( ber_tag_t )
ber_get_int LDAP_P((
BerElement *ber,
ber_int_t *num ));
LIBLBER_F( ber_tag_t )
LBER_F( ber_tag_t )
ber_get_enum LDAP_P((
BerElement *ber,
ber_int_t *num ));
LIBLBER_F( ber_tag_t )
LBER_F( ber_tag_t )
ber_get_stringb LDAP_P((
BerElement *ber,
char *buf,
ber_len_t *len ));
LIBLBER_F( ber_tag_t )
LBER_F( ber_tag_t )
ber_get_stringa LDAP_P((
BerElement *ber,
char **buf ));
LIBLBER_F( ber_tag_t )
LBER_F( ber_tag_t )
ber_get_stringal LDAP_P((
BerElement *ber,
struct berval **bv ));
LIBLBER_F( ber_tag_t )
LBER_F( ber_tag_t )
ber_get_bitstringa LDAP_P((
BerElement *ber,
char **buf,
ber_len_t *len ));
LIBLBER_F( ber_tag_t )
LBER_F( ber_tag_t )
ber_get_null LDAP_P((
BerElement *ber ));
LIBLBER_F( ber_tag_t )
LBER_F( ber_tag_t )
ber_get_boolean LDAP_P((
BerElement *ber,
ber_int_t *boolval ));
LIBLBER_F( ber_tag_t )
LBER_F( ber_tag_t )
ber_first_element LDAP_P((
BerElement *ber,
ber_len_t *len,
char **last ));
LIBLBER_F( ber_tag_t )
LBER_F( ber_tag_t )
ber_next_element LDAP_P((
BerElement *ber,
ber_len_t *len,
LDAP_CONST char *last ));
LIBLBER_F( ber_tag_t )
LBER_F( ber_tag_t )
ber_scanf LDAP_P((
BerElement *ber,
LDAP_CONST char *fmt,
......@@ -307,74 +307,74 @@ typedef int (*BEREncodeCallback) LDAP_P((
BerElement *ber,
void *data ));
LIBLBER_F( int )
LBER_F( int )
ber_put_enum LDAP_P((
BerElement *ber,
ber_int_t num,
ber_tag_t tag ));
LIBLBER_F( int )
LBER_F( int )
ber_put_int LDAP_P((
BerElement *ber,
ber_int_t num,
ber_tag_t tag ));
LIBLBER_F( int )
LBER_F( int )
ber_put_ostring LDAP_P((
BerElement *ber,
LDAP_CONST char *str,
ber_len_t len,
ber_tag_t tag ));
LIBLBER_F( int )
LBER_F( int )
ber_put_berval LDAP_P((
BerElement *ber,
LDAP_CONST struct berval *bv,
ber_tag_t tag ));
LIBLBER_F( int )
LBER_F( int )
ber_put_string LDAP_P((
BerElement *ber,
LDAP_CONST char *str,
ber_tag_t tag ));
LIBLBER_F( int )
LBER_F( int )
ber_put_bitstring LDAP_P((
BerElement *ber,
LDAP_CONST char *str,
ber_len_t bitlen,
ber_tag_t tag ));
LIBLBER_F( int )
LBER_F( int )
ber_put_null LDAP_P((
BerElement *ber,
ber_tag_t tag ));
LIBLBER_F( int )
LBER_F( int )
ber_put_boolean LDAP_P((
BerElement *ber,
ber_int_t boolval,
ber_tag_t tag ));
LIBLBER_F( int )
LBER_F( int )
ber_start_seq LDAP_P((
BerElement *ber,
ber_tag_t tag ));
LIBLBER_F( int )
LBER_F( int )
ber_start_set LDAP_P((
BerElement *ber,
ber_tag_t tag ));
LIBLBER_F( int )
LBER_F( int )
ber_put_seq LDAP_P((
BerElement *ber ));
LIBLBER_F( int )
LBER_F( int )
ber_put_set LDAP_P((
BerElement *ber ));
LIBLBER_F( int )
LBER_F( int )
ber_printf LDAP_P((
BerElement *ber,
LDAP_CONST char *fmt,
......@@ -385,65 +385,65 @@ ber_printf LDAP_P((
* in io.c:
*/
LIBLBER_F( ber_slen_t )
LBER_F( ber_slen_t )
ber_read LDAP_P((
BerElement *ber,
char *buf,
ber_len_t len ));
LIBLBER_F( ber_slen_t )
LBER_F( ber_slen_t )
ber_write LDAP_P((
BerElement *ber,
LDAP_CONST char *buf,
ber_len_t len,
int nosos ));
LIBLBER_F( void )
LBER_F( void )
ber_free LDAP_P((
BerElement *ber,
int freebuf ));
LIBLBER_F( int )
LBER_F( int )
ber_flush LDAP_P((
Sockbuf *sb,
BerElement *ber,
int freeit ));
LIBLBER_F( BerElement * )
LBER_F( BerElement * )
ber_alloc LDAP_P(( void )); /* DEPRECATED */
LIBLBER_F( BerElement * )
LBER_F( BerElement * )
der_alloc LDAP_P(( void )); /* DEPRECATED */
LIBLBER_F( BerElement * )
LBER_F( BerElement * )
ber_alloc_t LDAP_P((
int beroptions ));
LIBLBER_F( BerElement * )
LBER_F( BerElement * )
ber_dup LDAP_P((
BerElement *ber ));
LIBLBER_F( ber_tag_t )
LBER_F( ber_tag_t )
ber_get_next LDAP_P((
Sockbuf *sb,
ber_len_t *len,
BerElement *ber ));
LIBLBER_F( void )
LBER_F( void )
ber_init_w_nullc LDAP_P((
BerElement *ber,
int options ));
LIBLBER_F( void )
LBER_F( void )
ber_reset LDAP_P((
BerElement *ber,
int was_writing ));
LIBLBER_F( BerElement * )
LBER_F( BerElement * )
ber_init LDAP_P((
struct berval *bv ));
LIBLBER_F( int )
LBER_F( int )
ber_flatten LDAP_P((
BerElement *ber,
struct berval **bvPtr ));
......@@ -452,13 +452,13 @@ ber_flatten LDAP_P((
* LBER ber accessor functions
*/
LIBLBER_F( int )
LBER_F( int )
ber_get_option LDAP_P((
void *item,
int option,
void *outvalue));
LIBLBER_F( int )
LBER_F( int )
ber_set_option LDAP_P((
void *item,
int option,
......@@ -468,97 +468,97 @@ ber_set_option LDAP_P((
* LBER sockbuf.c
*/
LIBLBER_F( Sockbuf * )
LBER_F( Sockbuf * )
ber_sockbuf_alloc LDAP_P((
void ));
LIBLBER_F( void )
LBER_F( void )
ber_sockbuf_free LDAP_P((
Sockbuf *sb ));
LIBLBER_F( int )
LBER_F( int )
ber_sockbuf_add_io LDAP_P((
Sockbuf *sb,
Sockbuf_IO *sbio,
int layer,
void *arg ));
LIBLBER_F( int )
LBER_F( int )
ber_sockbuf_remove_io LDAP_P((
Sockbuf *sb,
Sockbuf_IO *sbio,
int layer ));
LIBLBER_F( int )
LBER_F( int )
ber_sockbuf_ctrl LDAP_P((
Sockbuf *sb,
int opt,
void *arg ));
LIBLBER_F( Sockbuf_IO ) ber_sockbuf_io_tcp;
LIBLBER_F( Sockbuf_IO ) ber_sockbuf_io_udp;
LIBLBER_F( Sockbuf_IO ) ber_sockbuf_io_readahead;
LIBLBER_F( Sockbuf_IO ) ber_sockbuf_io_fd;
LIBLBER_F( Sockbuf_IO ) ber_sockbuf_io_debug;
LBER_F( Sockbuf_IO ) ber_sockbuf_io_tcp;
LBER_F( Sockbuf_IO ) ber_sockbuf_io_udp;
LBER_F( Sockbuf_IO ) ber_sockbuf_io_readahead;
LBER_F( Sockbuf_IO ) ber_sockbuf_io_fd;
LBER_F( Sockbuf_IO ) ber_sockbuf_io_debug;
/*
* LBER memory.c
*/
LIBLBER_F( void * )
LBER_F( void * )
ber_memalloc LDAP_P((
ber_len_t s ));