195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
|
**
** Usage example for files_of_checkin:
**
** CREATE VIRTUAL TABLE temp.foci USING files_of_checkin;
** SELECT * FROM foci WHERE checkinID=symbolic_name_to_rid('trunk');
*/
void cmd_sqlite3(void){
extern int sqlite3_shell(int, char**);
if( find_option("no-repository", 0, 0)==0 ){
db_find_and_open_repository(OPEN_ANY_SCHEMA, 0);
db_close(1);
}
sqlite3_shutdown();
sqlite3_shell(g.argc-1, g.argv+1);
sqlite3_cancel_auto_extension((void(*)(void))sqlcmd_autoinit);
g.db = 0;
g.zMainDbType = 0;
g.repositoryOpen = 0;
g.localOpen = 0;
}
/*
** This routine is called by the patched sqlite3 command-line shell in order
** to load the name and database connection for the open Fossil database.
*/
void fossil_open(const char **pzRepoName){
sqlite3_auto_extension((void(*)(void))sqlcmd_autoinit);
*pzRepoName = g.zRepositoryName;
}
|
>
|
>
<
>
<
<
|
<
>
>
>
>
>
>
>
>
>
>
>
>
>
|
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
|
**
** Usage example for files_of_checkin:
**
** CREATE VIRTUAL TABLE temp.foci USING files_of_checkin;
** SELECT * FROM foci WHERE checkinID=symbolic_name_to_rid('trunk');
*/
void cmd_sqlite3(void){
int noRepository;
extern int sqlite3_shell(int, char**);
noRepository = find_option("no-repository", 0, 0)!=0;
if( !noRepository ){
db_find_and_open_repository(OPEN_ANY_SCHEMA, 0);
}
fossil_close(1, noRepository);
sqlite3_shutdown();
sqlite3_shell(g.argc-1, g.argv+1);
sqlite3_cancel_auto_extension((void(*)(void))sqlcmd_autoinit);
fossil_close(0, noRepository);
}
/*
** This routine is called by the patched sqlite3 command-line shell in order
** to load the name and database connection for the open Fossil database.
*/
void fossil_open(const char **pzRepoName){
sqlite3_auto_extension((void(*)(void))sqlcmd_autoinit);
*pzRepoName = g.zRepositoryName;
}
/*
** This routine closes the Fossil databases and/or invalidates the global
** state variables that keep track of them.
*/
void fossil_close(int bDb, int noRepository){
if( bDb ) db_close(1);
if( noRepository ) g.zRepositoryName = 0;
g.db = 0;
g.zMainDbType = 0;
g.repositoryOpen = 0;
g.localOpen = 0;
}
|