[PyGreSQL] [CVS] Change to pygresql: pgmodule.c

Christoph Zwerschke cito at druid.net
Fri Nov 21 12:25:28 EST 2008


Update of /usr/cvs/Public/pygresql/module
In directory druid.net:/tmp/cvs-serv5910

Modified Files:
	pgmodule.c 
Log Message:
Remove case distinctions for PG < 7.4 (not supported any more).
To see the diffs for this commit:
   http://www.druid.net/pygresql/viewcvs.cgi/cvs/pygresql/module/pgmodule.c.diff?r1=1.83&r2=1.84

Index: pgmodule.c
===================================================================
RCS file: /usr/cvs/Public/pygresql/module/pgmodule.c,v
retrieving revision 1.83
retrieving revision 1.84
diff -u -r1.83 -r1.84
--- pgmodule.c	21 Nov 2008 17:08:17 -0000	1.83
+++ pgmodule.c	21 Nov 2008 17:25:28 -0000	1.84
@@ -1,5 +1,5 @@
 /*
- * $Id: pgmodule.c,v 1.83 2008/11/21 17:08:17 cito Exp $
+ * $Id: pgmodule.c,v 1.84 2008/11/21 17:25:28 cito Exp $
  * PyGres, version 2.2 A Python interface for PostgreSQL database. Written by
  * D'Arcy J.M. Cain, (darcy at druid.net).  Based heavily on code written by
  * Pascal Andre, andre at chimay.via.ecp.fr. Copyright (c) 1995, Pascal Andre
@@ -87,21 +87,15 @@
 #define MAX_BUFFER_SIZE 8192	/* maximum transaction size */
 
 #ifndef NO_DIRECT
-#define DIRECT_ACCESS	1		/* enables direct access functions */
+#define DIRECT_ACCESS 1			/* enables direct access functions */
 #endif
 
 #ifndef NO_LARGE
-#define LARGE_OBJECTS	1		/* enables large objects support */
+#define LARGE_OBJECTS 1			/* enables large objects support */
 #endif
 
 #ifndef NO_DEF_VAR
-#define DEFAULT_VARS	1		/* enables default variables use */
-#endif
-
-/* In 7.4 PQfreeNotify was deprecated and PQfreemem is used instead.
-   A macro exists in 7.4 for backwards compatibility. */
-#ifndef PQfreeNotify /* must be earlier than 7.4 */
-#define PQfreemem PQfreeNotify
+#define DEFAULT_VARS 1			/* enables default variables use */
 #endif
 
 /* Before 8.0, PQsetdbLogin was not thread-safe with kerberos. */
@@ -115,13 +109,13 @@
 
 #ifdef DEFAULT_VARS
 
-static PyObject *pg_default_host;		/* default database host */
-static PyObject *pg_default_base;		/* default database name */
+static PyObject *pg_default_host;	/* default database host */
+static PyObject *pg_default_base;	/* default database name */
 static PyObject *pg_default_opt;	/* default connection options */
 static PyObject *pg_default_tty;	/* default debug tty */
-static PyObject *pg_default_port;		/* default connection port */
-static PyObject *pg_default_user;		/* default username */
-static PyObject *pg_default_passwd;		/* default password */
+static PyObject *pg_default_port;	/* default connection port */
+static PyObject *pg_default_user;	/* default username */
+static PyObject *pg_default_passwd;	/* default password */
 #endif	/* DEFAULT_VARS */
 
 DL_EXPORT(void) init_pg(void);
@@ -2674,8 +2668,6 @@
 	return Py_None;
 }
 
-#ifdef PQfreeNotify /* must be 7.4 or later */
-
 /* get transaction state */
 static char pg_transaction__doc__[] =
 "Returns the current transaction status.";
@@ -2732,8 +2724,6 @@
 	return Py_None;
 }
 
-#endif /* 7.4 or later */
-
 #ifdef LARGE_OBJECTS
 /* creates large object */
 static char pg_locreate__doc__[] =
@@ -2844,12 +2834,10 @@
 			pg_getnotify__doc__},
 	{"inserttable", (PyCFunction) pg_inserttable, METH_VARARGS,
 			pg_inserttable__doc__},
-#ifdef PQfreeNotify /* must be 7.4 or later */
 	{"transaction", (PyCFunction) pg_transaction, METH_VARARGS,
 			pg_transaction__doc__},
 	{"parameter", (PyCFunction) pg_parameter, METH_VARARGS,
 			pg_parameter__doc__},
-#endif
 
 #ifdef DIRECT_ACCESS
 	{"putline", (PyCFunction) pg_putline, 1, pg_putline__doc__},
@@ -3012,7 +3000,6 @@
 };
 
 
-
 /* --------------------------------------------------------------------- */
 
 /* MODULE FUNCTIONS */
@@ -3560,14 +3547,12 @@
 	PyDict_SetItemString(dict, "RESULT_DDL", PyInt_FromLong(RESULT_DDL));
 	PyDict_SetItemString(dict, "RESULT_DQL", PyInt_FromLong(RESULT_DQL));
 
-#ifdef PQfreeNotify	/* must be 7.4 or later */
 	/* transaction states */
 	PyDict_SetItemString(dict,"TRANS_IDLE",PyInt_FromLong(PQTRANS_IDLE));
 	PyDict_SetItemString(dict,"TRANS_ACTIVE",PyInt_FromLong(PQTRANS_ACTIVE));
 	PyDict_SetItemString(dict,"TRANS_INTRANS",PyInt_FromLong(PQTRANS_INTRANS));
 	PyDict_SetItemString(dict,"TRANS_INERROR",PyInt_FromLong(PQTRANS_INERROR));
 	PyDict_SetItemString(dict,"TRANS_UNKNOWN",PyInt_FromLong(PQTRANS_UNKNOWN));
-#endif
 
 #ifdef LARGE_OBJECTS
 	/* create mode for large objects */



More information about the PyGreSQL mailing list