]> git.sur5r.net Git - openldap/blob - include/ldap_schema.h
Initial incomplete and broken version.
[openldap] / include / ldap_schema.h
1 /*
2  * Copyright 1999 The OpenLDAP Foundation, Redwood City, California, USA
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms are permitted only
6  * as authorized by the OpenLDAP Public License.  A copy of this
7  * license is available at http://www.OpenLDAP.org/license.html or
8  * in file LICENSE in the top-level directory of the distribution.
9  */
10 /*
11  * ldap-schema.h - Header for basic schema handling functions that can be
12  *              used by both clients and servers.
13  */
14
15 #ifndef _LDAP_SCHEMA_H
16 #define _LDAP_SCHEMA_H 1
17
18 #include <ldap_cdefs.h>
19
20 LDAP_BEGIN_DECL
21
22 /* Codes for parsing errors */
23
24 #define SCHEMA_ERR_OUTOFMEM             1
25 #define SCHEMA_ERR_UNEXPTOKEN           2
26 #define SCHEMA_ERR_NOLEFTPAREN          3
27 #define SCHEMA_ERR_NORIGHTPAREN         4
28 #define SCHEMA_ERR_NODIGIT              5
29 #define SCHEMA_ERR_BADNAME              6
30 #define SCHEMA_ERR_BADDESC              7
31 #define SCHEMA_ERR_BADSUP               8
32 #define SCHEMA_ERR_DUPOPT               9
33
34 typedef struct ldap_attributetype {
35         char *at_oid;           /* REQUIRED */
36         char **at_names;        /* OPTIONAL */
37         char *at_desc;          /* OPTIONAL */
38         int  at_obsolete;       /* 0=no, 1=yes */
39         char *at_sup_oid;       /* OPTIONAL */
40         char *at_equality_oid;  /* OPTIONAL */
41         char *at_ordering_oid;  /* OPTIONAL */
42         char *at_substr_oid;    /* OPTIONAL */
43         char *at_syntax_oid;    /* OPTIONAL */
44         int  at_syntax_len;     /* OPTIONAL */
45         int  at_single_value;   /* 0=no, 1=yes */
46         int  at_collective;     /* 0=no, 1=yes */
47         int  at_no_user_mod;    /* 0=no, 1=yes */
48         int  at_usage;          /* 0=userApplications, 1=directoryOperation,
49                                    2=distributedOperation, 3=dSAOperation */
50 } LDAP_ATTRIBUTE_TYPE;
51
52 typedef struct ldap_objectclass {
53         char *oc_oid;           /* REQUIRED */
54         char **oc_names;        /* OPTIONAL */
55         char *oc_desc;          /* OPTIONAL */
56         int  oc_obsolete;       /* 0=no, 1=yes */
57         char **oc_sup_oids;     /* OPTIONAL */
58         int  oc_kind;           /* 0=ABSTRACT, 1=STRUCTURAL, 2=AUXILIARY */
59         char **oc_at_oids_must; /* OPTIONAL */
60         char **oc_at_oids_may;  /* MAY */
61 } LDAP_OBJECT_CLASS;
62
63 LDAP_F(LDAP_OBJECT_CLASS *) ldap_str2objectclass LDAP_P(( char * s, int * code, char ** errp ));
64 LDAP_F(LDAP_ATTRIBUTE_TYPE) ldap_str2attributetype LDAP_P(( char * sval, char ** errp ));
65 LDAP_F( char *) ldap_objectclass2str LDAP_P(( LDAP_OBJECT_CLASS * oc ));
66 LDAP_F( char *) ldap_attributetype2str LDAP_P(( LDAP_ATTRIBUTE_TYPE * at ));
67
68 LDAP_END_DECL
69
70 #endif
71