/* charray.c - routines for dealing with char * arrays */
+/* $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
*/
void
charray_merge(
char ***a,
- const char **s
+ char **s
)
{
int i, n, nn;
int
charray_inlist(
- const char **a,
+ char **a,
const char *s
)
{
int i;
+ if( a == NULL ) return 0;
+
for ( i = 0; a[i] != NULL; i++ ) {
if ( strcasecmp( s, a[i] ) == 0 ) {
return( 1 );
}
char **
-charray_dup( const char **a )
+charray_dup( char **a )
{
int i;
char **new;
}
-char *
-charray2str( const char **a )
-{
- char *s;
- int i;
- size_t cur, len = 0;
-
- if( a == NULL ) return NULL;
-
- for( i=0 ; a[i] != NULL ; i++ ) {
- len += strlen( a[i] );
- }
-
- if( len == 0 ) return NULL;
-
- s = ch_malloc( len + 1 );
-
- cur = 0;
- for( i=0 ; a[i] != NULL ; i++ ) {
- len = strlen( a[i] );
- strncpy( &s[cur], a[i], len );
- cur += len;
- }
- s[len] = '\0';
- return s;
-}
-
-
char **
str2charray( const char *str_in, const char *brkstr )
{