Go to the source code of this file.
Classes | |
struct | compareInfo |
struct | SumCtx |
struct | CountCtx |
Defines | |
#define | GlogUpperToLower(A) if( A<0x80 ){ A = sqlite3UpperToLower[A]; } |
Typedefs | |
typedef struct SumCtx | SumCtx |
typedef struct CountCtx | CountCtx |
Functions | |
static CollSeq * | sqlite3GetFuncCollSeq (sqlite3_context *context) |
static void | minmaxFunc (sqlite3_context *context, int argc, sqlite3_value **argv) |
static void | typeofFunc (sqlite3_context *context, int argc, sqlite3_value **argv) |
static void | lengthFunc (sqlite3_context *context, int argc, sqlite3_value **argv) |
static void | absFunc (sqlite3_context *context, int argc, sqlite3_value **argv) |
static void | substrFunc (sqlite3_context *context, int argc, sqlite3_value **argv) |
static void | roundFunc (sqlite3_context *context, int argc, sqlite3_value **argv) |
static void * | contextMalloc (sqlite3_context *context, i64 nByte) |
static void | upperFunc (sqlite3_context *context, int argc, sqlite3_value **argv) |
static void | lowerFunc (sqlite3_context *context, int argc, sqlite3_value **argv) |
static void | ifnullFunc (sqlite3_context *context, int argc, sqlite3_value **argv) |
static void | randomFunc (sqlite3_context *context, int argc, sqlite3_value **argv) |
static void | randomBlob (sqlite3_context *context, int argc, sqlite3_value **argv) |
static void | last_insert_rowid (sqlite3_context *context, int arg, sqlite3_value **argv) |
static void | changes (sqlite3_context *context, int arg, sqlite3_value **argv) |
static void | total_changes (sqlite3_context *context, int arg, sqlite3_value **argv) |
static int | patternCompare (const u8 *zPattern, const u8 *zString, const struct compareInfo *pInfo, const int esc) |
static void | likeFunc (sqlite3_context *context, int argc, sqlite3_value **argv) |
static void | nullifFunc (sqlite3_context *context, int argc, sqlite3_value **argv) |
static void | versionFunc (sqlite3_context *context, int argc, sqlite3_value **argv) |
static void | quoteFunc (sqlite3_context *context, int argc, sqlite3_value **argv) |
static void | hexFunc (sqlite3_context *context, int argc, sqlite3_value **argv) |
static void | zeroblobFunc (sqlite3_context *context, int argc, sqlite3_value **argv) |
static void | replaceFunc (sqlite3_context *context, int argc, sqlite3_value **argv) |
static void | trimFunc (sqlite3_context *context, int argc, sqlite3_value **argv) |
static void | loadExt (sqlite3_context *context, int argc, sqlite3_value **argv) |
static void | sumStep (sqlite3_context *context, int argc, sqlite3_value **argv) |
static void | sumFinalize (sqlite3_context *context) |
static void | avgFinalize (sqlite3_context *context) |
static void | totalFinalize (sqlite3_context *context) |
static void | countStep (sqlite3_context *context, int argc, sqlite3_value **argv) |
static void | countFinalize (sqlite3_context *context) |
static void | minmaxStep (sqlite3_context *context, int argc, sqlite3_value **argv) |
static void | minMaxFinalize (sqlite3_context *context) |
static void | groupConcatStep (sqlite3_context *context, int argc, sqlite3_value **argv) |
static void | groupConcatFinalize (sqlite3_context *context) |
void | sqlite3RegisterBuiltinFunctions (sqlite3 *db) |
static void | setLikeOptFlag (sqlite3 *db, const char *zName, int flagVal) |
void | sqlite3RegisterLikeFunctions (sqlite3 *db, int caseSensitive) |
int | sqlite3IsLikeFunction (sqlite3 *db, Expr *pExpr, int *pIsNocase, char *aWc) |
void | sqlite3RegisterGlobalFunctions (void) |
Variables | |
static struct compareInfo | globInfo = { '*', '?', '[', 0 } |
static struct compareInfo | likeInfoNorm = { '%', '_', 0, 1 } |
static struct compareInfo | likeInfoAlt = { '%', '_', 0, 0 } |
static const char | hexdigits [] |
#define GlogUpperToLower | ( | A | ) | if( A<0x80 ){ A = sqlite3UpperToLower[A]; } |
Definition at line 419 of file func.c.
Referenced by patternCompare().
static void absFunc | ( | sqlite3_context * | context, | |
int | argc, | |||
sqlite3_value ** | argv | |||
) | [static] |
Definition at line 122 of file func.c.
References sqlite3_result_double(), sqlite3_result_error(), sqlite3_result_int64(), sqlite3_result_null(), sqlite3_value_double(), sqlite3_value_int64(), sqlite3_value_type(), SQLITE_INTEGER, and SQLITE_NULL.
Referenced by sqlite3RegisterGlobalFunctions().
static void avgFinalize | ( | sqlite3_context * | context | ) | [static] |
Definition at line 1077 of file func.c.
References SumCtx::cnt, SumCtx::rSum, sqlite3_aggregate_context(), and sqlite3_result_double().
Referenced by sqlite3RegisterGlobalFunctions().
static void changes | ( | sqlite3_context * | context, | |
int | arg, | |||
sqlite3_value ** | argv | |||
) | [static] |
Definition at line 377 of file func.c.
References db, sqlite3_changes(), sqlite3_context_db_handle(), and sqlite3_result_int().
Referenced by sqlite3RegisterGlobalFunctions().
static void* contextMalloc | ( | sqlite3_context * | context, | |
i64 | nByte | |||
) | [static] |
Definition at line 245 of file func.c.
References sqlite3_context_db_handle(), sqlite3_result_error_nomem(), sqlite3_result_error_toobig(), sqlite3Malloc(), and SQLITE_LIMIT_LENGTH.
Referenced by hexFunc(), lowerFunc(), quoteFunc(), randomBlob(), replaceFunc(), trimFunc(), and upperFunc().
static void countFinalize | ( | sqlite3_context * | context | ) | [static] |
Definition at line 1109 of file func.c.
References CountCtx::n, sqlite3_aggregate_context(), and sqlite3_result_int64().
Referenced by sqlite3RegisterGlobalFunctions().
static void countStep | ( | sqlite3_context * | context, | |
int | argc, | |||
sqlite3_value ** | argv | |||
) | [static] |
Definition at line 1102 of file func.c.
References CountCtx::n, sqlite3_aggregate_context(), sqlite3_value_type(), and SQLITE_NULL.
Referenced by sqlite3RegisterGlobalFunctions().
static void groupConcatFinalize | ( | sqlite3_context * | context | ) | [static] |
Definition at line 1196 of file func.c.
References StrAccum::mallocFailed, sqlite3_aggregate_context(), sqlite3_free(), sqlite3_result_error_nomem(), sqlite3_result_error_toobig(), sqlite3_result_text(), sqlite3StrAccumFinish(), and StrAccum::tooBig.
Referenced by sqlite3RegisterGlobalFunctions().
static void groupConcatStep | ( | sqlite3_context * | context, | |
int | argc, | |||
sqlite3_value ** | argv | |||
) | [static] |
Definition at line 1161 of file func.c.
References sqlite3::aLimit, db, StrAccum::mxAlloc, StrAccum::nChar, sqlite3_aggregate_context(), sqlite3_context_db_handle(), sqlite3_value_bytes(), sqlite3_value_text(), sqlite3_value_type(), sqlite3StrAccumAppend(), SQLITE_LIMIT_LENGTH, SQLITE_NULL, and StrAccum::useMalloc.
Referenced by sqlite3RegisterGlobalFunctions().
static void hexFunc | ( | sqlite3_context * | context, | |
int | argc, | |||
sqlite3_value ** | argv | |||
) | [static] |
Definition at line 741 of file func.c.
References contextMalloc(), hexdigits, sqlite3_free(), sqlite3_result_text(), sqlite3_value_blob(), and sqlite3_value_bytes().
Referenced by sqlite3RegisterGlobalFunctions().
static void ifnullFunc | ( | sqlite3_context * | context, | |
int | argc, | |||
sqlite3_value ** | argv | |||
) | [static] |
Definition at line 308 of file func.c.
References sqlite3_result_value(), sqlite3_value_type(), and SQLITE_NULL.
Referenced by sqlite3RegisterGlobalFunctions().
static void last_insert_rowid | ( | sqlite3_context * | context, | |
int | arg, | |||
sqlite3_value ** | argv | |||
) | [static] |
Definition at line 364 of file func.c.
References db, sqlite3_context_db_handle(), sqlite3_last_insert_rowid(), and sqlite3_result_int64().
Referenced by sqlite3RegisterGlobalFunctions().
static void lengthFunc | ( | sqlite3_context * | context, | |
int | argc, | |||
sqlite3_value ** | argv | |||
) | [static] |
Definition at line 86 of file func.c.
References sqlite3_result_int(), sqlite3_result_null(), sqlite3_value_bytes(), sqlite3_value_text(), sqlite3_value_type(), SQLITE_BLOB, SQLITE_FLOAT, SQLITE_INTEGER, SQLITE_SKIP_UTF8, and SQLITE_TEXT.
Referenced by sqlite3RegisterGlobalFunctions().
static void likeFunc | ( | sqlite3_context * | context, | |
int | argc, | |||
sqlite3_value ** | argv | |||
) | [static] |
Definition at line 588 of file func.c.
References sqlite3::aLimit, db, patternCompare(), sqlite3_context_db_handle(), sqlite3_result_error(), sqlite3_result_int(), sqlite3_user_data(), sqlite3_value_bytes(), sqlite3_value_text(), sqlite3Utf8CharLen(), sqlite3Utf8Read(), and SQLITE_LIMIT_LIKE_PATTERN_LENGTH.
Referenced by sqlite3RegisterLikeFunctions().
static void loadExt | ( | sqlite3_context * | context, | |
int | argc, | |||
sqlite3_value ** | argv | |||
) | [static] |
Definition at line 997 of file func.c.
References db, sqlite3_context_db_handle(), sqlite3_free(), sqlite3_load_extension(), sqlite3_result_error(), and sqlite3_value_text().
Referenced by sqlite3RegisterGlobalFunctions().
static void lowerFunc | ( | sqlite3_context * | context, | |
int | argc, | |||
sqlite3_value ** | argv | |||
) | [static] |
Definition at line 282 of file func.c.
References contextMalloc(), sqlite3_free(), sqlite3_result_text(), sqlite3_value_bytes(), sqlite3_value_text(), sqlite3_value_type(), and SQLITE_NULL.
Referenced by sqlite3RegisterGlobalFunctions().
static void minMaxFinalize | ( | sqlite3_context * | context | ) | [static] |
Definition at line 1147 of file func.c.
References Mem::flags, sqlite3_aggregate_context(), sqlite3_result_value(), and sqlite3VdbeMemRelease().
Referenced by sqlite3RegisterGlobalFunctions().
static void minmaxFunc | ( | sqlite3_context * | context, | |
int | argc, | |||
sqlite3_value ** | argv | |||
) | [static] |
Definition at line 37 of file func.c.
References sqlite3_result_value(), sqlite3_user_data(), sqlite3_value_type(), sqlite3GetFuncCollSeq(), sqlite3MemCompare(), and SQLITE_NULL.
Referenced by sqlite3RegisterGlobalFunctions().
static void minmaxStep | ( | sqlite3_context * | context, | |
int | argc, | |||
sqlite3_value ** | argv | |||
) | [static] |
Definition at line 1118 of file func.c.
References Mem::flags, sqlite3_aggregate_context(), sqlite3_user_data(), sqlite3_value_type(), sqlite3GetFuncCollSeq(), sqlite3MemCompare(), sqlite3VdbeMemCopy(), and SQLITE_NULL.
Referenced by sqlite3RegisterGlobalFunctions().
static void nullifFunc | ( | sqlite3_context * | context, | |
int | argc, | |||
sqlite3_value ** | argv | |||
) | [static] |
Definition at line 638 of file func.c.
References sqlite3_result_value(), sqlite3GetFuncCollSeq(), and sqlite3MemCompare().
Referenced by sqlite3RegisterGlobalFunctions().
static int patternCompare | ( | const u8 * | zPattern, | |
const u8 * | zString, | |||
const struct compareInfo * | pInfo, | |||
const int | esc | |||
) | [static] |
Definition at line 458 of file func.c.
References GlogUpperToLower, compareInfo::matchAll, compareInfo::matchOne, compareInfo::matchSet, compareInfo::noCase, sqlite3Utf8Read(), and SQLITE_SKIP_UTF8.
Referenced by likeFunc().
static void quoteFunc | ( | sqlite3_context * | context, | |
int | argc, | |||
sqlite3_value ** | argv | |||
) | [static] |
Definition at line 679 of file func.c.
References contextMalloc(), hexdigits, sqlite3_free(), sqlite3_result_text(), sqlite3_result_value(), sqlite3_value_blob(), sqlite3_value_bytes(), sqlite3_value_text(), sqlite3_value_type(), SQLITE_BLOB, SQLITE_FLOAT, SQLITE_INTEGER, SQLITE_NULL, SQLITE_STATIC, SQLITE_TEXT, and SQLITE_TRANSIENT.
Referenced by sqlite3RegisterGlobalFunctions().
static void randomBlob | ( | sqlite3_context * | context, | |
int | argc, | |||
sqlite3_value ** | argv | |||
) | [static] |
Definition at line 341 of file func.c.
References contextMalloc(), sqlite3_free(), sqlite3_randomness(), sqlite3_result_blob(), and sqlite3_value_int().
Referenced by sqlite3RegisterGlobalFunctions().
static void randomFunc | ( | sqlite3_context * | context, | |
int | argc, | |||
sqlite3_value ** | argv | |||
) | [static] |
Definition at line 325 of file func.c.
References sqlite3_randomness(), and sqlite3_result_int64().
Referenced by sqlite3RegisterGlobalFunctions().
static void replaceFunc | ( | sqlite3_context * | context, | |
int | argc, | |||
sqlite3_value ** | argv | |||
) | [static] |
Definition at line 789 of file func.c.
References sqlite3::aLimit, contextMalloc(), db, sqlite3_context_db_handle(), sqlite3_free(), sqlite3_realloc(), sqlite3_result_error_nomem(), sqlite3_result_error_toobig(), sqlite3_result_text(), sqlite3_value_bytes(), sqlite3_value_text(), sqlite3DbFree(), SQLITE_LIMIT_LENGTH, and SQLITE_MAX_LENGTH.
Referenced by sqlite3RegisterGlobalFunctions().
static void roundFunc | ( | sqlite3_context * | context, | |
int | argc, | |||
sqlite3_value ** | argv | |||
) | [static] |
Definition at line 222 of file func.c.
References sqlite3_result_double(), sqlite3_snprintf(), sqlite3_value_double(), sqlite3_value_int(), sqlite3_value_type(), sqlite3AtoF(), and SQLITE_NULL.
Referenced by sqlite3RegisterGlobalFunctions().
static void setLikeOptFlag | ( | sqlite3 * | db, | |
const char * | zName, | |||
int | flagVal | |||
) | [static] |
Definition at line 1235 of file func.c.
References FuncDef::flags, sqlite3FindFunction(), and SQLITE_UTF8.
Referenced by sqlite3RegisterLikeFunctions().
static CollSeq* sqlite3GetFuncCollSeq | ( | sqlite3_context * | context | ) | [static] |
Definition at line 30 of file func.c.
References sqlite3_context::pColl.
Referenced by minmaxFunc(), minmaxStep(), and nullifFunc().
Definition at line 1271 of file func.c.
References FuncDef::flags, compareInfo::matchAll, Token::n, ExprList::nExpr, Expr::op, Expr::pList, FuncDef::pUserData, sqlite3FindFunction(), SQLITE_FUNC_CASE, SQLITE_FUNC_LIKE, SQLITE_UTF8, TK_FUNCTION, Expr::token, and Token::z.
Referenced by isLikeOrGlob().
void sqlite3RegisterBuiltinFunctions | ( | sqlite3 * | db | ) |
Definition at line 1216 of file func.c.
References sqlite3::mallocFailed, sqlite3_overload_function(), sqlite3AlterFunctions(), SQLITE_NOMEM, and SQLITE_OK.
Referenced by openDatabase().
void sqlite3RegisterGlobalFunctions | ( | void | ) |
Definition at line 1304 of file func.c.
References absFunc(), AGGREGATE, ArraySize, avgFinalize(), changes(), countFinalize(), countStep(), FUNCTION, GLOBAL, groupConcatFinalize(), groupConcatStep(), hexFunc(), ifnullFunc(), last_insert_rowid(), lengthFunc(), LIKEFUNC, loadExt(), lowerFunc(), minMaxFinalize(), minmaxFunc(), minmaxStep(), nullifFunc(), quoteFunc(), randomBlob(), randomFunc(), replaceFunc(), roundFunc(), sqlite3FuncDefInsert(), sqlite3GlobalFunctions, sqlite3RegisterDateTimeFunctions(), SQLITE_FUNC_CASE, SQLITE_FUNC_LIKE, SQLITE_WSD, substrFunc(), sumFinalize(), sumStep(), total_changes(), totalFinalize(), trimFunc(), typeofFunc(), upperFunc(), versionFunc(), and zeroblobFunc().
Referenced by sqlite3_initialize().
void sqlite3RegisterLikeFunctions | ( | sqlite3 * | db, | |
int | caseSensitive | |||
) |
Definition at line 1248 of file func.c.
References likeFunc(), setLikeOptFlag(), sqlite3CreateFunc(), SQLITE_FUNC_CASE, SQLITE_FUNC_LIKE, and SQLITE_UTF8.
Referenced by sqlite3Pragma().
static void substrFunc | ( | sqlite3_context * | context, | |
int | argc, | |||
sqlite3_value ** | argv | |||
) | [static] |
Definition at line 160 of file func.c.
References sqlite3::aLimit, sqlite3_context_db_handle(), sqlite3_result_blob(), sqlite3_result_text(), sqlite3_value_blob(), sqlite3_value_bytes(), sqlite3_value_int(), sqlite3_value_text(), sqlite3_value_type(), SQLITE_BLOB, SQLITE_LIMIT_LENGTH, SQLITE_SKIP_UTF8, and SQLITE_TRANSIENT.
Referenced by sqlite3RegisterGlobalFunctions().
static void sumFinalize | ( | sqlite3_context * | context | ) | [static] |
Definition at line 1064 of file func.c.
References SumCtx::approx, SumCtx::cnt, SumCtx::iSum, SumCtx::overflow, SumCtx::rSum, sqlite3_aggregate_context(), sqlite3_result_double(), sqlite3_result_error(), and sqlite3_result_int64().
Referenced by sqlite3RegisterGlobalFunctions().
static void sumStep | ( | sqlite3_context * | context, | |
int | argc, | |||
sqlite3_value ** | argv | |||
) | [static] |
Definition at line 1039 of file func.c.
References SumCtx::approx, SumCtx::cnt, SumCtx::iSum, SumCtx::overflow, SumCtx::rSum, sqlite3_aggregate_context(), sqlite3_value_double(), sqlite3_value_int64(), sqlite3_value_numeric_type(), SQLITE_INTEGER, and SQLITE_NULL.
Referenced by sqlite3RegisterGlobalFunctions().
static void total_changes | ( | sqlite3_context * | context, | |
int | arg, | |||
sqlite3_value ** | argv | |||
) | [static] |
Definition at line 390 of file func.c.
References db, sqlite3_context_db_handle(), sqlite3_result_int(), and sqlite3_total_changes().
Referenced by sqlite3RegisterGlobalFunctions().
static void totalFinalize | ( | sqlite3_context * | context | ) | [static] |
Definition at line 1084 of file func.c.
References SumCtx::rSum, sqlite3_aggregate_context(), and sqlite3_result_double().
Referenced by sqlite3RegisterGlobalFunctions().
static void trimFunc | ( | sqlite3_context * | context, | |
int | argc, | |||
sqlite3_value ** | argv | |||
) | [static] |
Definition at line 861 of file func.c.
References contextMalloc(), sqlite3_free(), sqlite3_result_text(), sqlite3_user_data(), sqlite3_value_bytes(), sqlite3_value_text(), sqlite3_value_type(), SQLITE_NULL, SQLITE_PTR_TO_INT, SQLITE_SKIP_UTF8, SQLITE_STATIC, and SQLITE_TRANSIENT.
Referenced by sqlite3RegisterGlobalFunctions().
static void typeofFunc | ( | sqlite3_context * | context, | |
int | argc, | |||
sqlite3_value ** | argv | |||
) | [static] |
Definition at line 66 of file func.c.
References sqlite3_result_text(), sqlite3_value_type(), SQLITE_BLOB, SQLITE_FLOAT, SQLITE_INTEGER, SQLITE_NULL, SQLITE_STATIC, and SQLITE_TEXT.
Referenced by sqlite3RegisterGlobalFunctions().
static void upperFunc | ( | sqlite3_context * | context, | |
int | argc, | |||
sqlite3_value ** | argv | |||
) | [static] |
Definition at line 262 of file func.c.
References contextMalloc(), sqlite3_free(), sqlite3_result_text(), sqlite3_value_bytes(), sqlite3_value_text(), sqlite3_value_type(), and SQLITE_NULL.
Referenced by sqlite3RegisterGlobalFunctions().
static void versionFunc | ( | sqlite3_context * | context, | |
int | argc, | |||
sqlite3_value ** | argv | |||
) | [static] |
Definition at line 653 of file func.c.
References sqlite3_result_text(), sqlite3_version, and SQLITE_STATIC.
Referenced by sqlite3RegisterGlobalFunctions().
static void zeroblobFunc | ( | sqlite3_context * | context, | |
int | argc, | |||
sqlite3_value ** | argv | |||
) | [static] |
Definition at line 768 of file func.c.
References sqlite3_result_error_toobig(), sqlite3_result_zeroblob(), sqlite3_value_int64(), and SQLITE_MAX_LENGTH.
Referenced by sqlite3RegisterGlobalFunctions().
struct compareInfo globInfo = { '*', '?', '[', 0 } [static] |
const char hexdigits[] [static] |
{ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' }
Definition at line 663 of file func.c.
Referenced by hexFunc(), and quoteFunc().
struct compareInfo likeInfoAlt = { '%', '_', 0, 0 } [static] |
struct compareInfo likeInfoNorm = { '%', '_', 0, 1 } [static] |
ContextLogger2—ContextLogger2 Logger Daemon Internals—Generated on Mon May 2 13:49:59 2011 by Doxygen 1.6.1