OLD | NEW |
1 /* | 1 /* |
2 ** 2006 June 14 | 2 ** 2006 June 14 |
3 ** | 3 ** |
4 ** The author disclaims copyright to this source code. In place of | 4 ** The author disclaims copyright to this source code. In place of |
5 ** a legal notice, here is a blessing: | 5 ** a legal notice, here is a blessing: |
6 ** | 6 ** |
7 ** May you do good and not evil. | 7 ** May you do good and not evil. |
8 ** May you find forgiveness for yourself and forgive others. | 8 ** May you find forgiveness for yourself and forgive others. |
9 ** May you share freely, never taking more than you give. | 9 ** May you share freely, never taking more than you give. |
10 ** | 10 ** |
(...skipping 16 matching lines...) Expand all Loading... |
27 } | 27 } |
28 | 28 |
29 /* | 29 /* |
30 ** SQL functions to call the sqlite3_status function and return results. | 30 ** SQL functions to call the sqlite3_status function and return results. |
31 */ | 31 */ |
32 static void statusFunc( | 32 static void statusFunc( |
33 sqlite3_context *context, | 33 sqlite3_context *context, |
34 int argc, | 34 int argc, |
35 sqlite3_value **argv | 35 sqlite3_value **argv |
36 ){ | 36 ){ |
37 int op, mx, cur, resetFlag, rc; | 37 int op = 0, mx, cur, resetFlag, rc; |
38 if( sqlite3_value_type(argv[0])==SQLITE_INTEGER ){ | 38 if( sqlite3_value_type(argv[0])==SQLITE_INTEGER ){ |
39 op = sqlite3_value_int(argv[0]); | 39 op = sqlite3_value_int(argv[0]); |
40 }else if( sqlite3_value_type(argv[0])==SQLITE_TEXT ){ | 40 }else if( sqlite3_value_type(argv[0])==SQLITE_TEXT ){ |
41 int i; | 41 int i; |
42 const char *zName; | 42 const char *zName; |
43 static const struct { | 43 static const struct { |
44 const char *zName; | 44 const char *zName; |
45 int op; | 45 int op; |
46 } aOp[] = { | 46 } aOp[] = { |
47 { "MEMORY_USED", SQLITE_STATUS_MEMORY_USED }, | 47 { "MEMORY_USED", SQLITE_STATUS_MEMORY_USED }, |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 sqlite3 *db, | 119 sqlite3 *db, |
120 char **pzErrMsg, | 120 char **pzErrMsg, |
121 const sqlite3_api_routines *pApi | 121 const sqlite3_api_routines *pApi |
122 ){ | 122 ){ |
123 char *zErr; | 123 char *zErr; |
124 SQLITE_EXTENSION_INIT2(pApi); | 124 SQLITE_EXTENSION_INIT2(pApi); |
125 zErr = sqlite3_mprintf("broken!"); | 125 zErr = sqlite3_mprintf("broken!"); |
126 *pzErrMsg = zErr; | 126 *pzErrMsg = zErr; |
127 return 1; | 127 return 1; |
128 } | 128 } |
OLD | NEW |