use ldap_charray_*() instead of charray_*()

This commit is contained in:
Kurt Zeilenga 2002-08-24 00:55:24 +00:00
parent c67781d0ea
commit 23efa07a99
14 changed files with 29 additions and 44 deletions

View File

@ -67,7 +67,7 @@ bdb_attr_index_config(
char **attrs;
char **indexes = NULL;
attrs = str2charray( argv[0], "," );
attrs = ldap_str2charray( argv[0], "," );
if( attrs == NULL ) {
fprintf( stderr, "%s: line %d: "
@ -77,7 +77,7 @@ bdb_attr_index_config(
}
if ( argc > 1 ) {
indexes = str2charray( argv[1], "," );
indexes = ldap_str2charray( argv[1], "," );
if( indexes == NULL ) {
fprintf( stderr, "%s: line %d: "
@ -205,8 +205,8 @@ bdb_attr_index_config(
}
}
charray_free( attrs );
if ( indexes != NULL ) charray_free( indexes );
ldap_charray_free( attrs );
if ( indexes != NULL ) ldap_charray_free( indexes );
return LDAP_SUCCESS;
}

View File

@ -744,7 +744,7 @@ int bdb_build_tree(
rdns = ldap_explode_dn(be->be_nsuffix[0].bv_val, 0);
for (i=0; rdns[i]; i++);
bdb->bi_nrdns = i;
charray_free(rdns);
ldap_charray_free(rdns);
DBTzero( &key );
DBTzero( &data );
@ -938,7 +938,7 @@ bdb_dn2id_matched(
for (i=0; rdns[i]; i++);
i -= bdb->bi_nrdns;
if (i < 0) {
charray_free(rdns);
ldap_charray_free(rdns);
return -1;
}
n = p;
@ -951,7 +951,7 @@ bdb_dn2id_matched(
p = n;
}
ldap_pvt_thread_rdwr_runlock(&bdb->bi_tree_rdwr);
charray_free(rdns);
ldap_charray_free(rdns);
if (n) {
*id = n->i_id;

View File

@ -65,7 +65,7 @@ dnssrv_back_referrals(
goto done;
}
hosts = str2charray( hostlist, " " );
hosts = ldap_str2charray( hostlist, " " );
if( hosts == NULL ) {
Debug( LDAP_DEBUG_TRACE, "DNSSRV: str2charrary error\n", 0, 0, 0 );
@ -103,7 +103,7 @@ dnssrv_back_referrals(
done:
if( domain != NULL ) ch_free( domain );
if( hostlist != NULL ) ch_free( hostlist );
if( hosts != NULL ) charray_free( hosts );
if( hosts != NULL ) ldap_charray_free( hosts );
ber_bvarray_free( urls );
return rc;
}

View File

@ -63,7 +63,7 @@ dnssrv_back_search(
goto done;
}
hosts = str2charray( hostlist, " " );
hosts = ldap_str2charray( hostlist, " " );
if( hosts == NULL ) {
Debug( LDAP_DEBUG_TRACE, "DNSSRV: str2charrary error\n", 0, 0, 0 );
@ -225,7 +225,7 @@ dnssrv_back_search(
done:
if( domain != NULL ) ch_free( domain );
if( hostlist != NULL ) ch_free( hostlist );
if( hosts != NULL ) charray_free( hosts );
if( hosts != NULL ) ldap_charray_free( hosts );
if( urls != NULL ) ber_bvarray_free( urls );
return 0;
}

View File

@ -67,7 +67,7 @@ attr_index_config(
char **attrs;
char **indexes = NULL;
attrs = str2charray( argv[0], "," );
attrs = ldap_str2charray( argv[0], "," );
if( attrs == NULL ) {
fprintf( stderr, "%s: line %d: "
@ -77,7 +77,7 @@ attr_index_config(
}
if ( argc > 1 ) {
indexes = str2charray( argv[1], "," );
indexes = ldap_str2charray( argv[1], "," );
if( indexes == NULL ) {
fprintf( stderr, "%s: line %d: "
@ -206,8 +206,8 @@ attr_index_config(
}
}
charray_free( attrs );
if ( indexes != NULL ) charray_free( indexes );
ldap_charray_free( attrs );
if ( indexes != NULL ) ldap_charray_free( indexes );
return LDAP_SUCCESS;
}

View File

@ -32,7 +32,7 @@ extern void make_surrogate_parent LDAP_P(( void ));
#else /* !SHELL_SURROGATE_PARENT */
typedef char **Cmd_info;
#define MAKE_CMD_INFO(args) charray_dup( args )
#define MAKE_CMD_INFO(args) ldap_charray_dup( args )
#define IS_NULLCMD(cmd) ((cmd) == NULL)
#endif /* SHELL_SURROGATE_PARENT */

View File

@ -748,7 +748,7 @@ backend_check_controls(
for( ; *ctrls != NULL ; ctrls++ ) {
if( (*ctrls)->ldctl_iscritical &&
!charray_inlist( be->be_controls, (*ctrls)->ldctl_oid ) )
!ldap_charray_inlist( be->be_controls, (*ctrls)->ldctl_oid ) )
{
*text = "control unavailable in context";
return LDAP_UNAVAILABLE_CRITICAL_EXTENSION;

View File

@ -95,7 +95,7 @@ static SLPHandle slapd_hslp = 0;
void slapd_slp_init( const char* urls ) {
int i;
slapd_srvurls = str2charray( urls, " " );
slapd_srvurls = ldap_str2charray( urls, " " );
if( slapd_srvurls == NULL ) return;
@ -134,7 +134,7 @@ void slapd_slp_init( const char* urls ) {
void slapd_slp_deinit() {
if( slapd_srvurls == NULL ) return;
charray_free( slapd_srvurls );
ldap_charray_free( slapd_srvurls );
slapd_srvurls = NULL;
/* close the SLP handle */
@ -927,7 +927,7 @@ int slapd_daemon_init( const char *urls )
urls = "ldap:///";
}
u = str2charray( urls, " " );
u = ldap_str2charray( urls, " " );
if( u == NULL || u[0] == NULL ) {
#ifdef NEW_LOGGING
@ -958,7 +958,7 @@ int slapd_daemon_init( const char *urls )
Debug( LDAP_DEBUG_ANY, "daemon_init: no listeners to open (%s)\n",
urls, 0, 0 );
#endif
charray_free( u );
ldap_charray_free( u );
return -1;
}
@ -973,7 +973,7 @@ int slapd_daemon_init( const char *urls )
for(n = 0, j = 0; u[n]; n++ ) {
if ( slap_open_listener( u[n], &i, &j ) ) {
charray_free( u );
ldap_charray_free( u );
return -1;
}
}
@ -992,7 +992,7 @@ int slapd_daemon_init( const char *urls )
slapd_slp_reg();
#endif
charray_free( u );
ldap_charray_free( u );
ldap_pvt_thread_mutex_init( &slap_daemon.sd_mutex );
return !i;
}

View File

@ -176,10 +176,6 @@ SOURCE=.\ch_malloc.c
# End Source File
# Begin Source File
SOURCE=.\charray.c
# End Source File
# Begin Source File
SOURCE=.\compare.c
# End Source File
# Begin Source File

View File

@ -65,7 +65,7 @@ oidm_destroy()
for (om = om_list; om; om = n) {
n = om->som_next;
charray_free(om->som_names);
ldap_charray_free(om->som_names);
free(om->som_oid.bv_val);
free(om);
}
@ -101,7 +101,7 @@ usage: fprintf( stderr, "\tObjectIdentifier <name> <oid>\n");
om = (OidMacro *) ch_malloc( sizeof(OidMacro) );
om->som_names = NULL;
charray_add( &om->som_names, argv[1] );
ldap_charray_add( &om->som_names, argv[1] );
om->som_oid.bv_val = oidm_find( argv[2] );
if (!om->som_oid.bv_val) {

View File

@ -7,6 +7,7 @@
#define PROTO_SLAP_H
#include <ldap_cdefs.h>
#include "ldap_pvt.h"
LDAP_BEGIN_DECL
@ -257,19 +258,6 @@ LDAP_SLAPD_F (void) ch_free LDAP_P(( void * ));
#endif
#endif
/*
* charray.c
*/
LDAP_SLAPD_F (void) charray_add LDAP_P(( char ***a, const char *s ));
LDAP_SLAPD_F (void) charray_add_n LDAP_P(( char ***a, const char *s, int l ));
LDAP_SLAPD_F (void) charray_merge LDAP_P(( char ***a, char **s ));
LDAP_SLAPD_F (void) charray_free LDAP_P(( char **array ));
LDAP_SLAPD_F (int) charray_inlist LDAP_P(( char **a, const char *s ));
LDAP_SLAPD_F (char **) charray_dup LDAP_P(( char **a ));
LDAP_SLAPD_F (char **) str2charray LDAP_P(( const char *str, const char *brkstr ));
LDAP_SLAPD_F (int) charray_strcmp LDAP_P(( const char **a1, const char **a2 ));
LDAP_SLAPD_F (int) charray_strcasecmp LDAP_P(( const char **a1, const char **a2 ));
/*
* controls.c
*/

View File

@ -143,7 +143,7 @@ root_dse_info(
vals[0].bv_len = strlen( vals[0].bv_val );
attr_merge( e, ad_supportedSASLMechanisms, vals );
}
charray_free( supportedSASLMechanisms );
ldap_charray_free( supportedSASLMechanisms );
}
if ( default_referral != NULL ) {

View File

@ -1371,7 +1371,7 @@ char ** slap_sasl_mechs( Connection *conn )
return NULL;
}
mechs = str2charray( mechstr, "," );
mechs = ldap_str2charray( mechstr, "," );
#if SASL_VERSION_MAJOR < 2
ch_free( mechstr );

View File

@ -16,6 +16,7 @@
#include <lber.h>
#include <ldif.h>
#include <lutil.h>
#include "slapcommon.h"