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_CONCAT
19 struct berval * backsql_strcat( struct berval *dest, ber_len_t *buflen, ... );
20 struct berval * backsql_strfcat( struct berval *dest, ber_len_t *buflen,
21 const char *fmt, ... );
23 int backsql_entry_addattr( Entry *e, struct berval *at_name,
24 struct berval *at_val, void *memctx );
26 typedef struct backsql_srch_info {
27 struct berval *base_dn;
32 backsql_entryID *id_list, *c_eid;
36 backsql_oc_map_rec *oc;
37 struct berval sel, from, join_where, flt_where;
38 ber_len_t sel_len, from_len, jwhere_len, fwhere_len;
44 #define BSQL_SF_ALL_OPER 0x0001
45 #define BSQL_SF_FILTER_HASSUBORDINATE 0x0002
47 /* 1 if the db is TimesTen; 0 if it's not */
51 void backsql_init_search( backsql_srch_info *bsi,
52 struct berval *nbase, int scope, int slimit, int tlimit,
53 time_t stoptime, Filter *filter, SQLHDBC dbh,
54 Operation *op, AttributeName *attrs );
55 Entry *backsql_id2entry( backsql_srch_info *bsi, Entry *e,
56 backsql_entryID *id );
59 backsql_def_oc_query[],
60 backsql_def_needs_select_oc_query[],
61 backsql_def_at_query[],
62 backsql_def_delentry_query[],
63 backsql_def_insentry_query[],
64 backsql_def_subtree_cond[],
65 backsql_def_upper_subtree_cond[],
67 backsql_def_concat_func[];
69 backsql_check_dn_ru_query[];
71 int backsql_merge_from_clause( struct berval *dest_from, ber_len_t *dest_len,
72 struct berval *src_from );
74 int backsql_split_pattern( const char *pattern, BerVarray *split_pattern,
76 int backsql_prepare_pattern( BerVarray split_pattern, BerVarray values,
79 #endif /* __BACKSQL_UTIL_H__ */