Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
A bit of factorisation
Baptiste Daroussin committed 13 years ago
commit 73b9b480bf7baa563fe2ba1212261a60f39ede2b
parent d468296
3 files changed +12 -18
modified libpkg/pkg_repo.c
@@ -59,15 +59,6 @@ typedef enum _sql_prstmt_index_t {
	PRSTMT_LAST,
} sql_prstmt_index_t;

-
typedef struct _sql_prstmt_t {
-
	sqlite3_stmt *stmt;
-
	const char *sql;
-
	const char *argtypes;
-
} sql_prstmt_t;
-

-
#define STMT(x) (sql_prepared_statements[(x)].stmt)
-
#define SQL(x)  (sql_prepared_statements[(x)].sql)
-

static sql_prstmt_t sql_prepared_statements[PRSTMT_LAST] = {
	[PKG] = {
		NULL,
modified libpkg/pkgdb.c
@@ -1502,15 +1502,6 @@ typedef enum _sql_prstmt_index_t {
	PRSTMT_LAST,
} sql_prstmt_index_t;

-
typedef struct _sql_prstmt_t {
-
	sqlite3_stmt *stmt;
-
	const char *sql;
-
	const char *argtypes;
-
} sql_prstmt_t;
-

-
#define STMT(x) (sql_prepared_statements[(x)].stmt)
-
#define SQL(x)  (sql_prepared_statements[(x)].sql)
-

static sql_prstmt_t sql_prepared_statements[PRSTMT_LAST] = {
	[MTREE] = {
		NULL,
modified libpkg/private/pkg.h
@@ -160,6 +160,18 @@ struct pkg_shlib {
	STAILQ_ENTRY(pkg_shlib) next;
};

+

+
/* sql helpers */
+

+
typedef struct _sql_prstmt_t {
+
	sqlite3_stmt *stmt;
+
	const char *sql;
+
	const char *argtypes;
+
} sql_prstmt_t;
+

+
#define STMT(x) (sql_prepared_statements[(x)].stmt)
+
#define SQL(x)  (sql_prepared_statements[(x)].sql)
+

/**
 * rc script actions
 */