From: Kurt Zeilenga Date: Mon, 23 Jul 2001 05:00:39 +0000 (+0000) Subject: misc updates, constification, deprecation... X-Git-Tag: LDBM_PRE_GIANT_RWLOCK~1209 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=2b7727882db19205f64db8031deb4a2d777b97d4;p=openldap misc updates, constification, deprecation... --- diff --git a/include/ldap.h b/include/ldap.h index ef0aca7fb1..ebe247420e 100644 --- a/include/ldap.h +++ b/include/ldap.h @@ -1441,7 +1441,7 @@ ldap_mods_free LDAP_P(( LDAP_F( char * ) ldap_friendly_name LDAP_P(( /* deprecated */ LDAP_CONST char *filename, - /* LDAP_CONST */ char *uname, + LDAP_CONST char *uname, LDAPFriendlyMap **map )); LDAP_F( void ) diff --git a/include/ldap_log.h b/include/ldap_log.h index 6cb34d5cc4..caa4ee2d2c 100644 --- a/include/ldap_log.h +++ b/include/ldap_log.h @@ -135,10 +135,13 @@ LDAP_BEGIN_DECL #endif /* LDAP_DEBUG */ -LDAP_LUTIL_F(int) lutil_mnem2level LDAP_P(( char *level )); -LDAP_LUTIL_F(void) lutil_log_initialize(int argc, char **argv); -LDAP_LUTIL_F(void) lutil_set_debug_level LDAP_P(( char *subsys, int level )); -LDAP_LUTIL_F(void) lutil_log LDAP_P(( char *subsys, int level, const char *fmt, ... )); +LDAP_LUTIL_F(int) lutil_mnem2level LDAP_P(( const char *level )); +LDAP_LUTIL_F(void) lutil_log_initialize LDAP_P(( + int argc, char **argv )); +LDAP_LUTIL_F(void) lutil_set_debug_level LDAP_P(( + const char *subsys, int level )); +LDAP_LUTIL_F(void) lutil_log LDAP_P(( + const char *subsys, int level, const char *fmt, ... )); LDAP_LUTIL_F(int) lutil_debug_file LDAP_P(( FILE *file )); diff --git a/libraries/libldap/friendly.c b/libraries/libldap/friendly.c index 5d4abdabbe..10dd461a90 100644 --- a/libraries/libldap/friendly.c +++ b/libraries/libldap/friendly.c @@ -25,7 +25,7 @@ char * ldap_friendly_name( LDAP_CONST char *filename, - /* LDAP_CONST */ char *uname, + LDAP_CONST char *uname, LDAPFriendlyMap **map ) { int i, entries; @@ -35,12 +35,12 @@ ldap_friendly_name( if ( map == NULL ) { errno = EINVAL; - return( uname ); + return (char *) uname; } if ( *map == NULL ) { if ( (fp = fopen( filename, "r" )) == NULL ) - return( uname ); + return (char *) uname; entries = 0; while ( fgets( buf, sizeof(buf), fp ) != NULL ) { @@ -52,7 +52,7 @@ ldap_friendly_name( if ( (*map = (LDAPFriendlyMap *) LDAP_MALLOC( (entries + 1) * sizeof(LDAPFriendlyMap) )) == NULL ) { fclose( fp ); - return( uname ); + return (char *) uname; } i = 0; @@ -99,7 +99,7 @@ ldap_friendly_name( if ( strcasecmp( uname, (*map)[i].lf_unfriendly ) == 0 ) return( (*map)[i].lf_friendly ); } - return( uname ); + return (char *) uname; } diff --git a/libraries/liblutil/debug.c b/libraries/liblutil/debug.c index bab03654ae..ef58ef271b 100644 --- a/libraries/liblutil/debug.c +++ b/libraries/liblutil/debug.c @@ -49,7 +49,7 @@ static char *lutil_levels[] = {"emergency", "alert", "critical", "results", "detail1", "detail2", NULL}; -int lutil_mnem2level( char *level ) +int lutil_mnem2level( const char *level ) { int i; for( i = 0; lutil_levels[i] != NULL; i++ ) @@ -97,7 +97,7 @@ static void addSubsys( const char *subsys, int level ) return; } -void lutil_set_debug_level( char* subsys, int level ) +void lutil_set_debug_level( const char* subsys, int level ) { addSubsys( subsys, level ); } @@ -112,7 +112,7 @@ int lutil_debug_file( FILE *file ) void lutil_log_int( FILE* file, - char *subsys, int level, + const char *subsys, int level, const char *fmt, va_list vl ) { time_t now; @@ -199,7 +199,7 @@ void lutil_log_int( * level of the log output and the format and data. Send this on to the * internal routine with the print file, if any. */ -void lutil_log( char *subsys, int level, const char *fmt, ... ) +void lutil_log( const char *subsys, int level, const char *fmt, ... ) { FILE* outfile = NULL; va_list vl;