]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/schemaparse.c
Added connection initialisation and destruction notification. Now backends can regist...
[openldap] / servers / slapd / schemaparse.c
index 83865d488bf30e197cc93926df4f20f6fdc3e576..4e4ea442168d9b0fd9a7a79ac348b772cc5d86e6 100644 (file)
 #include "slap.h"
 #include "ldap_schema.h"
 
-ObjectClass            *global_oc;
 static Avlnode         *object_classes = NULL;
 
-AttributeType          *global_at;
 int    global_schemacheck = 1; /* schemacheck on is default */
 
 static void            oc_usage_old(void);
@@ -25,7 +23,14 @@ static char *err2text[] = {
        "Objectclass not found",
        "Attribute type not found",
        "Duplicate objectclass",
-       "Duplicate attributetype"
+       "Duplicate attributetype",
+       "Duplicate syntax",
+       "Duplicate matchingrule",
+       "OID or name required",
+       "Syntax or superior required",
+       "Matchingrule not found",
+       "Syntax not found",
+       "Syntax required"
 };
 
 char *
@@ -51,13 +56,16 @@ parse_oc_old(
        char            last;
        LDAP_OBJECT_CLASS       *oc;
        int             code;
-       char            *err;
+       const char      *err;
        char            **namep;
 
        oc = (LDAP_OBJECT_CLASS *) ch_calloc( 1, sizeof(LDAP_OBJECT_CLASS) );
        oc->oc_names = ch_calloc( 2, sizeof(char *) );
        oc->oc_names[0] = ch_strdup( argv[1] );
        oc->oc_names[1] = NULL;
+       if ( strcasecmp( oc->oc_names[0], "top" ) ) {
+               oc->oc_kind = LDAP_SCHEMA_STRUCTURAL;
+       }
        for ( i = 2; i < argc; i++ ) {
                /* required attributes */
                if ( strcasecmp( argv[i], "requires" ) == 0 ) {
@@ -141,7 +149,7 @@ parse_oc(
 {
        LDAP_OBJECT_CLASS *oc;
        int             code;
-       char            *err;
+       const char      *err;
 
        oc = ldap_str2objectclass(line,&code,&err);
        if ( !oc ) {
@@ -219,7 +227,7 @@ parse_at(
 {
        LDAP_ATTRIBUTE_TYPE *at;
        int             code;
-       char            *err;
+       const char      *err;
 
        at = ldap_str2attributetype(line,&code,&err);
        if ( !at ) {