Project_Dep_Name ldapsearch
End Project Dependency
Begin Project Dependency
- Project_Dep_Name ldbmtest
- End Project Dependency
- Begin Project Dependency
Project_Dep_Name ldif
End Project Dependency
Begin Project Dependency
###############################################################################
-Project: "ldbmtest"=..\servers\slapd\tools\ldbmtest.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name backldbm
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name liblber
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name libldap_r
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name libldbm
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name liblutil
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name libslapd
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name libavl
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name libldif
- End Project Dependency
-}}}
-
-###############################################################################
-
Project: "ldif"=..\servers\slapd\tools\ldif.dsp - Package Owner=<4>
Package=<5>
LIBLDAP_F(char *) ldap_pvt_strtok LDAP_P(( char *str, const char *delim,
char **pos ));
-LIBLDAP_F(char *) ldap_pvt_strdup LDAP_P(( const char * s ));
-
#ifndef HAVE_STRDUP
/* strdup() is missing, declare our own version */
# undef strdup
-# define strdup(s) ldap_pvt_strdup(s)
+# define strdup(s) ber_strdup(s)
#else
/* some systems fail to declare strdup */
LIBC_F(char *) (strdup)();
*tmpllistp = prevtmpl = NULL;
- if ( next_line_tokens( &buf, &buflen, &toks ) != 2 ||
+ if ( ldap_int_next_line_tokens( &buf, &buflen, &toks ) != 2 ||
strcasecmp( toks[ 0 ], "version" ) != 0 ) {
- free_strarray( toks );
+ LDAP_VFREE( toks );
return( LDAP_TMPL_ERR_SYNTAX );
}
version = atoi( toks[ 1 ] );
- free_strarray( toks );
+ LDAP_VFREE( toks );
if ( version != LDAP_TEMPLATE_VERSION ) {
return( LDAP_TMPL_ERR_VERSION );
}
for ( ocp = tmpl->dt_oclist; ocp != NULL; ocp = nextocp ) {
nextocp = ocp->oc_next;
- free_strarray( ocp->oc_objclasses );
+ LDAP_VFREE( ocp->oc_objclasses );
LDAP_FREE( ocp );
}
}
LDAP_FREE( colp->ti_label );
}
if ( colp->ti_args != NULL ) {
- free_strarray( colp->ti_args );
+ LDAP_VFREE( colp->ti_args );
}
LDAP_FREE( colp );
}
/*
* template name comes first
*/
- if (( tokcnt = next_line_tokens( bufp, blenp, &toks )) != 1 ) {
- free_strarray( toks );
+ if (( tokcnt = ldap_int_next_line_tokens( bufp, blenp, &toks )) != 1 ) {
+ LDAP_VFREE( toks );
return( tokcnt == 0 ? 0 : LDAP_TMPL_ERR_SYNTAX );
}
if (( tmpl = (struct ldap_disptmpl *)LDAP_CALLOC( 1,
sizeof( struct ldap_disptmpl ))) == NULL ) {
- free_strarray( toks );
+ LDAP_VFREE( toks );
return( LDAP_TMPL_ERR_MEM );
}
tmpl->dt_name = toks[ 0 ];
/*
* template plural name comes next
*/
- if (( tokcnt = next_line_tokens( bufp, blenp, &toks )) != 1 ) {
- free_strarray( toks );
+ if (( tokcnt = ldap_int_next_line_tokens( bufp, blenp, &toks )) != 1 ) {
+ LDAP_VFREE( toks );
free_disptmpl( tmpl );
return( LDAP_TMPL_ERR_SYNTAX );
}
/*
* template icon name is next
*/
- if (( tokcnt = next_line_tokens( bufp, blenp, &toks )) != 1 ) {
- free_strarray( toks );
+ if (( tokcnt = ldap_int_next_line_tokens( bufp, blenp, &toks )) != 1 ) {
+ LDAP_VFREE( toks );
free_disptmpl( tmpl );
return( LDAP_TMPL_ERR_SYNTAX );
}
/*
* template options come next
*/
- if (( tokcnt = next_line_tokens( bufp, blenp, &toks )) < 1 ) {
- free_strarray( toks );
+ if (( tokcnt = ldap_int_next_line_tokens( bufp, blenp, &toks )) < 1 ) {
+ LDAP_VFREE( toks );
free_disptmpl( tmpl );
return( LDAP_TMPL_ERR_SYNTAX );
}
}
}
}
- free_strarray( toks );
+ LDAP_VFREE( toks );
/*
* object class list is next
*/
- while (( tokcnt = next_line_tokens( bufp, blenp, &toks )) > 0 ) {
+ while (( tokcnt = ldap_int_next_line_tokens( bufp, blenp, &toks )) > 0 ) {
if (( ocp = (struct ldap_oclist *)LDAP_CALLOC( 1,
sizeof( struct ldap_oclist ))) == NULL ) {
- free_strarray( toks );
+ LDAP_VFREE( toks );
free_disptmpl( tmpl );
return( LDAP_TMPL_ERR_MEM );
}
/*
* read name of attribute to authenticate as
*/
- if (( tokcnt = next_line_tokens( bufp, blenp, &toks )) != 1 ) {
- free_strarray( toks );
+ if (( tokcnt = ldap_int_next_line_tokens( bufp, blenp, &toks )) != 1 ) {
+ LDAP_VFREE( toks );
free_disptmpl( tmpl );
return( LDAP_TMPL_ERR_SYNTAX );
}
/*
* read default attribute to use for RDN
*/
- if (( tokcnt = next_line_tokens( bufp, blenp, &toks )) != 1 ) {
- free_strarray( toks );
+ if (( tokcnt = ldap_int_next_line_tokens( bufp, blenp, &toks )) != 1 ) {
+ LDAP_VFREE( toks );
free_disptmpl( tmpl );
return( LDAP_TMPL_ERR_SYNTAX );
}
/*
* read default location for new entries
*/
- if (( tokcnt = next_line_tokens( bufp, blenp, &toks )) != 1 ) {
- free_strarray( toks );
+ if (( tokcnt = ldap_int_next_line_tokens( bufp, blenp, &toks )) != 1 ) {
+ LDAP_VFREE( toks );
free_disptmpl( tmpl );
return( LDAP_TMPL_ERR_SYNTAX );
}
/*
* read list of rules used to define default values for new entries
*/
- while (( tokcnt = next_line_tokens( bufp, blenp, &toks )) > 0 ) {
+ while (( tokcnt = ldap_int_next_line_tokens( bufp, blenp, &toks )) > 0 ) {
if ( strcasecmp( ADDEF_CONSTANT, toks[ 0 ] ) == 0 ) {
adsource = LDAP_ADSRC_CONSTANTVALUE;
} else if ( strcasecmp( ADDEF_ADDERSDN, toks[ 0 ] ) == 0 ) {
if ( adsource == 0 || tokcnt < 2 ||
( adsource == LDAP_ADSRC_CONSTANTVALUE && tokcnt != 3 ) ||
( adsource == LDAP_ADSRC_ADDERSDN && tokcnt != 2 )) {
- free_strarray( toks );
+ LDAP_VFREE( toks );
free_disptmpl( tmpl );
return( LDAP_TMPL_ERR_SYNTAX );
}
if (( adp = (struct ldap_adddeflist *)LDAP_CALLOC( 1,
sizeof( struct ldap_adddeflist ))) == NULL ) {
- free_strarray( toks );
+ LDAP_VFREE( toks );
free_disptmpl( tmpl );
return( LDAP_TMPL_ERR_MEM );
}
* item list is next
*/
samerow = 0;
- while (( tokcnt = next_line_tokens( bufp, blenp, &toks )) > 0 ) {
+ while (( tokcnt = ldap_int_next_line_tokens( bufp, blenp, &toks )) > 0 ) {
if ( strcasecmp( toks[ 0 ], "item" ) == 0 ) {
if ( tokcnt < 4 ) {
- free_strarray( toks );
+ LDAP_VFREE( toks );
free_disptmpl( tmpl );
return( LDAP_TMPL_ERR_SYNTAX );
}
if (( ip = (struct ldap_tmplitem *)LDAP_CALLOC( 1,
sizeof( struct ldap_tmplitem ))) == NULL ) {
- free_strarray( toks );
+ LDAP_VFREE( toks );
free_disptmpl( tmpl );
return( LDAP_TMPL_ERR_MEM );
}
}
}
if ( itemoptions[ i ] == NULL ) {
- free_strarray( toks );
+ LDAP_VFREE( toks );
free_disptmpl( tmpl );
return( LDAP_TMPL_ERR_SYNTAX );
}
}
}
if ( itemtypes[ i ] == NULL ) {
- free_strarray( toks );
+ LDAP_VFREE( toks );
free_disptmpl( tmpl );
return( LDAP_TMPL_ERR_SYNTAX );
}
previp = ip;
samerow = 0;
} else if ( strcasecmp( toks[ 0 ], "samerow" ) == 0 ) {
- free_strarray( toks );
+ LDAP_VFREE( toks );
samerow = 1;
} else {
- free_strarray( toks );
+ LDAP_VFREE( toks );
free_disptmpl( tmpl );
return( LDAP_TMPL_ERR_SYNTAX );
}
static char *next_token LDAP_P(( char ** sp ));
-
int
-next_line_tokens( char **bufp, ber_len_t *blenp, char ***toksp )
+ldap_int_next_line_tokens( char **bufp, ber_len_t *blenp, char ***toksp )
{
char *p, *line, *token, **toks;
int rc, tokcnt;
if ( tokcnt == 1 && strcasecmp( toks[ 0 ], "END" ) == 0 ) {
tokcnt = 0;
- free_strarray( toks );
+ LDAP_VFREE( toks );
toks = NULL;
}
return( LDAP_STRDUP( tokstart ));
}
-
-
-void
-free_strarray( char **sap )
-{
- int i;
-
- if ( sap != NULL ) {
- for ( i = 0; sap[ i ] != NULL; ++i ) {
- LBER_FREE( sap[ i ] );
- }
- LBER_FREE( (char *)sap );
- }
-}
fip = NULL;
tag = NULL;
- while ( buflen > 0 && ( tokcnt = next_line_tokens( &buf, &buflen, &tok ))
+ while ( buflen > 0 && ( tokcnt = ldap_int_next_line_tokens( &buf, &buflen, &tok ))
> 0 ) {
switch( tokcnt ) {
nextflp->lfl_pattern, error );
errno = EINVAL;
#endif /* LDAP_LIBUI */
- free_strarray( tok );
+ LDAP_VFREE( tok );
return( NULL );
}
regfree(&re);
if (( nextfip = (LDAPFiltInfo *)LDAP_CALLOC( 1,
sizeof( LDAPFiltInfo ))) == NULL ) {
ldap_getfilter_free( lfdp );
- free_strarray( tok );
+ LDAP_VFREE( tok );
return( NULL );
}
if ( fip == NULL ) { /* first one */
} else if ( strcasecmp( tok[ 2 ], "base" ) == 0 ) {
nextfip->lfi_scope = LDAP_SCOPE_BASE;
} else {
- free_strarray( tok );
+ LDAP_VFREE( tok );
ldap_getfilter_free( lfdp );
errno = EINVAL;
return( NULL );
break;
default:
- free_strarray( tok );
+ LDAP_VFREE( tok );
ldap_getfilter_free( lfdp );
errno = EINVAL;
return( NULL );
/*
* in dsparse.c
*/
-LIBLDAP_F (int) next_line_tokens LDAP_P(( char **bufp, ber_len_t *blenp, char ***toksp ));
-LIBLDAP_F (void) free_strarray LDAP_P(( char **sap ));
+LIBLDAP_F (int) ldap_int_next_line_tokens LDAP_P(( char **bufp, ber_len_t *blenp, char ***toksp ));
#ifdef LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND
/*
return 0;
}
- new = (struct timeval *) malloc(sizeof(struct timeval));
+ new = (struct timeval *) LDAP_MALLOC(sizeof(struct timeval));
if( new == NULL ) {
*dest = NULL;
*referralsp = refs;
} else {
- ldap_value_free( refs );
+ LDAP_VFREE( refs );
}
if( freeit ) {
if( lc->lconn_rebind_queue != NULL) {
int i;
for( i = 0; lc->lconn_rebind_queue[i] != NULL; i++) {
- free_strarray(lc->lconn_rebind_queue[i]);
+ LDAP_VFREE(lc->lconn_rebind_queue[i]);
}
LDAP_FREE( lc->lconn_rebind_queue);
}
if( lc->lconn_rebind_queue != NULL) {
/* Release resources of previous list */
- free_strarray(refarray);
+ LDAP_VFREE(refarray);
refarray = NULL;
ldap_free_urllist(srv);
srv = NULL;
}
} /* end for loop */
done:
- free_strarray(refarray);
+ LDAP_VFREE(refarray);
ldap_free_urllist(srv);
LDAP_FREE( *errstrp );
mechlist = array2str( values );
if ( mechlist == NULL ) {
ld->ld_errno = LDAP_NO_MEMORY;
- ldap_value_free( values );
+ LDAP_VFREE( values );
ldap_msgfree( res );
return ld->ld_errno;
}
- ldap_value_free( values );
+ LDAP_VFREE( values );
ldap_msgfree( res );
*pmechlist = mechlist;
}
static char *const err2text[] = {
- "",
+ "Success",
"Out of memory",
"Unexpected token",
"Missing opening parenthesis",
char *
ldap_scherr2str(int code)
{
- if ( code < 1 || code >= (sizeof(err2text)/sizeof(char *)) ) {
+ if ( code < 0 || code >= (sizeof(err2text)/sizeof(char *)) ) {
return "Unknown error";
} else {
return err2text[code];
*ep = et[i].et_msg;
ep = &(*ep)->lm_chain;
- ldap_value_free( et[i].et_vals );
+ LDAP_VFREE( et[i].et_vals );
}
*ep = last;
LDAP_FREE( (char *) et );
*solistp = prevso = NULL;
- if ( next_line_tokens( &buf, &buflen, &toks ) != 2 ||
+ if ( ldap_int_next_line_tokens( &buf, &buflen, &toks ) != 2 ||
strcasecmp( toks[ 0 ], "version" ) != 0 ) {
- free_strarray( toks );
+ LDAP_VFREE( toks );
return( LDAP_SEARCHPREF_ERR_SYNTAX );
}
version = atoi( toks[ 1 ] );
- free_strarray( toks );
+ LDAP_VFREE( toks );
if ( version != LDAP_SEARCHPREF_VERSION &&
version != LDAP_SEARCHPREF_VERSION_ZERO ) {
return( LDAP_SEARCHPREF_ERR_VERSION );
/*
* Object type prompt comes first
*/
- if (( tokcnt = next_line_tokens( bufp, blenp, &toks )) != 1 ) {
- free_strarray( toks );
+ if (( tokcnt = ldap_int_next_line_tokens( bufp, blenp, &toks )) != 1 ) {
+ LDAP_VFREE( toks );
return( tokcnt == 0 ? 0 : LDAP_SEARCHPREF_ERR_SYNTAX );
}
if (( so = (struct ldap_searchobj *)LDAP_CALLOC( 1,
sizeof( struct ldap_searchobj ))) == NULL ) {
- free_strarray( toks );
+ LDAP_VFREE( toks );
return( LDAP_SEARCHPREF_ERR_MEM );
}
so->so_objtypeprompt = toks[ 0 ];
* if this is post-version zero, options come next
*/
if ( soversion > LDAP_SEARCHPREF_VERSION_ZERO ) {
- if (( tokcnt = next_line_tokens( bufp, blenp, &toks )) < 1 ) {
- free_strarray( toks );
+ if (( tokcnt = ldap_int_next_line_tokens( bufp, blenp, &toks )) < 1 ) {
+ LDAP_VFREE( toks );
ldap_free_searchprefs( so );
return( LDAP_SEARCHPREF_ERR_SYNTAX );
}
}
}
}
- free_strarray( toks );
+ LDAP_VFREE( toks );
}
/*
* "Fewer choices" prompt is next
*/
- if (( tokcnt = next_line_tokens( bufp, blenp, &toks )) != 1 ) {
- free_strarray( toks );
+ if (( tokcnt = ldap_int_next_line_tokens( bufp, blenp, &toks )) != 1 ) {
+ LDAP_VFREE( toks );
ldap_free_searchprefs( so );
return( LDAP_SEARCHPREF_ERR_SYNTAX );
}
/*
* Filter prefix for "More Choices" searching is next
*/
- if (( tokcnt = next_line_tokens( bufp, blenp, &toks )) != 1 ) {
- free_strarray( toks );
+ if (( tokcnt = ldap_int_next_line_tokens( bufp, blenp, &toks )) != 1 ) {
+ LDAP_VFREE( toks );
ldap_free_searchprefs( so );
return( LDAP_SEARCHPREF_ERR_SYNTAX );
}
/*
* "Fewer Choices" filter tag comes next
*/
- if (( tokcnt = next_line_tokens( bufp, blenp, &toks )) != 1 ) {
- free_strarray( toks );
+ if (( tokcnt = ldap_int_next_line_tokens( bufp, blenp, &toks )) != 1 ) {
+ LDAP_VFREE( toks );
ldap_free_searchprefs( so );
return( LDAP_SEARCHPREF_ERR_SYNTAX );
}
/*
* Selection (disambiguation) attribute comes next
*/
- if (( tokcnt = next_line_tokens( bufp, blenp, &toks )) != 1 ) {
- free_strarray( toks );
+ if (( tokcnt = ldap_int_next_line_tokens( bufp, blenp, &toks )) != 1 ) {
+ LDAP_VFREE( toks );
ldap_free_searchprefs( so );
return( LDAP_SEARCHPREF_ERR_SYNTAX );
}
/*
* Label for selection (disambiguation) attribute
*/
- if (( tokcnt = next_line_tokens( bufp, blenp, &toks )) != 1 ) {
- free_strarray( toks );
+ if (( tokcnt = ldap_int_next_line_tokens( bufp, blenp, &toks )) != 1 ) {
+ LDAP_VFREE( toks );
ldap_free_searchprefs( so );
return( LDAP_SEARCHPREF_ERR_SYNTAX );
}
/*
* Search scope is next
*/
- if (( tokcnt = next_line_tokens( bufp, blenp, &toks )) != 1 ) {
- free_strarray( toks );
+ if (( tokcnt = ldap_int_next_line_tokens( bufp, blenp, &toks )) != 1 ) {
+ LDAP_VFREE( toks );
ldap_free_searchprefs( so );
return( LDAP_SEARCHPREF_ERR_SYNTAX );
}
ldap_free_searchprefs( so );
return( LDAP_SEARCHPREF_ERR_SYNTAX );
}
- free_strarray( toks );
+ LDAP_VFREE( toks );
/*
* "More Choices" search option list comes next
*/
sa = &( so->so_salist );
- while (( tokcnt = next_line_tokens( bufp, blenp, &toks )) > 0 ) {
+ while (( tokcnt = ldap_int_next_line_tokens( bufp, blenp, &toks )) > 0 ) {
if ( tokcnt < 5 ) {
- free_strarray( toks );
+ LDAP_VFREE( toks );
ldap_free_searchprefs( so );
return( LDAP_SEARCHPREF_ERR_SYNTAX );
}
if (( *sa = ( struct ldap_searchattr * ) LDAP_CALLOC( 1,
sizeof( struct ldap_searchattr ))) == NULL ) {
- free_strarray( toks );
+ LDAP_VFREE( toks );
ldap_free_searchprefs( so );
return( LDAP_SEARCHPREF_ERR_MEM );
}
* Match types are last
*/
sm = &( so->so_smlist );
- while (( tokcnt = next_line_tokens( bufp, blenp, &toks )) > 0 ) {
+ while (( tokcnt = ldap_int_next_line_tokens( bufp, blenp, &toks )) > 0 ) {
if ( tokcnt < 2 ) {
- free_strarray( toks );
+ LDAP_VFREE( toks );
ldap_free_searchprefs( so );
return( LDAP_SEARCHPREF_ERR_SYNTAX );
}
if (( *sm = ( struct ldap_searchmatch * ) LDAP_CALLOC( 1,
sizeof( struct ldap_searchmatch ))) == NULL ) {
- free_strarray( toks );
+ LDAP_VFREE( toks );
ldap_free_searchprefs( so );
return( LDAP_SEARCHPREF_ERR_MEM );
}
return str;
}
-char *
-(ldap_pvt_strdup)( const char *s )
-{
- char *p;
- size_t len = strlen( s ) + 1;
-
- if ( (p = (char *) malloc( len )) == NULL ) {
- return( NULL );
- }
-
- memcpy( p, s, len );
- return( p );
-}
-
char *
ldap_pvt_str2upper( char *str )
{
return 1;
if ((err = ERR_peek_error())) {
char buf[256];
- ld->ld_error = ldap_strdup(ERR_error_string(err, buf));
+ ld->ld_error = LDAP_STRDUP(ERR_error_string(err, buf));
}
Debug( LDAP_DEBUG_ANY,"TLS: can't connect.\n",0,0,0);
ber_sockbuf_remove_io( sb, &ldap_pvt_sockbuf_io_tls,
if ( err == -1 || err == LDAP_USER_CANCELLED ) {
if ( dns != NULL ) {
- ldap_value_free( dns );
+ LDAP_VFREE( dns );
dns = NULL;
}
return( err );
goto tryagain;
} else {
if ( dns != NULL ) {
- ldap_value_free( dns );
+ LDAP_VFREE( dns );
dns = NULL;
}
return( err );
if ( phase == 1 )
phase++;
if ( dns != NULL ) {
- ldap_value_free( dns );
+ LDAP_VFREE( dns );
dns = NULL;
}
}
attrsonly, res, cancelproc, cancelparm, tag1, tag2, tag3 );
if ( ldap_count_entries( ld, *res ) > 0 ) {
- ldap_value_free( ufncomp );
+ LDAP_VFREE( ufncomp );
return( err );
} else {
ldap_msgfree( *res );
}
if ( ld->ld_ufnprefix == NULL ) {
- ldap_value_free( ufncomp );
+ LDAP_VFREE( ufncomp );
return( err );
}
/* if that failed, or < 2 components, use the prefix */
if ( (prefixcomp = ldap_explode_dn( ld->ld_ufnprefix, 0 )) == NULL ) {
- ldap_value_free( ufncomp );
+ LDAP_VFREE( ufncomp );
return( ld->ld_errno = LDAP_LOCAL_ERROR );
}
for ( pcomp = 0; prefixcomp[pcomp] != NULL; pcomp++ )
; /* NULL */
if ( (pbuf = (char *) LDAP_MALLOC( strlen( ld->ld_ufnprefix ) + 1 ))
== NULL ) {
- ldap_value_free( ufncomp );
- ldap_value_free( prefixcomp );
+ LDAP_VFREE( ufncomp );
+ LDAP_VFREE( prefixcomp );
return( ld->ld_errno = LDAP_NO_MEMORY );
}
}
}
- ldap_value_free( ufncomp );
- ldap_value_free( prefixcomp );
+ LDAP_VFREE( ufncomp );
+ LDAP_VFREE( prefixcomp );
LDAP_FREE( pbuf );
return( err );
Inserts[i] = (char *)malloc( 20 );
itoa( slap_debug, Inserts[i++], 10 );
- Inserts[i++] = ldap_pvt_strdup( configfile );
- Inserts[i++] = ldap_pvt_strdup( urls ? urls : "ldap:///" );
- Inserts[i++] = ldap_pvt_strdup( is_NT_Service ? "svc" : "cmd" );
+ Inserts[i++] = strdup( configfile );
+ Inserts[i++] = strdup( urls ? urls : "ldap:///" );
+ Inserts[i++] = strdup( is_NT_Service ? "svc" : "cmd" );
ReportEvent( hEventLog, EVENTLOG_INFORMATION_TYPE, 0,
MSG_SLAPD_STARTED, NULL, i, 0, (LPCSTR *) Inserts, NULL );
static void at_usage(void) LDAP_GCCATTR((noreturn));
static char *const err2text[] = {
- "Unknown Error",
+ "Success",
"Out of memory",
"ObjectClass not found",
"AttributeType not found",
char *
scherr2str(int code)
{
- if ( code < 1 || code >= (sizeof(err2text)/sizeof(char *)) ) {
- return err2text[0];
+ if ( code < 0 || code >= (sizeof(err2text)/sizeof(char *)) ) {
+ return "Unknown error";
} else {
return err2text[code];
}
static void
oc_usage( void )
{
- fprintf( stderr, "ObjectClassDescription = \"(\" whsp\n");
- fprintf( stderr, " numericoid whsp ; ObjectClass identifier\n");
- fprintf( stderr, " [ \"NAME\" qdescrs ]\n");
- fprintf( stderr, " [ \"DESC\" qdstring ]\n");
- fprintf( stderr, " [ \"OBSOLETE\" whsp ]\n");
- fprintf( stderr, " [ \"SUP\" oids ] ; Superior ObjectClasses\n");
- fprintf( stderr, " [ ( \"ABSTRACT\" / \"STRUCTURAL\" / \"AUXILIARY\" ) whsp ]\n");
- fprintf( stderr, " ; default structural\n");
- fprintf( stderr, " [ \"MUST\" oids ] ; AttributeTypes\n");
- fprintf( stderr, " [ \"MAY\" oids ] ; AttributeTypes\n");
- fprintf( stderr, "whsp \")\"\n");
+ fprintf( stderr,
+ "ObjectClassDescription = \"(\" whsp\n"
+ " numericoid whsp ; ObjectClass identifier\n"
+ " [ \"NAME\" qdescrs ]\n"
+ " [ \"DESC\" qdstring ]\n"
+ " [ \"OBSOLETE\" whsp ]\n"
+ " [ \"SUP\" oids ] ; Superior ObjectClasses\n"
+ " [ ( \"ABSTRACT\" / \"STRUCTURAL\" / \"AUXILIARY\" ) whsp ]\n"
+ " ; default structural\n"
+ " [ \"MUST\" oids ] ; AttributeTypes\n"
+ " [ \"MAY\" oids ] ; AttributeTypes\n"
+ " whsp \")\"\n" );
exit( EXIT_FAILURE );
}
static void
at_usage( void )
{
- fprintf( stderr, "AttributeTypeDescription = \"(\" whsp\n");
- fprintf( stderr, " numericoid whsp ; AttributeType identifier\n");
- fprintf( stderr, " [ \"NAME\" qdescrs ] ; name used in AttributeType\n");
- fprintf( stderr, " [ \"DESC\" qdstring ] ; description\n");
- fprintf( stderr, " [ \"OBSOLETE\" whsp ]\n");
- fprintf( stderr, " [ \"SUP\" woid ] ; derived from this other\n");
- fprintf( stderr, " ; AttributeType\n");
- fprintf( stderr, " [ \"EQUALITY\" woid ] ; Matching Rule name\n");
- fprintf( stderr, " [ \"ORDERING\" woid ] ; Matching Rule name\n");
- fprintf( stderr, " [ \"SUBSTR\" woid ] ; Matching Rule name\n");
- fprintf( stderr, " [ \"SYNTAX\" whsp noidlen whsp ] ; see section 4.3\n");
- fprintf( stderr, " [ \"SINGLE-VALUE\" whsp ] ; default multi-valued\n");
- fprintf( stderr, " [ \"COLLECTIVE\" whsp ] ; default not collective\n");
- fprintf( stderr, " [ \"NO-USER-MODIFICATION\" whsp ]; default user modifiable\n");
- fprintf( stderr, " [ \"USAGE\" whsp AttributeUsage ]; default userApplications\n");
- fprintf( stderr, " ; userApplications\n");
- fprintf( stderr, " ; directoryOperation\n");
- fprintf( stderr, " ; distributedOperation\n");
- fprintf( stderr, " ; dSAOperation\n");
- fprintf( stderr, "whsp \")\"\n");
+ fprintf( stderr,
+ "AttributeTypeDescription = \"(\" whsp\n"
+ " numericoid whsp ; AttributeType identifier\n"
+ " [ \"NAME\" qdescrs ] ; name used in AttributeType\n"
+ " [ \"DESC\" qdstring ] ; description\n"
+ " [ \"OBSOLETE\" whsp ]\n"
+ " [ \"SUP\" woid ] ; derived from this other\n"
+ " ; AttributeType\n"
+ " [ \"EQUALITY\" woid ] ; Matching Rule name\n"
+ " [ \"ORDERING\" woid ] ; Matching Rule name\n"
+ " [ \"SUBSTR\" woid ] ; Matching Rule name\n"
+ " [ \"SYNTAX\" whsp noidlen whsp ] ; see section 4.3\n"
+ " [ \"SINGLE-VALUE\" whsp ] ; default multi-valued\n"
+ " [ \"COLLECTIVE\" whsp ] ; default not collective\n"
+ " [ \"NO-USER-MODIFICATION\" whsp ]; default user modifiable\n"
+ " [ \"USAGE\" whsp AttributeUsage ]; default userApplications\n"
+ " ; userApplications\n"
+ " ; directoryOperation\n"
+ " ; distributedOperation\n"
+ " ; dSAOperation\n"
+ " whsp \")\"\n");
exit( EXIT_FAILURE );
}