[Serdev] postgres cosmetic changes

Jan Janak jan at iptel.org
Thu Jan 29 14:01:02 UTC 2004


Hello Greg,

Attached patch makes postgres module in the unstable branch compile and
load again (it didn't compile because of some changes I did a couple
days ago).

The changes are cosmetic only.

   Jan.
-------------- next part --------------
diff -Naur sip_router/modules/postgres/con_postgres.h unstable/modules/postgres/con_postgres.h
--- sip_router/modules/postgres/con_postgres.h	2003-04-08 03:25:35.000000000 +0200
+++ unstable/modules/postgres/con_postgres.h	2004-01-29 14:47:06.000000000 +0100
@@ -46,6 +46,7 @@
  * Postgres specific connection data
  */
 struct con_postgres {
+	int connected;
 	char *sqlurl;	/* the url we are connected to, all connection memory
 			   parents from this */
 	PGconn *con;	/* this is the postgres connection */
@@ -60,6 +61,7 @@
 #define CON_CONNECTION(db_con) (((struct con_postgres*)((db_con)->tail))->con)
 #define CON_FP(db_con)        (((struct con_postgres*)((db_con)->tail))->fp)
 #define CON_PID(db_con)       (((struct con_postgres*)((db_con)->tail))->tpid)
+#define CON_CONNECTED(db_con) (((struct con_postgres*)((db_con)->tail))->connected)
 
 #define PLOG(f,s) LOG(L_ERR, "PG[%d] %s %s\n",__LINE__,f,s)
 #define DLOG(f,s) LOG(L_INFO, "PG[%d] %s %s\n",__LINE__,f,s)
diff -Naur sip_router/modules/postgres/db_con.c unstable/modules/postgres/db_con.c
--- sip_router/modules/postgres/db_con.c	2003-04-08 03:25:35.000000000 +0200
+++ unstable/modules/postgres/db_con.c	2004-01-29 14:41:50.000000000 +0100
@@ -37,12 +37,12 @@
  */
 
 #include <string.h>
-#include "../../db/db_con.h"
 #include "../../dprint.h"
 #include "../../mem/mem.h"
 #include "defs.h"
 #include "con_postgres.h"
 #include "aug_std.h"
+#include "db_con.h"
 
 /*
  * Store name of table that will be used by
diff -Naur sip_router/modules/postgres/db_con.h unstable/modules/postgres/db_con.h
--- sip_router/modules/postgres/db_con.h	1970-01-01 01:00:00.000000000 +0100
+++ unstable/modules/postgres/db_con.h	2004-01-29 14:44:09.000000000 +0100
@@ -0,0 +1,47 @@
+/*
+ * $Id: db_con.c,v 1.1 2003/04/08 01:25:35 lgfausak Exp $
+ *
+ * POSTGRES module, portions of this code were templated using
+ * the mysql module, thus it's similarity.
+ *
+ * Copyright (C) 2003 August.Net Services, LLC
+ *
+ * This file is part of ser, a free SIP server.
+ *
+ * ser is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version
+ *
+ * For a license to use the ser software under conditions
+ * other than those described here, or to purchase support for this
+ * software, please contact iptel.org by e-mail at the following addresses:
+ *  info at iptel.org
+ *
+ * ser is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * History
+ * -------
+ * 2003-04-06 initial code written (Greg Fausak/Andy Fullford)
+ */
+
+#ifndef PG_DB_CON_H
+#define PG_DB_CON_H
+
+#include "../../db/db_con.h"
+
+/*
+ * Store name of table that will be used by
+ * subsequent database functions
+ */
+int use_table(db_con_t* _h, const char* _t);
+	
+
+#endif /* PG_DB_CON_H */
diff -Naur sip_router/modules/postgres/db_mod.c unstable/modules/postgres/db_mod.c
--- sip_router/modules/postgres/db_mod.c	2003-10-08 15:07:22.000000000 +0200
+++ unstable/modules/postgres/db_mod.c	2004-01-29 14:41:29.000000000 +0100
@@ -35,6 +35,7 @@
 
 #include <stdio.h>
 #include "../../sr_module.h"
+#include "db_con.h"
 #include "dbase.h"
 
 MODULE_VERSION
diff -Naur sip_router/modules/postgres/db_res.c unstable/modules/postgres/db_res.c
--- sip_router/modules/postgres/db_res.c	2003-04-08 03:25:35.000000000 +0200
+++ unstable/modules/postgres/db_res.c	2004-01-29 14:44:46.000000000 +0100
@@ -38,6 +38,7 @@
 
 #include <stdlib.h>
 #include "../../db/db_res.h"
+#include "../../db/db_con.h"
 #include "../../dprint.h"
 #include "../../mem/mem.h"
 #include "defs.h"


More information about the Serdev mailing list