+/* $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 <stdlib.h>
+#include <ac/stdlib.h>
#include <ac/string.h>
#include <ac/time.h>
+#include <ac/ctype.h>
#include "ldap-int.h"
(ldap_pvt_strdup)( const char *s )
{
char *p;
- int len = strlen( s ) + 1;
+ size_t len = strlen( s ) + 1;
if ( (p = (char *) malloc( len )) == NULL ) {
- return( (char *)0 );
+ 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 );
+}