From 883196d34858126dedd6438328aa0b14c8fe6eb2 Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Mon, 24 Dec 2001 06:36:44 +0000 Subject: [PATCH] Clean up some symbol scoping --- libraries/libldap/ldap-int.h | 2 +- libraries/libldap/os-ip.c | 4 +-- libraries/libldap/result.c | 4 +-- libraries/liblunicode/ure/urestubs.c | 2 +- libraries/liblutil/ptest.c | 4 +-- servers/slapd/back-bdb/extended.c | 2 +- servers/slapd/back-bdb/index.c | 2 +- servers/slapd/backglue.c | 46 +++++++++++++--------------- servers/slapd/filter.c | 2 +- servers/slapd/phonetic.c | 6 ++-- servers/slapd/proto-slap.h | 5 ++- servers/slapd/schema_prep.c | 9 +++--- 12 files changed, 41 insertions(+), 47 deletions(-) diff --git a/libraries/libldap/ldap-int.h b/libraries/libldap/ldap-int.h index e4b4983177..fc70d9daa8 100644 --- a/libraries/libldap/ldap-int.h +++ b/libraries/libldap/ldap-int.h @@ -437,7 +437,7 @@ LDAP_F (char *) ldap_host_connected_to( Sockbuf *sb ); #endif LDAP_F (void) ldap_int_ip_init( void ); -LDAP_F (int) do_ldap_select( LDAP *ld, struct timeval *timeout ); +LDAP_F (int) ldap_int_select( LDAP *ld, struct timeval *timeout ); LDAP_F (void *) ldap_new_select_info( void ); LDAP_F (void) ldap_free_select_info( void *sip ); LDAP_F (void) ldap_mark_select_write( LDAP *ld, Sockbuf *sb ); diff --git a/libraries/libldap/os-ip.c b/libraries/libldap/os-ip.c index 02006651cb..23935ad2af 100644 --- a/libraries/libldap/os-ip.c +++ b/libraries/libldap/os-ip.c @@ -661,11 +661,11 @@ ldap_int_ip_init( void ) int -do_ldap_select( LDAP *ld, struct timeval *timeout ) +ldap_int_select( LDAP *ld, struct timeval *timeout ) { struct selectinfo *sip; - Debug( LDAP_DEBUG_TRACE, "do_ldap_select\n", 0, 0, 0 ); + Debug( LDAP_DEBUG_TRACE, "ldap_int_select\n", 0, 0, 0 ); if ( ldap_int_tblsize == 0 ) ldap_int_ip_init(); diff --git a/libraries/libldap/result.c b/libraries/libldap/result.c index 6dffb0b192..0e6f4bf80f 100644 --- a/libraries/libldap/result.c +++ b/libraries/libldap/result.c @@ -272,13 +272,13 @@ wait4msg( } if ( lc == NULL ) { - rc = do_ldap_select( ld, tvp ); + rc = ldap_int_select( ld, tvp ); #ifdef LDAP_DEBUG if ( rc == -1 ) { Debug( LDAP_DEBUG_TRACE, - "do_ldap_select returned -1: errno %d\n", + "ldap_int_select returned -1: errno %d\n", errno, 0, 0 ); } #endif diff --git a/libraries/liblunicode/ure/urestubs.c b/libraries/liblunicode/ure/urestubs.c index bafce091de..3eaa100e46 100644 --- a/libraries/liblunicode/ure/urestubs.c +++ b/libraries/liblunicode/ure/urestubs.c @@ -49,7 +49,7 @@ ucs4_t _ure_tolower(ucs4_t c) return uctoupper(c); } -static struct maskmap { +static struct ucmaskmap { unsigned long mask1; unsigned long mask2; } masks[32] = { diff --git a/libraries/liblutil/ptest.c b/libraries/liblutil/ptest.c index dc972b071f..47ffd92a54 100644 --- a/libraries/liblutil/ptest.c +++ b/libraries/liblutil/ptest.c @@ -20,13 +20,11 @@ #include "lutil.h" -// #define SLAP_AUTHPASSWD 1 - /* * Password Test Program */ -char *hash[] = { +static char *hash[] = { #ifdef SLAP_AUTHPASSWD "SHA1", "MD5", #else diff --git a/servers/slapd/back-bdb/extended.c b/servers/slapd/back-bdb/extended.c index 83ab00ccc4..3af4d650d7 100644 --- a/servers/slapd/back-bdb/extended.c +++ b/servers/slapd/back-bdb/extended.c @@ -13,7 +13,7 @@ #include "back-bdb.h" #include "external.h" -struct exop { +static struct exop { char *oid; SLAP_EXTENDED_FN extended; } exop_table[] = { diff --git a/servers/slapd/back-bdb/index.c b/servers/slapd/back-bdb/index.c index 816f0abf42..8daaf8fce2 100644 --- a/servers/slapd/back-bdb/index.c +++ b/servers/slapd/back-bdb/index.c @@ -17,7 +17,7 @@ #include "lutil_hash.h" static char presence_keyval[LUTIL_HASH_BYTES] = {0,0,0,1}; -struct berval presence_key = {LUTIL_HASH_BYTES, presence_keyval}; +static struct berval presence_key = {LUTIL_HASH_BYTES, presence_keyval}; static slap_mask_t index_mask( Backend *be, diff --git a/servers/slapd/backglue.c b/servers/slapd/backglue.c index 13cfe7715a..696ed48bb4 100644 --- a/servers/slapd/backglue.c +++ b/servers/slapd/backglue.c @@ -149,7 +149,7 @@ glue_back_db_close ( return 0; } -int +static int glue_back_db_destroy ( BackendDB *be ) @@ -172,7 +172,7 @@ typedef struct glue_state { struct berval **refs; } glue_state; -void +static void glue_back_response ( Connection *conn, Operation *op, @@ -228,7 +228,7 @@ glue_back_response ( } } -void +static void glue_back_sresult ( Connection *c, Operation *op, @@ -247,7 +247,7 @@ glue_back_sresult ( NULL, NULL, NULL, ctrls); } -int +static int glue_back_search ( BackendDB *b0, Connection *conn, @@ -364,7 +364,7 @@ done: return rc; } -int +static int glue_back_bind ( BackendDB *b0, Connection *conn, @@ -392,7 +392,7 @@ glue_back_bind ( return rc; } -int +static int glue_back_compare ( BackendDB *b0, Connection *conn, @@ -417,7 +417,7 @@ glue_back_compare ( return rc; } -int +static int glue_back_modify ( BackendDB *b0, Connection *conn, @@ -442,7 +442,7 @@ glue_back_modify ( return rc; } -int +static int glue_back_modrdn ( BackendDB *b0, Connection *conn, @@ -469,7 +469,7 @@ glue_back_modrdn ( return rc; } -int +static int glue_back_add ( BackendDB *b0, Connection *conn, @@ -492,7 +492,7 @@ glue_back_add ( return rc; } -int +static int glue_back_delete ( BackendDB *b0, Connection *conn, @@ -516,7 +516,7 @@ glue_back_delete ( return rc; } -int +static int glue_back_release_rw ( BackendDB *b0, Connection *conn, @@ -539,7 +539,7 @@ glue_back_release_rw ( return rc; } -int +static int glue_back_group ( BackendDB *b0, Connection *conn, @@ -564,7 +564,7 @@ glue_back_group ( return rc; } -int +static int glue_back_attribute ( BackendDB *b0, Connection *conn, @@ -588,7 +588,7 @@ glue_back_attribute ( return rc; } -int +static int glue_back_referrals ( BackendDB *b0, Connection *conn, @@ -611,7 +611,7 @@ glue_back_referrals ( return rc; } -int +static int glue_tool_entry_open ( BackendDB *b0, int mode @@ -627,7 +627,7 @@ glue_tool_entry_open ( return 0; } -int +static int glue_tool_entry_close ( BackendDB *b0 ) @@ -642,7 +642,7 @@ glue_tool_entry_close ( return rc; } -ID +static ID glue_tool_entry_first ( BackendDB *b0 ) @@ -667,7 +667,7 @@ glue_tool_entry_first ( return glueBack->be_entry_first (glueBack); } -ID +static ID glue_tool_entry_next ( BackendDB *b0 ) @@ -699,7 +699,7 @@ glue_tool_entry_next ( return rc; } -Entry * +static Entry * glue_tool_entry_get ( BackendDB *b0, ID id @@ -711,7 +711,7 @@ glue_tool_entry_get ( return glueBack->be_entry_get (glueBack, id); } -ID +static ID glue_tool_entry_put ( BackendDB *b0, Entry *e @@ -742,7 +742,7 @@ glue_tool_entry_put ( return be->be_entry_put (be, e); } -int +static int glue_tool_entry_reindex ( BackendDB *b0, ID id @@ -754,7 +754,7 @@ glue_tool_entry_reindex ( return glueBack->be_entry_reindex (glueBack, id); } -int +static int glue_tool_sync ( BackendDB *b0 ) @@ -769,8 +769,6 @@ glue_tool_sync ( return 0; } -extern int num_subs; /* config.c */ - int glue_sub_init( ) { diff --git a/servers/slapd/filter.c b/servers/slapd/filter.c index a0d51a4b72..6c16a68046 100644 --- a/servers/slapd/filter.c +++ b/servers/slapd/filter.c @@ -837,7 +837,7 @@ filter_print( Filter *f ) #endif /* ldap_debug */ -int filter_escape_value( +static int filter_escape_value( struct berval *in, struct berval *out ) { diff --git a/servers/slapd/phonetic.c b/servers/slapd/phonetic.c index 4a925383e7..0a98e18ac9 100644 --- a/servers/slapd/phonetic.c +++ b/servers/slapd/phonetic.c @@ -24,7 +24,7 @@ ispunct((unsigned char) (x)) || \ isdigit((unsigned char) (x)) || (x) == '\0') -char * +static char * first_word( char *s ) { if ( s == NULL ) { @@ -42,7 +42,7 @@ first_word( char *s ) return( s ); } -char * +static char * next_word( char *s ) { if ( s == NULL ) { @@ -64,7 +64,7 @@ next_word( char *s ) return( s ); } -char * +static char * word_dup( char *w ) { char *s, *ret; diff --git a/servers/slapd/proto-slap.h b/servers/slapd/proto-slap.h index 1a24bdfc00..d61d63ea73 100644 --- a/servers/slapd/proto-slap.h +++ b/servers/slapd/proto-slap.h @@ -540,9 +540,6 @@ LDAP_SLAPD_F (Operation *) slap_op_pop LDAP_P(( Operation **olist )); * phonetic.c */ -LDAP_SLAPD_F (char *) first_word LDAP_P(( char *s )); -LDAP_SLAPD_F (char *) next_word LDAP_P(( char *s )); -LDAP_SLAPD_F (char *) word_dup LDAP_P(( char *w )); LDAP_SLAPD_F (char *) phonetic LDAP_P(( char *s )); /* @@ -908,6 +905,8 @@ LDAP_SLAPD_F (Attribute *) slap_operational_hasSubordinate( int has ); #define SLAP_SB_MAX_INCOMING_DEFAULT ((1<<18) - 1) #define SLAP_SB_MAX_INCOMING_AUTH ((1<<24) - 1) +LDAP_SLAPD_V(int) num_subs; + LDAP_SLAPD_V (ber_len_t) sockbuf_max_incoming; LDAP_SLAPD_V (ber_len_t) sockbuf_max_incoming_auth; diff --git a/servers/slapd/schema_prep.c b/servers/slapd/schema_prep.c index 34412ba580..6bf6849281 100644 --- a/servers/slapd/schema_prep.c +++ b/servers/slapd/schema_prep.c @@ -117,13 +117,12 @@ structuralObjectClassMatch( Debug( LDAP_DEBUG_TRACE, "structuralObjectClassMatch(%s,%s) = %d\n", value->bv_val, a->bv_val, *matchp ); #endif - #endif return LDAP_SUCCESS; } -struct slap_schema_oc_map { +static struct slap_schema_oc_map { char *ssom_name; size_t ssom_offset; } oc_map[] = { @@ -137,7 +136,7 @@ struct slap_schema_oc_map { { NULL, 0 } }; -struct slap_schema_ad_map { +static struct slap_schema_ad_map { char *ssam_name; slap_mr_match_func *ssam_match; slap_mr_indexer_func *ssam_indexer; @@ -236,7 +235,7 @@ static AttributeType slap_at_undefined = { /* mutex (don't know how to initialize it :) */ }; -struct slap_schema_mr_map { +static struct slap_schema_mr_map { char *ssmm_name; size_t ssmm_offset; } mr_map[] = { @@ -247,7 +246,7 @@ struct slap_schema_mr_map { { NULL, 0 } }; -struct slap_schema_syn_map { +static struct slap_schema_syn_map { char *sssm_name; size_t sssm_offset; } syn_map[] = {