From ae0e274e3511f6fe821adbf3f9769a311c5b3c89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ralf=20Cors=C3=A9pius?= Date: Tue, 30 Oct 2007 04:06:24 +0100 Subject: Remove rpmdb/tsql.c. --- rpmdb/Makefile.am | 4 ---- rpmdb/tsql.c | 62 ------------------------------------------------------- 2 files changed, 66 deletions(-) delete mode 100644 rpmdb/tsql.c diff --git a/rpmdb/Makefile.am b/rpmdb/Makefile.am index bfca7ebf4..2a8469f37 100644 --- a/rpmdb/Makefile.am +++ b/rpmdb/Makefile.am @@ -178,7 +178,3 @@ tdbi_LDADD = librpmdb.la check_PROGRAMS += tjfn tjfn_SOURCES = tjfn.c tjfn_LDADD = librpmdb.la @WITH_BEECRYPT_LIB@ - -EXTRA_PROGRAMS += tsql -tsql_SOURCES = tsql.c -tsql_LDADD = librpmdb.la diff --git a/rpmdb/tsql.c b/rpmdb/tsql.c deleted file mode 100644 index b1c937924..000000000 --- a/rpmdb/tsql.c +++ /dev/null @@ -1,62 +0,0 @@ -#include -#include -#include -#include - -#include - -#include "sqlite.c" - -static int sql_query(sqlite3 *db, const char *cmd) -{ - SCP_t scp = scpNew(); - const char * zTail; - int rc; - int i; - -fprintf(stderr, "*** %s:\n%s\n", __FUNCTION__, cmd); - -#if 0 - rc = sqlite3_prepare(db, cmd, strlen(cmd), &scp->pStmt, &zTail); - if (rc) fprintf(stderr, "prepare: %d %s\n", rc, sqlite3_errmsg(db)); - - rc = sql_step(db, scp); -#else - rc = sqlite3_get_table(db, cmd, - &scp->av, &scp->nr, &scp->nc, &scp->pzErrmsg); - if (rc) fprintf(stderr, "get_table: %d %s\n", rc, sqlite3_errmsg(db)); - -fprintf(stderr, "%s: DONE scp %p [%d:%d] av %p avlen %p nr %d nc %d\n", __FUNCTION__, scp, scp->ac, scp->nalloc, scp->av, scp->avlen, scp->nr, scp->nc); - - fprintf(stderr, "\tav[0] %p %s\n", scp->av[0], scp->av[0]); - for (i = 1; i < scp->nr; i++) { - fprintf(stderr, "\tav[%d] %p %d\n", i, scp->av[i], *(int *)scp->av[i]); - } -#endif - - scp = scpReset(scp); - - return rc; -} - -static const char *dbname = "/var/lib/rpm/Packages"; -static const char *qcmd = "SELECT key from 'Packages';"; - -int main(int argc, char *argv[]) -{ - sqlite3 *db; - int rc; - - rc = sqlite3_open(dbname, &db); - if (rc) { - fprintf(stderr, "Can't open database: %s\n", sqlite3_errmsg(db)); - sqlite3_close(db); - exit(1); - } - - rc = sql_query(db, qcmd); - - sqlite3_close(db); - - return 0; -} -- cgit v1.2.3