1 #ifndef __BACKSQL_UTIL_H__
2 #define __BACKSQL_UTIL_H__
5 * Copyright 1999, Dmitry Kovalev <mit@openldap.org>, All rights reserved.
7 * Redistribution and use in source and binary forms are permitted only
8 * as authorized by the OpenLDAP Public License. A copy of this
9 * license is available at http://www.OpenLDAP.org/license.html or
10 * in file LICENSE in the top-level directory of the distribution.
15 #include "schema-map.h"
17 #define BACKSQL_MAX(a,b) ((a)>(b)?(a):(b))
18 #define BACKSQL_MIN(a,b) ((a)<(b)?(a):(b))
20 #define BACKSQL_STR_GROW 64
26 struct berval *backsql_strcat( struct berval *dest, int *buflen, ... );
28 int backsql_entry_addattr( Entry *e, struct berval *at_name,
29 struct berval *at_val );
31 typedef struct __backsql_srch_info {
32 struct berval *base_dn;
37 backsql_entryID *id_list, *c_eid;
41 backsql_oc_map_rec *oc;
42 struct berval sel, from, join_where, flt_where;
43 int sel_len, from_len, jwhere_len, fwhere_len;
51 /* 1 if the db is TimesTen; 0 if it's not */
55 int backsql_process_filter( backsql_srch_info *bsi, Filter *f );
56 void backsql_init_search( backsql_srch_info *bsi, backsql_info *bi,
57 struct berval *nbase, int scope, int slimit, int tlimit,
58 time_t stoptime, Filter *filter, SQLHDBC dbh,
59 BackendDB *be, Connection *conn, Operation *op,
60 AttributeName *attrs );
61 Entry *backsql_id2entry( backsql_srch_info *bsi, Entry *e,
62 backsql_entryID *id );
65 backsql_def_oc_query[],
66 backsql_def_at_query[],
67 backsql_def_delentry_query[],
68 backsql_def_insentry_query[],
69 backsql_def_subtree_cond[],
70 backsql_def_upper_subtree_cond[],
73 backsql_check_dn_ru_query[];
75 int backsql_merge_from_clause( char **dest_from, int *dest_len,
79 #endif /* __BACKSQL_UTIL_H__ */