7 #define PQ_ERRORMSG_LENGTH 1024
9 #define QH_NULLIDENTIFIER 0
10 #define QH_ALREADYFIRED 1
12 typedef int PQModuleIdentifier
;
13 typedef void (*PQQueryHandler
)(PGconn
*, void *);
15 void pqloadtable(char *tablename
, PQQueryHandler init
, PQQueryHandler data
, PQQueryHandler fini
);
17 void pqasyncqueryf(PQModuleIdentifier identifier
, PQQueryHandler handler
, void *tag
, int flags
, char *format
, ...);
18 #define pqasyncqueryi(identifier, handler, tag, format, ...) pqasyncqueryf(identifier, handler, tag, 0, format , ##__VA_ARGS__)
19 #define pqasyncquery(handler, tag, format, ...) pqasyncqueryf(QH_NULLIDENTIFIER, handler, tag, 0, format , ##__VA_ARGS__)
20 #define pqcreatequery(format, ...) pqasyncqueryf(QH_NULLIDENTIFIER, NULL, NULL, QH_CREATE, format , ##__VA_ARGS__)
21 #define pqquery(format, ...) pqasyncqueryf(QH_NULLIDENTIFIER, NULL, NULL, 0, format , ##__VA_ARGS__)
23 int pqconnected(void);
24 char* pqlasterror(PGconn
*pgconn
);
26 PQModuleIdentifier
pqgetid(void);
27 void pqfreeid(PQModuleIdentifier identifier
);