forked from zain1337/vely
-
Notifications
You must be signed in to change notification settings - Fork 0
/
stub.c
executable file
·318 lines (297 loc) · 7.75 KB
/
stub.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
// SPDX-License-Identifier: EPL-2.0
// Copyright 2019 DaSoftver LLC. Written by Sergio Mijatovic.
// Licensed under Eclipse Public License - v 2.0. See LICENSE file.
// On the web https://vely.dev/ - this file is part of Vely framework.
//
// Stubs for unused modules
//
#include "vely.h"
#ifdef VV_PCRE2
num vely_regex(char *look_here, char *find_this, char *replace, char **res, num utf8, num case_insensitive, num single_match, regex_t **cached, num *reslen) {
VV_UNUSED(look_here);
VV_UNUSED(find_this);
VV_UNUSED(replace);
VV_UNUSED(res);
VV_UNUSED(utf8);
VV_UNUSED(case_insensitive);
VV_UNUSED(single_match);
VV_UNUSED(cached);
VV_UNUSED(reslen);
return -1;
}
void vely_regfree(regex_t *preg) {
VV_UNUSED(preg);
}
#endif
#ifdef VV_CRYPTO
void vely_sec_load_algos(void) {}
int vely_RAND_bytes(unsigned char *buf, int num) {
VV_UNUSED(buf);
VV_UNUSED(num);
return 0; // failure if used by accident
}
#endif
#ifdef VV_FCGI
void vv_set_fcgi (vv_fc **callin, char *server, char *req_method, char *app_path, char *req, char *url_payload, char *ctype, char *body, int clen, int timeout, char **env) {
VV_UNUSED(callin);
VV_UNUSED(server);
VV_UNUSED(req_method);
VV_UNUSED(app_path);
VV_UNUSED(req);
VV_UNUSED(url_payload);
VV_UNUSED(ctype);
VV_UNUSED(body);
VV_UNUSED(clen);
VV_UNUSED(timeout);
VV_UNUSED(env);
}
void vv_fc_delete (vv_fc *callin) {
VV_UNUSED(callin);
}
num vv_call_fcgi (vv_fc **req, num threads, num *finokay, num *started) {
VV_UNUSED(req);
VV_UNUSED(finokay);
VV_UNUSED(started);
VV_UNUSED(threads);
return 0;
}
#endif
#ifdef VV_CURL
void curl_global_cleanup(void) {}
CURLcode curl_global_init(long flags)
{
VV_UNUSED(flags);
return 0;
}
#endif
#ifdef VV_TREE
num vv_tree_bal (vv_tree_node *tree) { VV_UNUSED(tree); return 1; }
void vv_tree_create_root (vely_tree *res, bool sorted) { VV_UNUSED(res); VV_UNUSED(sorted); }
vely_tree *vv_tree_create(vely_tree_eval ef, char key_type, bool sorted, bool process) { VV_UNUSED(ef); VV_UNUSED(key_type); VV_UNUSED(sorted); VV_UNUSED(process); return NULL;}
void vv_tree_insert_f (vely_tree_cursor *lcurs, vely_tree *orig_tree, char *key, num key_len, void *data) {VV_UNUSED(lcurs);VV_UNUSED(orig_tree);VV_UNUSED(key);VV_UNUSED(key_len);VV_UNUSED(data);}
void vv_tree_search_f (vely_tree_cursor *lcurs, vely_tree *orig_tree, char *key, num key_len) {VV_UNUSED(lcurs);VV_UNUSED(orig_tree);VV_UNUSED(key);VV_UNUSED(key_len);}
void vv_tree_delete_f (vely_tree_cursor *lcurs, vely_tree *orig_tree, char *key, num key_len) {VV_UNUSED(lcurs);VV_UNUSED(orig_tree);VV_UNUSED(key);VV_UNUSED(key_len);}
void vv_tree_search_greater_equal_f (vely_tree_cursor *lcurs, vely_tree *orig_tree, bool equal, char *key, num key_len) {VV_UNUSED(lcurs); VV_UNUSED(orig_tree); VV_UNUSED(equal);VV_UNUSED(key);VV_UNUSED(key_len);}
void vv_tree_search_lesser_equal_f (vely_tree_cursor *lcurs, vely_tree *orig_tree, bool equal, char *key, num key_len) {VV_UNUSED(lcurs); VV_UNUSED(orig_tree); VV_UNUSED(equal); VV_UNUSED(key); VV_UNUSED(key_len);}
void vv_tree_max_f (vely_tree_cursor *lcurs, vely_tree *orig_tree) {VV_UNUSED(lcurs); VV_UNUSED(orig_tree); }
void vv_tree_min_f (vely_tree_cursor *lcurs, vely_tree *orig_tree) {VV_UNUSED(lcurs); VV_UNUSED(orig_tree);}
void vv_tree_purge_f (vely_tree *parent_tree) {VV_UNUSED(parent_tree); }
#endif
#ifdef VV_STUB_GENDB
void vely_check_transaction(num check_mode)
{
VV_UNUSED(check_mode);
}
void vely_end_all_db() {}
#endif
#ifdef VV_STUB_POSTGRES
void vely_pg_close() {}
vely_dbc *vely_pg_connect (num abort_if_bad)
{
VV_UNUSED(abort_if_bad);
return NULL;
}
num vely_pg_exec(char *s, num returns_tuple, char is_prep, void **prep, num paramcount, char **params)
{
VV_UNUSED(s);
VV_UNUSED(returns_tuple);
VV_UNUSED(is_prep);
VV_UNUSED(prep);
VV_UNUSED(paramcount);
VV_UNUSED(params);
return 0;
}
num vely_pg_affected() {return 0;}
num vely_pg_nfield() {return 0;}
char *vely_pg_fieldname(num fnum)
{
VV_UNUSED(fnum);
return NULL;
}
void vely_pg_free() {}
num vely_pg_nrows() {return 0;}
void vely_pg_rows(char ***row, num num_fields, num nrow, unsigned long **lens)
{
VV_UNUSED(row);
VV_UNUSED(num_fields);
VV_UNUSED(nrow);
VV_UNUSED(lens);
}
char *vely_pg_error(char *s)
{
VV_UNUSED(s);
return NULL;
}
char *vely_pg_errm(char *errm, num errmsize, char *s, char *sname, num lnum, char *er)
{
VV_UNUSED(errm);
VV_UNUSED(errmsize);
VV_UNUSED(s);
VV_UNUSED(sname);
VV_UNUSED(lnum);
VV_UNUSED(er);
return NULL;
}
num vely_pg_checkc() { return 0;}
void vely_pg_close_stmt (void *st)
{
VV_UNUSED(st);
}
int vely_pg_escape(char *from, char *to, num *len)
{
VV_UNUSED(from);
VV_UNUSED(to);
VV_UNUSED(len);
return 0;
}
#endif
#ifdef VV_STUB_MARIADB
void vely_maria_close () {}
vely_dbc *vely_maria_connect (num abort_if_bad)
{
VV_UNUSED(abort_if_bad);
return NULL;
}
num vely_maria_exec(char *s, char is_prep, void **prep, num paramcount, char **params)
{
VV_UNUSED(s);
VV_UNUSED(is_prep);
VV_UNUSED(prep);
VV_UNUSED(paramcount);
VV_UNUSED(params);
return 0;
}
num vely_maria_affected(char is_prep)
{
VV_UNUSED(is_prep);
return 0;
}
int vely_maria_use(char is_prep)
{
VV_UNUSED(is_prep);
return 0;
}
int vely_maria_store(char is_prep)
{
VV_UNUSED(is_prep);
return 0;
}
num vely_maria_nfield() {return 0;}
char *vely_maria_fieldname() { return NULL; }
void vely_maria_free() {}
num vely_maria_nrows(char is_prep)
{
VV_UNUSED(is_prep);
return 0;
}
int vely_maria_rows (char ***row, unsigned long **lens, char is_prep)
{
VV_UNUSED(row);
VV_UNUSED(lens);
VV_UNUSED(is_prep);
return 0;
}
char *vely_maria_error(char *s, char is_prep)
{
VV_UNUSED(s);
VV_UNUSED(is_prep);
return NULL;
}
char *vely_maria_errm(char *errm, num errmsize, char *s, char *sname, num lnum, char *er, char is_prep)
{
VV_UNUSED(errm);
VV_UNUSED(errmsize);
VV_UNUSED(s);
VV_UNUSED(sname);
VV_UNUSED(lnum);
VV_UNUSED(er);
VV_UNUSED(is_prep);
return NULL;
}
num vely_maria_checkc() { return 0;}
void vely_maria_close_stmt (void *st)
{
VV_UNUSED(st);
}
int vely_maria_escape(char *from, char *to, num *len)
{
VV_UNUSED(from);
VV_UNUSED(to);
VV_UNUSED(len);
return 0;
}
#endif
#ifdef VV_STUB_SQLITE
void vely_lite_close () {}
vely_dbc *vely_lite_connect (num abort_if_bad)
{
VV_UNUSED(abort_if_bad);
return NULL;
}
num vely_lite_exec(char *s, char is_prep, void **prep, num paramcount, char **params)
{
VV_UNUSED(s);
VV_UNUSED(is_prep);
VV_UNUSED(prep);
VV_UNUSED(paramcount);
VV_UNUSED(params);
return 0;
}
num vely_lite_affected(char is_prep)
{
VV_UNUSED(is_prep);
return 0;
}
int vely_lite_use(char is_prep)
{
VV_UNUSED(is_prep);
return 0;
}
int vely_lite_store(char is_prep)
{
VV_UNUSED(is_prep);
return 0;
}
num vely_lite_nfield() {return 0;}
char *vely_lite_fieldname() { return NULL; }
void vely_lite_free(char is_prep) {VV_UNUSED(is_prep);}
num vely_lite_nrows()
{
return 0;
}
int vely_lite_rows (char ***row, unsigned long **lens)
{
VV_UNUSED(row);
VV_UNUSED(lens);
return 0;
}
char *vely_lite_error(char *s, char is_prep)
{
VV_UNUSED(s);
VV_UNUSED(is_prep);
return NULL;
}
char *vely_lite_errm(char *errm, num errmsize, char *s, char *sname, num lnum, char *er, char is_prep)
{
VV_UNUSED(errm);
VV_UNUSED(errmsize);
VV_UNUSED(s);
VV_UNUSED(sname);
VV_UNUSED(lnum);
VV_UNUSED(er);
VV_UNUSED(is_prep);
return NULL;
}
num vely_lite_checkc() { return 0;}
void vely_lite_close_stmt (void *st)
{
VV_UNUSED(st);
}
int vely_lite_escape(char *from, char *to, num *len)
{
VV_UNUSED(from);
VV_UNUSED(to);
VV_UNUSED(len);
return 0;
}
#endif