OLD | NEW |
1 /* | 1 /* |
2 ** 2013-06-12 | 2 ** 2013-06-12 |
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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 } | 88 } |
89 pNew = sqlite3_malloc( sizeof(*pNew) ); | 89 pNew = sqlite3_malloc( sizeof(*pNew) ); |
90 *ppVtab = (sqlite3_vtab*)pNew; | 90 *ppVtab = (sqlite3_vtab*)pNew; |
91 if( pNew==0 ) return SQLITE_NOMEM; | 91 if( pNew==0 ) return SQLITE_NOMEM; |
92 memset(pNew, 0, sizeof(*pNew)); | 92 memset(pNew, 0, sizeof(*pNew)); |
93 rc = pAux->pMod->xCreate(db, pAux->pChildAux, argc, argv, | 93 rc = pAux->pMod->xCreate(db, pAux->pChildAux, argc, argv, |
94 &pNew->pChild, pzErr); | 94 &pNew->pChild, pzErr); |
95 if( rc ){ | 95 if( rc ){ |
96 sqlite3_free(pNew); | 96 sqlite3_free(pNew); |
97 *ppVtab = 0; | 97 *ppVtab = 0; |
| 98 return rc; |
98 } | 99 } |
99 pNew->pAux = pAux; | 100 pNew->pAux = pAux; |
100 pNew->ppPrev = &pAux->pAllVtab; | 101 pNew->ppPrev = &pAux->pAllVtab; |
101 pNew->pNext = pAux->pAllVtab; | 102 pNew->pNext = pAux->pAllVtab; |
102 if( pAux->pAllVtab ) pAux->pAllVtab->ppPrev = &pNew->pNext; | 103 if( pAux->pAllVtab ) pAux->pAllVtab->ppPrev = &pNew->pNext; |
103 pAux->pAllVtab = pNew; | 104 pAux->pAllVtab = pNew; |
104 return rc; | 105 return rc; |
105 } | 106 } |
106 | 107 |
107 static int vtshimConnect( | 108 static int vtshimConnect( |
(...skipping 18 matching lines...) Expand all Loading... |
126 } | 127 } |
127 pNew = sqlite3_malloc( sizeof(*pNew) ); | 128 pNew = sqlite3_malloc( sizeof(*pNew) ); |
128 *ppVtab = (sqlite3_vtab*)pNew; | 129 *ppVtab = (sqlite3_vtab*)pNew; |
129 if( pNew==0 ) return SQLITE_NOMEM; | 130 if( pNew==0 ) return SQLITE_NOMEM; |
130 memset(pNew, 0, sizeof(*pNew)); | 131 memset(pNew, 0, sizeof(*pNew)); |
131 rc = pAux->pMod->xConnect(db, pAux->pChildAux, argc, argv, | 132 rc = pAux->pMod->xConnect(db, pAux->pChildAux, argc, argv, |
132 &pNew->pChild, pzErr); | 133 &pNew->pChild, pzErr); |
133 if( rc ){ | 134 if( rc ){ |
134 sqlite3_free(pNew); | 135 sqlite3_free(pNew); |
135 *ppVtab = 0; | 136 *ppVtab = 0; |
| 137 return rc; |
136 } | 138 } |
137 pNew->pAux = pAux; | 139 pNew->pAux = pAux; |
138 pNew->ppPrev = &pAux->pAllVtab; | 140 pNew->ppPrev = &pAux->pAllVtab; |
139 pNew->pNext = pAux->pAllVtab; | 141 pNew->pNext = pAux->pAllVtab; |
140 if( pAux->pAllVtab ) pAux->pAllVtab->ppPrev = &pNew->pNext; | 142 if( pAux->pAllVtab ) pAux->pAllVtab->ppPrev = &pNew->pNext; |
141 pAux->pAllVtab = pNew; | 143 pAux->pAllVtab = pNew; |
142 return rc; | 144 return rc; |
143 } | 145 } |
144 | 146 |
145 static int vtshimBestIndex( | 147 static int vtshimBestIndex( |
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
542 __declspec(dllexport) | 544 __declspec(dllexport) |
543 #endif | 545 #endif |
544 int sqlite3_vtshim_init( | 546 int sqlite3_vtshim_init( |
545 sqlite3 *db, | 547 sqlite3 *db, |
546 char **pzErrMsg, | 548 char **pzErrMsg, |
547 const sqlite3_api_routines *pApi | 549 const sqlite3_api_routines *pApi |
548 ){ | 550 ){ |
549 SQLITE_EXTENSION_INIT2(pApi); | 551 SQLITE_EXTENSION_INIT2(pApi); |
550 return SQLITE_OK; | 552 return SQLITE_OK; |
551 } | 553 } |
OLD | NEW |