Skip to content
Snippets Groups Projects
Commit 2b772788 authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

misc updates, constification, deprecation...

parent e17f0256
No related branches found
No related tags found
No related merge requests found
......@@ -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 )
......
......@@ -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 ));
......
......@@ -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;
}
......
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment