#include <ldap_schema.h>
-static LDAP_CONST char *
-choose_name( char *names[], LDAP_CONST char *fallback )
+static const char *
+choose_name( char *names[], const char *fallback )
{
return( (names != NULL && names[0] != NULL) ? names[0] : fallback );
}
}
char *
-ldap_syntax2str( const LDAPSyntax * syn )
+ldap_syntax2str( LDAPSyntax * syn )
{
safe_string * ss;
char * retstring;
}
char *
-ldap_matchingrule2str( const LDAPMatchingRule * mr )
+ldap_matchingrule2str( LDAPMatchingRule * mr )
{
safe_string * ss;
char * retstring;
}
char *
-ldap_matchingruleuse2str( const LDAPMatchingRuleUse * mru )
+ldap_matchingruleuse2str( LDAPMatchingRuleUse * mru )
{
safe_string * ss;
char * retstring;
}
char *
-ldap_objectclass2str( const LDAPObjectClass * oc )
+ldap_objectclass2str( LDAPObjectClass * oc )
{
safe_string * ss;
char * retstring;
}
char *
-ldap_attributetype2str( const LDAPAttributeType * at )
+ldap_attributetype2str( LDAPAttributeType * at )
{
safe_string * ss;
char * retstring;
};
static int
-get_token(const char ** sp, char ** token_val)
+get_token( const char ** sp, char ** token_val )
{
int kind;
const char * p;
*/
/* Parse a sequence of dot-separated decimal strings */
-static char *
+char *
parse_numericoid(const char **sp, int *code, const int flags)
{
char * res;
}
LDAPSyntax *
-ldap_str2syntax( const char * s, int * code, const char ** errp, const int flags )
+ldap_str2syntax( LDAP_CONST char * s,
+ int * code,
+ LDAP_CONST char ** errp,
+ LDAP_CONST int flags )
{
int kind;
const char * ss = s;
}
LDAPMatchingRule *
-ldap_str2matchingrule( const char * s, int * code, const char ** errp, const int flags )
+ldap_str2matchingrule( LDAP_CONST char * s,
+ int * code,
+ LDAP_CONST char ** errp,
+ LDAP_CONST int flags )
{
int kind;
const char * ss = s;
}
LDAPMatchingRuleUse *
-ldap_str2matchingruleuse( const char * s, int * code, const char ** errp, const int flags )
+ldap_str2matchingruleuse( LDAP_CONST char * s,
+ int * code,
+ LDAP_CONST char ** errp,
+ LDAP_CONST int flags )
{
int kind;
const char * ss = s;
}
LDAPAttributeType *
-ldap_str2attributetype( const char * s, int * code, const char ** errp, const int flags )
+ldap_str2attributetype( LDAP_CONST char * s,
+ int * code,
+ LDAP_CONST char ** errp,
+ LDAP_CONST int flags )
{
int kind;
const char * ss = s;
savepos = ss;
at->at_oid = parse_numericoid(&ss,code,0);
if ( !at->at_oid ) {
- if ( flags & ( LDAP_SCHEMA_ALLOW_NO_OID
- | LDAP_SCHEMA_ALLOW_OID_MACRO ) ) {
+ if ( ( flags & ( LDAP_SCHEMA_ALLOW_NO_OID
+ | LDAP_SCHEMA_ALLOW_OID_MACRO ) )
+ && (ss == savepos) ) {
/* Backtracking */
ss = savepos;
kind = get_token(&ss,&sval);
}
LDAPObjectClass *
-ldap_str2objectclass( const char * s, int * code, const char ** errp, const int flags )
+ldap_str2objectclass( LDAP_CONST char * s,
+ int * code,
+ LDAP_CONST char ** errp,
+ LDAP_CONST int flags )
{
int kind;
const char * ss = s;
savepos = ss;
oc->oc_oid = parse_numericoid(&ss,code,0);
if ( !oc->oc_oid ) {
- if ( flags & LDAP_SCHEMA_ALLOW_ALL ) {
+ if ( (flags & LDAP_SCHEMA_ALLOW_ALL) && (ss == savepos) ) {
/* Backtracking */
ss = savepos;
kind = get_token(&ss,&sval);