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){
19 for(i=0; i<argc; i++){
20 printf("%s = %s\n", azColName[i], argv[i] ? argv[i] : "NULL");
32 #define SQLERROR(x) fprintf(stderr, "%s %d: %s\n", __func__, __LINE__, (x))
33 int begin(sqlite3 *db) {
37 rc = sqlite3_exec(db, "begin;", callback, 0, &err);
38 if (rc != SQLITE_OK) {
45 int commit(sqlite3 *db) {
49 rc = sqlite3_exec(db, "commit;", callback, 0, &err);
50 if (rc != SQLITE_OK) {
57 int rollback(sqlite3 *db) {
61 rc = sqlite3_exec(db, "rollback;", callback, 0, &err);
62 if (rc != SQLITE_OK) {