X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=libraries%2Flibldap%2Fstring.c;h=21598fe004efb8858ba32764014593a5728e5dc6;hb=c23536faa9bebfed42ee17b693f780e160a801ad;hp=c3fdb7b9c3bcac129b2692469582945a1b54a852;hpb=1bcec8bf6a17a65396b2c947faed846d20428db9;p=openldap diff --git a/libraries/libldap/string.c b/libraries/libldap/string.c index c3fdb7b9c3..21598fe004 100644 --- a/libraries/libldap/string.c +++ b/libraries/libldap/string.c @@ -1,13 +1,20 @@ +/* $OpenLDAP$ */ /* - * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved. + * Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved. * COPYING RESTRICTIONS APPLY, see COPYRIGHT file */ +/* + * Locale-specific 1-byte character versions + * See utf-8.c for UTF-8 versions + */ + #include "portable.h" -#include +#include #include #include +#include #include "ldap-int.h" @@ -96,10 +103,36 @@ char * char *p; size_t len = strlen( s ) + 1; - if ( (p = (char *) LDAP_MALLOC( len )) == NULL ) { + if ( (p = (char *) malloc( len )) == NULL ) { return( NULL ); } memcpy( p, s, len ); return( p ); } + +char * +ldap_pvt_str2upper( char *str ) +{ + char *s; + + /* to upper */ + for ( s = str; *s; s++ ) { + *s = TOUPPER( (unsigned char) *s ); + } + + return( str ); +} + +char * +ldap_pvt_str2lower( char *str ) +{ + char *s; + + /* to lower */ + for ( s = str; *s; s++ ) { + *s = TOLOWER( (unsigned char) *s ); + } + + return( str ); +}