-#ifndef __BACKSQL_SCHEMA_MAP_H__
-#define __BACKSQL_SCHEMA_MAP_H__
-
-/*
- * Copyright 1999, Dmitry Kovalev <mit@openldap.org>, All rights reserved.
+/* $OpenLDAP$ */
+/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
+ *
+ * Copyright 1999-2003 The OpenLDAP Foundation.
+ * Portions Copyright 1999 Dmitry Kovalev.
+ * All rights reserved.
*
- * Redistribution and use in source and binary forms are permitted only
- * as authorized by the OpenLDAP Public License. A copy of this
- * license is available at http://www.OpenLDAP.org/license.html or
- * in file LICENSE in the top-level directory of the distribution.
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted only as authorized by the OpenLDAP
+ * Public License.
+ *
+ * A copy of this license is available in the file LICENSE in the
+ * top-level directory of the distribution or, alternatively, at
+ * <http://www.OpenLDAP.org/license.html>.
+ */
+/* ACKNOWLEDGEMENTS:
+ * This work was initially developed by Dmitry Kovalev for inclusion
+ * by OpenLDAP Software.
*/
+#ifndef __BACKSQL_SCHEMA_MAP_H__
+#define __BACKSQL_SCHEMA_MAP_H__
typedef struct {
- struct berval name;
+ /*
+ * Structure of corresponding LDAP objectClass definition
+ */
ObjectClass *oc;
- char *keytbl;
- char *keycol;
+#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;
} backsql_oc_map_rec;
typedef struct {
- /* literal name of corresponding LDAP attribute type */
- struct berval name;
+ /* Description of corresponding LDAP attribute type */
AttributeDescription *ad;
- char *from_tbls;
- char *join_where;
- char *sel_expr;
+ 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;
* 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;
* 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 */