diff options
author | Ralf Corsépius <corsepiu@fedoraproject.org> | 2007-10-30 04:06:24 +0100 |
---|---|---|
committer | Ralf Corsépius <corsepiu@fedoraproject.org> | 2007-10-30 04:06:24 +0100 |
commit | ae0e274e3511f6fe821adbf3f9769a311c5b3c89 (patch) | |
tree | 39c3b4a758e4233e4dac2d545dea258254f419a1 | |
parent | 002b3ca2f933fe33ca41e76e29c264345c77db09 (diff) | |
download | librpm-tizen-ae0e274e3511f6fe821adbf3f9769a311c5b3c89.tar.gz librpm-tizen-ae0e274e3511f6fe821adbf3f9769a311c5b3c89.tar.bz2 librpm-tizen-ae0e274e3511f6fe821adbf3f9769a311c5b3c89.zip |
Remove rpmdb/tsql.c.
-rw-r--r-- | rpmdb/Makefile.am | 4 | ||||
-rw-r--r-- | rpmdb/tsql.c | 62 |
2 files changed, 0 insertions, 66 deletions
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 <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <unistd.h> - -#include <sqlite3.h> - -#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; -} |