3 * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved.
4 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
10 #include <ac/string.h>
17 #if defined ( HAVE_STRSPN )
18 #define int_strspn strspn
20 static int int_strspn( const char *str, const char *delim )
25 for( pos=0; (*str) ; pos++,str++) {
27 for( p=delim; (*p) ; p++ ) {
42 #if defined( HAVE_STRPBRK )
43 #define int_strpbrk strpbrk
45 static char *(int_strpbrk)( const char *str, const char *accept )
49 for( ; (*str) ; str++ ) {
50 for( p=accept; (*p) ; p++) {
61 char *(ldap_pvt_strtok)( char *str, const char *delim, char **pos )
77 /* skip any initial delimiters */
78 str += int_strspn( str, delim );
83 p = int_strpbrk( str, delim );
96 (ldap_pvt_strdup)( const char *s )
99 size_t len = strlen( s ) + 1;
101 if ( (p = (char *) malloc( len )) == NULL ) {
110 ldap_pvt_str2upper( char *str )
115 for ( s = str; *s; s++ ) {
116 *s = TOUPPER( (unsigned char) *s );
123 ldap_pvt_str2lower( char *str )
128 for ( s = str; *s; s++ ) {
129 *s = TOLOWER( (unsigned char) *s );