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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 if( argc==2 ){ | 84 if( argc==2 ){ |
85 sqlite3_result_int(context, mx); | 85 sqlite3_result_int(context, mx); |
86 }else{ | 86 }else{ |
87 sqlite3_result_int(context, cur); | 87 sqlite3_result_int(context, cur); |
88 } | 88 } |
89 } | 89 } |
90 | 90 |
91 /* | 91 /* |
92 ** Extension load function. | 92 ** Extension load function. |
93 */ | 93 */ |
| 94 #ifdef _WIN32 |
| 95 __declspec(dllexport) |
| 96 #endif |
94 int testloadext_init( | 97 int testloadext_init( |
95 sqlite3 *db, | 98 sqlite3 *db, |
96 char **pzErrMsg, | 99 char **pzErrMsg, |
97 const sqlite3_api_routines *pApi | 100 const sqlite3_api_routines *pApi |
98 ){ | 101 ){ |
99 int nErr = 0; | 102 int nErr = 0; |
100 SQLITE_EXTENSION_INIT2(pApi); | 103 SQLITE_EXTENSION_INIT2(pApi); |
101 nErr |= sqlite3_create_function(db, "half", 1, SQLITE_ANY, 0, halfFunc, 0, 0); | 104 nErr |= sqlite3_create_function(db, "half", 1, SQLITE_ANY, 0, halfFunc, 0, 0); |
102 nErr |= sqlite3_create_function(db, "sqlite3_status", 1, SQLITE_ANY, 0, | 105 nErr |= sqlite3_create_function(db, "sqlite3_status", 1, SQLITE_ANY, 0, |
103 statusFunc, 0, 0); | 106 statusFunc, 0, 0); |
104 nErr |= sqlite3_create_function(db, "sqlite3_status", 2, SQLITE_ANY, 0, | 107 nErr |= sqlite3_create_function(db, "sqlite3_status", 2, SQLITE_ANY, 0, |
105 statusFunc, 0, 0); | 108 statusFunc, 0, 0); |
106 return nErr ? SQLITE_ERROR : SQLITE_OK; | 109 return nErr ? SQLITE_ERROR : SQLITE_OK; |
107 } | 110 } |
108 | 111 |
109 /* | 112 /* |
110 ** Another extension entry point. This one always fails. | 113 ** Another extension entry point. This one always fails. |
111 */ | 114 */ |
| 115 #ifdef _WIN32 |
| 116 __declspec(dllexport) |
| 117 #endif |
112 int testbrokenext_init( | 118 int testbrokenext_init( |
113 sqlite3 *db, | 119 sqlite3 *db, |
114 char **pzErrMsg, | 120 char **pzErrMsg, |
115 const sqlite3_api_routines *pApi | 121 const sqlite3_api_routines *pApi |
116 ){ | 122 ){ |
117 char *zErr; | 123 char *zErr; |
118 SQLITE_EXTENSION_INIT2(pApi); | 124 SQLITE_EXTENSION_INIT2(pApi); |
119 zErr = sqlite3_mprintf("broken!"); | 125 zErr = sqlite3_mprintf("broken!"); |
120 *pzErrMsg = zErr; | 126 *pzErrMsg = zErr; |
121 return 1; | 127 return 1; |
122 } | 128 } |
OLD | NEW |