cvsuser 04/01/02 13:20:46
Modified: src call_list.txt
library postgres.pasm postgres.declarations
Log:
Add-ins to get postgres support up to 7.4 levels
Courtesy of Harry Jackson <[EMAIL PROTECTED]>
Revision Changes Path
1.27 +6 -0 parrot/src/call_list.txt
Index: call_list.txt
===================================================================
RCS file: /cvs/public/parrot/src/call_list.txt,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -w -r1.26 -r1.27
--- call_list.txt 2 Jan 2004 02:56:49 -0000 1.26
+++ call_list.txt 2 Jan 2004 21:20:43 -0000 1.27
@@ -47,6 +47,7 @@
#p b
c v
c p
+c pi
c
d d
d v
@@ -149,6 +150,7 @@
t ii
t pi
t pii
+t pt
t t
t tl4
t t4
@@ -193,6 +195,10 @@
# Oddball ones for postgres
p ptiLTLLi
p pi33ipi
+p ptii33i
+p ptit33i
+i ptit33i
+i ptiit33i
# The following are used by library/pcre.imc
p tiB3P
1.3 +39 -13 parrot/library/postgres.pasm
Index: postgres.pasm
===================================================================
RCS file: /cvs/public/parrot/library/postgres.pasm,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -w -r1.2 -r1.3
--- postgres.pasm 2 Jan 2004 02:56:45 -0000 1.2
+++ postgres.pasm 2 Jan 2004 21:20:46 -0000 1.3
@@ -1,5 +1,3 @@
-# For postgres 7.3
-
saveall
loadlib P1, '/usr/local/pgsql/lib/libpq.so'
dlfunc P2, P1, 'PQconnectStart', 'pt'
@@ -20,7 +18,7 @@
store_global 'PostgreSQL::PQresetStart', P2
dlfunc P2, P1, 'PQresetPoll', 'ip'
store_global 'PostgreSQL::PQresetPoll', P2
-dlfunc P2, P1, 'PQreset', 'cp'
+dlfunc P2, P1, 'PQreset', 'vp'
store_global 'PostgreSQL::PQreset', P2
dlfunc P2, P1, 'PQrequestCancel', 'ip'
store_global 'PostgreSQL::PQrequestCancel', P2
@@ -40,6 +38,12 @@
store_global 'PostgreSQL::PQoptions', P2
dlfunc P2, P1, 'PQstatus', 'ip'
store_global 'PostgreSQL::PQstatus', P2
+dlfunc P2, P1, 'PQtransactionStatus', 'ip'
+store_global 'PostgreSQL::PQtransactionStatus', P2
+dlfunc P2, P1, 'PQparameterStatus', 'tpt'
+store_global 'PostgreSQL::PQparameterStatus', P2
+dlfunc P2, P1, 'PQprotocolVersion', 'ip'
+store_global 'PostgreSQL::PQprotocolVersion', P2
dlfunc P2, P1, 'PQerrorMessage', 'tp'
store_global 'PostgreSQL::PQerrorMessage', P2
dlfunc P2, P1, 'PQsocket', 'ip'
@@ -50,28 +54,38 @@
store_global 'PostgreSQL::PQclientEncoding', P2
dlfunc P2, P1, 'PQsetClientEncoding', 'ipt'
store_global 'PostgreSQL::PQsetClientEncoding', P2
+dlfunc P2, P1, 'PQsetErrorVerbosity', 'ipi'
+store_global 'PostgreSQL::PQsetErrorVerbosity', P2
dlfunc P2, P1, 'PQtrace', 'vpp'
store_global 'PostgreSQL::PQtrace', P2
dlfunc P2, P1, 'PQuntrace', 'vp'
store_global 'PostgreSQL::PQuntrace', P2
-dlfunc P2, P1, 'PQescapeBytea', 'ttl4'
-store_global 'PostgreSQL::PQescapeBytea', P2
-dlfunc P2, P1, 'PQunescapeBytea', 'tt4'
-store_global 'PostgreSQL::PQunescapeBytea', P2
dlfunc P2, P1, 'PQexec', 'ppt'
store_global 'PostgreSQL::PQexec', P2
-dlfunc P2, P1, 'PQnotifies', 'pp'
-store_global 'PostgreSQL::PQnotifies', P2
-dlfunc P2, P1, 'PQfreeNotify', 'vp'
-store_global 'PostgreSQL::PQfreeNotify', P2
+dlfunc P2, P1, 'PQexecParams', 'pptiLTLLi'
+store_global 'PostgreSQL::PQexecParams', P2
+dlfunc P2, P1, 'PQexecPrepared', 'pptit33i'
+store_global 'PostgreSQL::PQexecPrepared', P2
dlfunc P2, P1, 'PQsendQuery', 'ipt'
store_global 'PostgreSQL::PQsendQuery', P2
+dlfunc P2, P1, 'PQsendQueryParams', 'iptiit33i'
+store_global 'PostgreSQL::PQsendQueryParams', P2
+dlfunc P2, P1, 'PQsendQueryPrepared', 'iptit33i'
+store_global 'PostgreSQL::PQsendQueryPrepared', P2
dlfunc P2, P1, 'PQgetResult', 'pp'
store_global 'PostgreSQL::PQgetResult', P2
dlfunc P2, P1, 'PQisBusy', 'ip'
store_global 'PostgreSQL::PQisBusy', P2
dlfunc P2, P1, 'PQconsumeInput', 'ip'
store_global 'PostgreSQL::PQconsumeInput', P2
+dlfunc P2, P1, 'PQnotifies', 'pp'
+store_global 'PostgreSQL::PQnotifies', P2
+dlfunc P2, P1, 'PQputCopyData', 'ipti'
+store_global 'PostgreSQL::PQputCopyData', P2
+dlfunc P2, P1, 'PQputCopyEnd', 'ipt'
+store_global 'PostgreSQL::PQputCopyEnd', P2
+dlfunc P2, P1, 'PQgetCopyData', 'ipti'
+store_global 'PostgreSQL::PQgetCopyData', P2
dlfunc P2, P1, 'PQgetline', 'ipti'
store_global 'PostgreSQL::PQgetline', P2
dlfunc P2, P1, 'PQputline', 'ipt'
@@ -88,8 +102,6 @@
store_global 'PostgreSQL::PQisnonblocking', P2
dlfunc P2, P1, 'PQflush', 'ip'
store_global 'PostgreSQL::PQflush', P2
-dlfunc P2, P1, 'PQsendSome', 'ip'
-store_global 'PostgreSQL::PQsendSome', P2
dlfunc P2, P1, 'PQfn', 'ppi33ipi'
store_global 'PostgreSQL::PQfn', P2
dlfunc P2, P1, 'PQresultStatus', 'ip'
@@ -98,6 +110,8 @@
store_global 'PostgreSQL::PQresStatus', P2
dlfunc P2, P1, 'PQresultErrorMessage', 'tp'
store_global 'PostgreSQL::PQresultErrorMessage', P2
+dlfunc P2, P1, 'PQresultErrorField', 'cpi'
+store_global 'PostgreSQL::PQresultErrorField', P2
dlfunc P2, P1, 'PQntuples', 'ip'
store_global 'PostgreSQL::PQntuples', P2
dlfunc P2, P1, 'PQnfields', 'ip'
@@ -108,6 +122,12 @@
store_global 'PostgreSQL::PQfname', P2
dlfunc P2, P1, 'PQfnumber', 'ipt'
store_global 'PostgreSQL::PQfnumber', P2
+dlfunc P2, P1, 'PQftable', 'ipi'
+store_global 'PostgreSQL::PQftable', P2
+dlfunc P2, P1, 'PQftablecol', 'ipi'
+store_global 'PostgreSQL::PQftablecol', P2
+dlfunc P2, P1, 'PQfformat', 'ipi'
+store_global 'PostgreSQL::PQfformat', P2
dlfunc P2, P1, 'PQftype', 'ipi'
store_global 'PostgreSQL::PQftype', P2
dlfunc P2, P1, 'PQfsize', 'ipi'
@@ -130,6 +150,12 @@
store_global 'PostgreSQL::PQgetisnull', P2
dlfunc P2, P1, 'PQclear', 'vp'
store_global 'PostgreSQL::PQclear', P2
+dlfunc P2, P1, 'PQfreemem', 'vp'
+store_global 'PostgreSQL::PQfreemem', P2
+dlfunc P2, P1, 'PQescapeBytea', 'ttl4'
+store_global 'PostgreSQL::PQescapeBytea', P2
+dlfunc P2, P1, 'PQunescapeBytea', 'tt4'
+store_global 'PostgreSQL::PQunescapeBytea', P2
dlfunc P2, P1, 'PQmakeEmptyPGresult', 'ppi'
store_global 'PostgreSQL::PQmakeEmptyPGresult', P2
dlfunc P2, P1, 'lo_open', 'ipii'
1.2 +127 -16 parrot/library/postgres.declarations
Index: postgres.declarations
===================================================================
RCS file: /cvs/public/parrot/library/postgres.declarations,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -w -r1.1 -r1.2
--- postgres.declarations 8 Oct 2003 15:49:05 -0000 1.1
+++ postgres.declarations 2 Jan 2004 21:20:46 -0000 1.2
@@ -5,7 +5,7 @@
libpq
[defs]
-# From libpq-fe.h
+# From libpq-fe.h Revision 1.100
p PQconnectStart t
i PQconnectPoll p
p PQconnectdb t
@@ -15,7 +15,11 @@
v PQconninfoFree p
i PQresetStart p
i PQresetPoll p
-c PQreset p
+
+#extern void PQreset(PGconn *conn);
+# This was set to "c PQreset p" was this correct.
+v PQreset p
+
i PQrequestCancel p
t PQdb p
t PQuser p
@@ -25,54 +29,131 @@
t PQtty p
t PQoptions p
i PQstatus p
+
+##### New In 7.4
+i PQtransactionStatus p
+t PQparameterStatus p t
+i PQprotocolVersion p
+#####
+
t PQerrorMessage p
i PQsocket p
i PQbackendPID p
i PQclientEncoding p
i PQsetClientEncoding p t
+
+##### New In 7.4
+i PQsetErrorVerbosity p i
+#####
+
v PQtrace p p
v PQuntrace p
-# Needs a function pointer. Can't do that yet
+# Need function pointers. Can't do that yet
+##### New IN 7.4
+#i PQsetNoticeReceiver p p
+#####
# i PQsetNoticeProcessor p p
-# First arg's a returned char pointer. Can't do that yet
-# i PQescapeString t t i
-
-t PQescapeBytea t l 4
-t PQunescapeBytea t 4
p PQexec p t
-p PQnotifies p
-v PQfreeNotify p
+
+##### New In 7.4
+#extern PGresult *PQexecParams(PGconn *conn,
+# const char *command,
+# int nParams,
+# const Oid *paramTypes,
+# const char *const * paramValues,
+# const int *paramLengths,
+# const int *paramFormats,
+# int resultFormat);
+p PQexecParams p t i i 3 3 i
+
+
+#extern PGresult *PQexecPrepared(PGconn *conn,
+# const char *stmtName,
+# int nParams,
+# const char *const * paramValues,
+# const int *paramLengths,
+# const int *paramFormats,
+# int resultFormat);
+p PQexecPrepared p t i t 3 3 i
+#####
i PQsendQuery p t
+
+##### New In 7.4
+#extern int PQsendQueryParams(PGconn *conn,
+# const char *command,
+# int nParams,
+# const Oid *paramTypes,
+# const char *const * paramValues,
+# const int *paramLengths,
+# const int *paramFormats,
+# int resultFormat);
+i PQsendQueryParams p t i i t 3 3 i
+
+#extern int PQsendQueryPrepared(PGconn *conn,
+# const char *stmtName,
+# int nParams,
+# const char *const * paramValues,
+# const int *paramLengths,
+# const int *paramFormats,
+# int resultFormat);
+i PQsendQueryPrepared p t i t 3 3 i
+#####
+
p PQgetResult p
i PQisBusy p
i PQconsumeInput p
+p PQnotifies p
+
+##### New In 7.4
+#extern int PQputCopyData(PGconn *conn, const char *buffer, int nbytes);
+i PQputCopyData p t i
+
+#extern int PQputCopyEnd(PGconn *conn, const char *errormsg);
+i PQputCopyEnd p t
+
+#extern int PQgetCopyData(PGconn *conn, char **buffer, int async);
+i PQgetCopyData p t i
+#####
+
i PQgetline p t i
i PQputline p t
i PQgetlineAsync p t i
i PQputnbytes p t i
i PQendcopy p
-
i PQsetnonblocking p i
i PQisnonblocking p
-
i PQflush p
-i PQsendSome p
p PQfn p i 3 3 i p i
-
i PQresultStatus p
t PQresStatus i
t PQresultErrorMessage p
+
+##### New In 7.4
+#extern char *PQresultErrorField(const PGresult *res, int fieldcode);
+c PQresultErrorField p i
+#####
+
i PQntuples p
i PQnfields p
i PQbinaryTuples p
t PQfname p i
i PQfnumber p t
+
+##### New In 7.4
+#extern Oid PQftable(const PGresult *res, int field_num);
+i PQftable p i
+#extern int PQftablecol(const PGresult *res, int field_num);
+i PQftablecol p i
+#extern int PQfformat(const PGresult *res, int field_num);
+i PQfformat p i
+#####
+
i PQftype p i
i PQfsize p i
i PQfmod p i
@@ -83,11 +164,42 @@
t PQgetvalue p i i
i PQgetlength p i i
i PQgetisnull p i i
-
v PQclear p
+##### New In 7.4
+#extern void PQfreemem(void *ptr);
+v PQfreemem p
+#####
+
+
+# First arg's a neturned char pointer. Can't do that yet
+# i PQescapeString t t i
+
+t PQescapeBytea t l 4
+t PQunescapeBytea t 4
+
p PQmakeEmptyPGresult p i
+# The following functions are missing from the original 7.3 version
+# so I am leaving these as well. I am including the declarations here
+# to let people know the ommission was deliberate. Not 100% why
+# though ;-)
+
+#extern void PQprint(FILE *fout,
+# const PGresult *res,
+# const PQprintOpt *ps);
+#extern void PQdisplayTuples(const PGresult *res,
+# FILE *fp,
+# int fillAlign,
+# const char *fieldSep,
+# int printHeader,
+# int quiet);
+#extern void PQprintTuples(const PGresult *res,
+# FILE *fout,
+# int printAttName,
+# int terseOutput,
+# int width);
+
i lo_open p i i
i lo_close p i
i lo_read p i t l
@@ -101,4 +213,3 @@
i PQmblen t i
i PQenv2encoding v
-