Sun, 23 Nov 2008 04:12:04 +0000
Cleanup and commenting
1 | 1 | #include <libpq-fe.h> |
2 | #include <postgres.h> | |
3 | #include <catalog/pg_type.h> | |
4 | #include <dbd/common.h> | |
5 | ||
2 | 6 | /* |
7 | * length of a prepared statement ID | |
8 | * \d{17}\0 | |
9 | */ | |
1 | 10 | #define IDLEN 18 |
11 | ||
12 | #define DBD_POSTGRESQL_CONNECTION "DBD.PostgreSQL.Connection" | |
13 | #define DBD_POSTGRESQL_STATEMENT "DBD.PostgreSQL.Statement" | |
14 | ||
2 | 15 | /* |
16 | * connection object implentation | |
17 | */ | |
1 | 18 | typedef struct _connection { |
19 | PGconn *postgresql; | |
2 | 20 | unsigned int statement_id; /* sequence for statement IDs */ |
1 | 21 | } connection_t; |
22 | ||
2 | 23 | /* |
24 | * statement object implementation | |
25 | */ | |
1 | 26 | typedef struct _statement { |
27 | PGconn *postgresql; | |
28 | PGresult *result; | |
2 | 29 | char name[IDLEN]; /* statement ID */ |
30 | int tuple; /* number of rows returned */ | |
1 | 31 | } statement_t; |
32 |