27 |
#define SQL_ACCT 1 |
#define SQL_ACCT 1 |
28 |
#define SQL_NSERVICE 2 |
#define SQL_NSERVICE 2 |
29 |
|
|
30 |
|
#define SQL_CACHE_SIZE 16 |
31 |
|
typedef char **SQL_TUPLE; |
32 |
|
|
33 |
|
typedef struct { |
34 |
|
char *query; |
35 |
|
size_t ntuples; |
36 |
|
size_t nfields; |
37 |
|
SQL_TUPLE *tuple; |
38 |
|
} SQL_RESULT; |
39 |
|
|
40 |
struct sql_connection { |
struct sql_connection { |
41 |
int interface; /* One of SQLT_ values */ |
int interface; /* One of SQLT_ values */ |
43 |
int connected; /* Connected to the database? */ |
int connected; /* Connected to the database? */ |
44 |
int destroy_on_close; /* Should the connection be closed upon |
int destroy_on_close; /* Should the connection be closed upon |
45 |
the end of a transaction */ |
the end of a transaction */ |
46 |
time_t last_used; /* When it was lastly used */ |
time_t last_used; /* Time it was lastly used */ |
47 |
void *data; /* connection-specific data */ |
void *data; /* connection-specific data */ |
48 |
|
|
49 |
|
SQL_RESULT *cache[SQL_CACHE_SIZE]; |
50 |
|
size_t head; |
51 |
|
size_t tail; |
52 |
}; |
}; |
53 |
|
|
54 |
typedef struct { |
typedef struct { |