Skip to content
Snippets Groups Projects
Commit 4046c422 authored by Pierangelo Masarati's avatar Pierangelo Masarati
Browse files

add upper/lower funcs that also compute the length of the string (not used yet)

parent b3ddb573
No related branches found
No related tags found
No related merge requests found
......@@ -162,6 +162,12 @@ ldap_pvt_str2upper LDAP_P(( char *str ));
LDAP_F( char * )
ldap_pvt_str2lower LDAP_P(( char *str ));
LDAP_F( struct berval * )
ldap_pvt_str2upperbv LDAP_P(( char *str, struct berval *bv ));
LDAP_F( struct berval * )
ldap_pvt_str2lowerbv LDAP_P(( char *str, struct berval *bv ));
/* tls.c */
LDAP_F (int) ldap_int_tls_config LDAP_P(( struct ldap *ld,
int option, const char *arg ));
......
......@@ -112,6 +112,26 @@ ldap_pvt_str2upper( char *str )
return( str );
}
struct berval *
ldap_pvt_str2upperbv( char *str, struct berval *bv )
{
char *s = NULL;
assert( bv );
/* to upper */
if ( str ) {
for ( s = str; *s; s++ ) {
*s = TOUPPER( (unsigned char) *s );
}
}
bv->bv_val = str;
bv->bv_len = (ber_len_t)(s - str);
return( bv );
}
char *
ldap_pvt_str2lower( char *str )
{
......@@ -126,3 +146,23 @@ ldap_pvt_str2lower( char *str )
return( str );
}
struct berval *
ldap_pvt_str2lowerbv( char *str, struct berval *bv )
{
char *s = NULL;
assert( bv );
/* to lower */
if ( str ) {
for ( s = str; *s; s++ ) {
*s = TOLOWER( (unsigned char) *s );
}
}
bv->bv_val = str;
bv->bv_len = (ber_len_t)(s - str);
return( bv );
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment