]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-sql/schema-map.h
remove dnNormalize2
[openldap] / servers / slapd / back-sql / schema-map.h
index 7747f59b9442a692277179a4d93b72bffb11937d..5467523fad8bd2ec28b249ce1d522788ab019c4d 100644 (file)
  *      in file LICENSE in the top-level directory of the distribution.
  */
 
-
 typedef struct {
-       char            *name;
-       char            *keytbl;
-       char            *keycol;
+       /*
+        * Structure of corresponding LDAP objectClass definition
+        */
+       ObjectClass     *oc;
+#define BACKSQL_OC_NAME(ocmap) ((ocmap)->oc->soc_cname.bv_val)
+       
+       struct berval   keytbl;
+       struct berval   keycol;
        /* expected to return keyval of newly created entry */
        char            *create_proc;
+       /* in case create_proc does not return the keyval of the newly
+        * created row */
+       char            *create_keyval;
        /* supposed to expect keyval as parameter and delete 
         * all the attributes as well */
        char            *delete_proc;
@@ -28,11 +35,11 @@ typedef struct {
 } backsql_oc_map_rec;
 
 typedef struct {
-       /* literal name of corresponding LDAP attribute type */
-       char            *name;
-       char            *from_tbls;
-       char            *join_where;
-       char            *sel_expr;
+       /* Description of corresponding LDAP attribute type */
+       AttributeDescription    *ad;
+       struct berval   from_tbls;
+       struct berval   join_where;
+       struct berval   sel_expr;
        /* supposed to expect 2 binded values: entry keyval 
         * and attr. value to add, like "add_name(?,?,?)" */
        char            *add_proc;
@@ -43,7 +50,7 @@ typedef struct {
         * is preconstructed from parts on schemamap load time */
        char            *query;
        /* following flags are bitmasks (first bit used for add_proc, 
-        * second - for modify, third - for delete_proc) */
+        * second - for delete_proc) */
        /* order of parameters for procedures above; 
         * 1 means "data then keyval", 0 means "keyval then data" */
        int             param_order;
@@ -52,18 +59,28 @@ typedef struct {
         * for return code) */
        int             expect_return;
        /* TimesTen */
-       char            *sel_expr_u;
+       struct berval   sel_expr_u;
 } backsql_at_map_rec;
 
 /* defines to support bitmasks above */
-#define BACKSQL_ADD    1
-#define BACKSQL_DEL    2
+#define BACKSQL_ADD    0x1
+#define BACKSQL_DEL    0x2
+
+#define BACKSQL_IS_ADD(x)      ( BACKSQL_ADD & (x) )
+#define BACKSQL_IS_DEL(x)      ( BACKSQL_DEL & (x) )
+
+#define BACKSQL_NCMP(v1,v2)    ber_bvcmp((v1),(v2))
 
 int backsql_load_schema_map( backsql_info *si, SQLHDBC dbh );
-backsql_oc_map_rec *backsql_oc_with_name( backsql_info *si, char *objclass );
-backsql_oc_map_rec *backsql_oc_with_id( backsql_info *si, unsigned long id );
-backsql_at_map_rec *backsql_at_with_name( backsql_oc_map_rec *objclass,
-               char *attr );
+/* Deprecated */
+backsql_oc_map_rec *backsql_name2oc( backsql_info *si, struct berval *oc_name );
+backsql_oc_map_rec *backsql_oc2oc( backsql_info *si, ObjectClass *oc );
+backsql_oc_map_rec *backsql_id2oc( backsql_info *si, unsigned long id );
+/* Deprecated */
+backsql_at_map_rec *backsql_name2at( backsql_oc_map_rec *objclass,
+               struct berval *at_name );
+backsql_at_map_rec *backsql_ad2at( backsql_oc_map_rec *objclass,
+               AttributeDescription *ad );
 int backsql_destroy_schema_map( backsql_info *si );
 
 #endif /* __BACKSQL_SCHEMA_MAP_H__ */