2 * add a file/files to an sqlite db
3 * in the 'files' table.
17 static int callback(void *NotUsed, int argc, char **argv, char **azColName){
20 fprintf(stderr, "sqlite3 callback unused = %p\n", NotUsed);
22 for(i=0; i<argc; i++){
23 printf("%s = %s\n", azColName[i], argv[i] ? argv[i] : "NULL");
35 #define SQLERROR(x) fprintf(stderr, "%s %d: %s\n", __func__, __LINE__, (x))
36 int begin(sqlite3 *db) {
40 rc = sqlite3_exec(db, "begin;", callback, 0, &err);
41 if (rc != SQLITE_OK) {
48 int commit(sqlite3 *db) {
52 rc = sqlite3_exec(db, "commit;", callback, 0, &err);
53 if (rc != SQLITE_OK) {
60 int rollback(sqlite3 *db) {
64 rc = sqlite3_exec(db, "rollback;", callback, 0, &err);
65 if (rc != SQLITE_OK) {