Lines Matching refs:context
31 static void minmaxFunc(sqlite_func *context, int argc, const char **argv){ in minmaxFunc() argument
38 mask = (int)sqlite_user_data(context); in minmaxFunc()
52 sqlite_set_result_string(context, zBest, -1); in minmaxFunc()
58 static void typeofFunc(sqlite_func *context, int argc, const char **argv){ in typeofFunc() argument
60 sqlite_set_result_string(context, argv[1], -1); in typeofFunc()
66 static void lengthFunc(sqlite_func *context, int argc, const char **argv){ in lengthFunc() argument
78 sqlite_set_result_int(context, len); in lengthFunc()
84 static void absFunc(sqlite_func *context, int argc, const char **argv){ in absFunc() argument
90 sqlite_set_result_string(context, z, -1); in absFunc()
96 static void substrFunc(sqlite_func *context, int argc, const char **argv){ in substrFunc() argument
136 sqlite_set_result_string(context, &z[p1], p2); in substrFunc()
142 static void roundFunc(sqlite_func *context, int argc, const char **argv){ in roundFunc() argument
153 sqlite_set_result_string(context, zBuf, -1); in roundFunc()
159 static void upperFunc(sqlite_func *context, int argc, const char **argv){ in upperFunc() argument
163 z = (unsigned char*)sqlite_set_result_string(context, argv[0], -1); in upperFunc()
169 static void lowerFunc(sqlite_func *context, int argc, const char **argv){ in lowerFunc() argument
173 z = (unsigned char*)sqlite_set_result_string(context, argv[0], -1); in lowerFunc()
185 static void ifnullFunc(sqlite_func *context, int argc, const char **argv){ in ifnullFunc() argument
189 sqlite_set_result_string(context, argv[i], -1); in ifnullFunc()
198 static void randomFunc(sqlite_func *context, int argc, const char **argv){ in randomFunc() argument
201 sqlite_set_result_int(context, r); in randomFunc()
208 static void last_insert_rowid(sqlite_func *context, int arg, const char **argv){ in last_insert_rowid() argument
209 sqlite *db = sqlite_user_data(context); in last_insert_rowid()
210 sqlite_set_result_int(context, sqlite_last_insert_rowid(db)); in last_insert_rowid()
217 static void change_count(sqlite_func *context, int arg, const char **argv){ in change_count() argument
218 sqlite *db = sqlite_user_data(context); in change_count()
219 sqlite_set_result_int(context, sqlite_changes(db)); in change_count()
226 static void last_statement_change_count(sqlite_func *context, int arg, in last_statement_change_count() argument
228 sqlite *db = sqlite_user_data(context); in last_statement_change_count()
229 sqlite_set_result_int(context, sqlite_last_statement_changes(db)); in last_statement_change_count()
241 static void likeFunc(sqlite_func *context, int arg, const char **argv){ in likeFunc() argument
243 sqlite_set_result_int(context, in likeFunc()
257 static void globFunc(sqlite_func *context, int arg, const char **argv){ in globFunc() argument
259 sqlite_set_result_int(context, in globFunc()
269 static void nullifFunc(sqlite_func *context, int argc, const char **argv){ in nullifFunc() argument
271 sqlite_set_result_string(context, argv[0], -1); in nullifFunc()
279 static void versionFunc(sqlite_func *context, int argc, const char **argv){ in versionFunc() argument
280 sqlite_set_result_string(context, sqlite_version, -1); in versionFunc()
294 static void quoteFunc(sqlite_func *context, int argc, const char **argv){ in quoteFunc() argument
297 sqlite_set_result_string(context, "NULL", 4); in quoteFunc()
299 sqlite_set_result_string(context, argv[0], -1); in quoteFunc()
315 sqlite_set_result_string(context, z, j); in quoteFunc()
324 static void soundexFunc(sqlite_func *context, int argc, const char **argv){ in soundexFunc() argument
353 sqlite_set_result_string(context, zResult, 4); in soundexFunc()
355 sqlite_set_result_string(context, "?000", 4); in soundexFunc()
365 static void randStr(sqlite_func *context, int argc, const char **argv){ in randStr() argument
399 sqlite_set_result_string(context, zBuf, n); in randStr()
416 static void sumStep(sqlite_func *context, int argc, const char **argv){ in sumStep() argument
419 p = sqlite_aggregate_context(context, sizeof(*p)); in sumStep()
425 static void sumFinalize(sqlite_func *context){ in sumFinalize() argument
427 p = sqlite_aggregate_context(context, sizeof(*p)); in sumFinalize()
428 sqlite_set_result_double(context, p ? p->sum : 0.0); in sumFinalize()
430 static void avgFinalize(sqlite_func *context){ in avgFinalize() argument
432 p = sqlite_aggregate_context(context, sizeof(*p)); in avgFinalize()
434 sqlite_set_result_double(context, p->sum/(double)p->cnt); in avgFinalize()
453 static void stdDevStep(sqlite_func *context, int argc, const char **argv){
457 p = sqlite_aggregate_context(context, sizeof(*p));
465 static void stdDevFinalize(sqlite_func *context){
466 double rN = sqlite_aggregate_count(context);
467 StdDevCtx *p = sqlite_aggregate_context(context, sizeof(*p));
470 sqlite_set_result_double(context,
488 static void countStep(sqlite_func *context, int argc, const char **argv){ in countStep() argument
490 p = sqlite_aggregate_context(context, sizeof(*p)); in countStep()
495 static void countFinalize(sqlite_func *context){ in countFinalize() argument
497 p = sqlite_aggregate_context(context, sizeof(*p)); in countFinalize()
498 sqlite_set_result_int(context, p ? p->n : 0); in countFinalize()
514 static void minmaxStep(sqlite_func *context, int argc, const char **argv){ in minmaxStep() argument
526 mask = (int)sqlite_user_data(context); in minmaxStep()
528 p = sqlite_aggregate_context(context, sizeof(*p)); in minmaxStep()
547 static void minMaxFinalize(sqlite_func *context){ in minMaxFinalize() argument
549 p = sqlite_aggregate_context(context, sizeof(*p)); in minMaxFinalize()
551 sqlite_set_result_string(context, p->z, strlen(p->z)); in minMaxFinalize()