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 typedef struct berbuf {
23 #define BB_NULL { { 0, NULL }, 0 }
25 struct berbuf * backsql_strcat( struct berbuf *dest, ... );
26 struct berbuf * backsql_strfcat( struct berbuf *dest, const char *fmt, ... );
28 int backsql_entry_addattr( Entry *e, struct berval *at_name,
29 struct berval *at_val, void *memctx );
31 typedef struct backsql_srch_info {
35 #define BSQL_SF_ALL_OPER 0x0001
36 #define BSQL_SF_FILTER_HASSUBORDINATE 0x0002
38 struct berval *base_dn;
44 backsql_entryID *id_list, *c_eid;
49 backsql_oc_map_rec *oc;
50 struct berbuf sel, from, join_where, flt_where;
57 void backsql_init_search( backsql_srch_info *bsi,
58 struct berval *nbase, int scope, int slimit, int tlimit,
59 time_t stoptime, Filter *filter, SQLHDBC dbh,
60 Operation *op, AttributeName *attrs );
61 Entry *backsql_id2entry( backsql_srch_info *bsi, Entry *e,
62 backsql_entryID *id );
65 backsql_def_oc_query[],
66 backsql_def_needs_select_oc_query[],
67 backsql_def_at_query[],
68 backsql_def_delentry_query[],
69 backsql_def_insentry_query[],
70 backsql_def_subtree_cond[],
71 backsql_def_upper_subtree_cond[],
73 backsql_def_concat_func[];
75 backsql_check_dn_ru_query[];
77 int backsql_merge_from_clause( struct berbuf *dest_from,
78 struct berval *src_from );
80 int backsql_split_pattern( const char *pattern, BerVarray *split_pattern,
82 int backsql_prepare_pattern( BerVarray split_pattern, BerVarray values,
85 #endif /* __BACKSQL_UTIL_H__ */