29typedef struct SqlHandle {
32 struct SqlHandle *next;
36static SqlHandle *g_sql_handles = NULL;
38static int g_sql_next_id = 1;
54static SqlHandle *sql_reg_add(sqlite3 *
db) {
55 SqlHandle *h = (SqlHandle *)calloc(1,
sizeof(SqlHandle));
57 h->id = g_sql_next_id++;
59 h->next = g_sql_handles;
70static SqlHandle *sql_reg_get(
int id) {
71 for (SqlHandle *
p = g_sql_handles;
p;
p =
p->next)
72 if (
p->id ==
id)
return p;
85static void sql_reg_del(
int id) {
86 SqlHandle **pp = &g_sql_handles;
88 if ((*pp)->id ==
id) {