浏览代码

Integration of both modules, first step.

 * Defines protecting header files from double inclusion fixed to match
   filenames.
 * Linked the module also with srdb1
 * Fixed path to header files in lib/srdb1.
 * Filenames of local included header files prefixed with km_ to match
   their real filenames
Jan Janak 16 年之前
父节点
当前提交
961212734a

+ 1 - 1
modules/db_mysql/Makefile

@@ -20,6 +20,6 @@ LIBS=-L/usr/lib/mysql -L$(LOCALBASE)/lib -L$(LOCALBASE)/lib/mysql \
 		-lmysqlclient -lz
 
 SERLIBPATH=../../lib
-SER_LIBS=$(SERLIBPATH)/srdb2/srdb2
+SER_LIBS=$(SERLIBPATH)/srdb2/srdb2 $(SERLIBPATH)/srdb1/srdb1
 
 include ../../Makefile.modules

+ 0 - 41
modules/db_mysql/km_Makefile

@@ -1,41 +0,0 @@
-# $Id$
-#
-# WARNING: do not run this directly, it should be run by the master Makefile
-
-include ../../Makefile.defs
-auto_gen=
-NAME=db_mysql.so
-
-# set CROSS_COMPILE to true if you want to skip
-# the autodetection
-# CROSS_COMPILE=true
-
-ifeq ($(CROSS_COMPILE),)
-MYSQLCFG=$(shell which mysql_config)
-endif
-
-ifneq ($(MYSQLCFG),)
-
-	# use autodetection
-	DEFS += $(shell $(MYSQLCFG) --include | sed 's/\(-I.*\)\/mysql/\1/g' )
-	LIBS = $(shell $(MYSQLCFG) --libs)
-
-else
-
-	# use standard know paths
-	# mysql.h locations (freebsd,openbsd  solaris)
-	DEFS +=-I$(LOCALBASE)/include -I$(LOCALBASE)/include/mysql \
-		-I$(LOCALBASE)/mysql/include/mysql -I$(LOCALBASE)/mysql/include \
-		-I$(SYSBASE)/include/mysql
-
-	# libmysqlclient locations on RH/Suse, Solaris /OpenBSD, FreeBSD
-	# (Debian does the right thing and puts it in /usr/lib)
-	LIBS=-L$(SYSBASE)/lib/mysql -L$(LOCALBASE)/lib -L$(LOCALBASE)/lib/mysql \
-		-L$(LOCALBASE)/mysql/lib/mysql/ \
-		-L$(LOCALBASE)/mysql/lib \
-		-L$(SYSBASE)/lib64/mysql \
-		-lm -lmysqlclient -lz
-
-endif
-
-include ../../Makefile.modules

+ 3 - 3
modules/db_mysql/km_db_mysql.c

@@ -42,9 +42,9 @@
  */
 
 #include "../../sr_module.h"
-#include "../../db/db.h"
-#include "dbase.h"
-#include "db_mysql.h"
+#include "../../lib/srdb1/db.h"
+#include "km_dbase.h"
+#include "km_db_mysql.h"
 
 #include <mysql/mysql.h>
 

+ 3 - 3
modules/db_mysql/km_db_mysql.h

@@ -35,11 +35,11 @@
  */
 
 
-#ifndef DB_MOD_H
-#define DB_MOD_H
+#ifndef KM_DB_MOD_H
+#define KM_DB_MOD_H
 
 extern unsigned int db_mysql_ping_interval;
 extern unsigned int db_mysql_timeout_interval;
 extern unsigned int db_mysql_auto_reconnect;
 
-#endif /* DB_MOD_H */
+#endif /* KM_DB_MOD_H */

+ 8 - 8
modules/db_mysql/km_dbase.c

@@ -40,14 +40,14 @@
 #include <mysql/mysql_version.h>
 #include "../../mem/mem.h"
 #include "../../dprint.h"
-#include "../../db/db_query.h"
-#include "../../db/db_ut.h"
-#include "val.h"
-#include "my_con.h"
-#include "res.h"
-#include "row.h"
-#include "db_mysql.h"
-#include "dbase.h"
+#include "../../lib/srdb1/db_query.h"
+#include "../../lib/srdb1/db_ut.h"
+#include "km_val.h"
+#include "km_my_con.h"
+#include "km_res.h"
+#include "km_row.h"
+#include "km_db_mysql.h"
+#include "km_dbase.h"
 
 
 /**

+ 8 - 8
modules/db_mysql/km_dbase.h

@@ -31,15 +31,15 @@
 
 
 
-#ifndef DBASE_H
-#define DBASE_H
+#ifndef KM_DBASE_H
+#define KM_DBASE_H
 
 
-#include "../../db/db_con.h"
-#include "../../db/db_res.h"
-#include "../../db/db_key.h"
-#include "../../db/db_op.h"
-#include "../../db/db_val.h"
+#include "../../lib/srdb1/db_con.h"
+#include "../../lib/srdb1/db_res.h"
+#include "../../lib/srdb1/db_key.h"
+#include "../../lib/srdb1/db_op.h"
+#include "../../lib/srdb1/db_val.h"
 #include "../../str.h"
 
 /*! \brief
@@ -125,4 +125,4 @@ int db_insert_update(const db_con_t* _h, const db_key_t* _k, const db_val_t* _v,
 int db_mysql_use_table(db_con_t* _h, const str* _t);
 
 
-#endif /* DBASE_H */
+#endif /* KM_DBASE_H */

+ 2 - 2
modules/db_mysql/km_my_con.c

@@ -28,8 +28,8 @@
  */
 
 
-#include "my_con.h"
-#include "db_mysql.h"
+#include "km_my_con.h"
+#include "km_db_mysql.h"
 #include <mysql/mysql_version.h>
 #include "../../mem/mem.h"
 #include "../../dprint.h"

+ 5 - 5
modules/db_mysql/km_my_con.h

@@ -29,11 +29,11 @@
  */
 
 
-#ifndef MY_CON_H
-#define MY_CON_H
+#ifndef KM_MY_CON_H
+#define KM_MY_CON_H
 
-#include "../../db/db_pool.h"
-#include "../../db/db_id.h"
+#include "../../lib/srdb1/db_pool.h"
+#include "../../lib/srdb1/db_id.h"
 
 #include <time.h>
 #include <mysql/mysql.h>
@@ -72,4 +72,4 @@ struct my_con* db_mysql_new_connection(const struct db_id* id);
  */
 void db_mysql_free_connection(struct pool_con* con);
 
-#endif /* MY_CON_H */
+#endif /* KM_MY_CON_H */

+ 4 - 4
modules/db_mysql/km_res.c

@@ -33,12 +33,12 @@
 
 #include <string.h>
 #include <mysql/mysql.h>
-#include "../../db/db_res.h"
+#include "../../lib/srdb1/db_res.h"
 #include "../../mem/mem.h"
 #include "../../dprint.h"
-#include "row.h"
-#include "my_con.h"
-#include "res.h"
+#include "km_row.h"
+#include "km_my_con.h"
+#include "km_res.h"
 
 
 /*!

+ 4 - 4
modules/db_mysql/km_res.h

@@ -31,11 +31,11 @@
  */
 
 
-#ifndef RES_H
-#define RES_H
+#ifndef KM_RES_H
+#define KM_RES_H
 
-#include "../../db/db_res.h"
-#include "../../db/db_con.h"
+#include "../../lib/srdb1/db_res.h"
+#include "../../lib/srdb1/db_con.h"
 
 
 /*!

+ 5 - 5
modules/db_mysql/km_row.c

@@ -31,11 +31,11 @@
 
 #include "../../dprint.h"
 #include "../../mem/mem.h"
-#include "../../db/db_row.h"
-#include "../../db/db_val.h"
-#include "my_con.h"
-#include "val.h"
-#include "row.h"
+#include "../../lib/srdb1/db_row.h"
+#include "../../lib/srdb1/db_val.h"
+#include "km_my_con.h"
+#include "km_val.h"
+#include "km_row.h"
 
 /*!
  * \brief Convert a row from result into DB API representation

+ 5 - 5
modules/db_mysql/km_row.h

@@ -31,12 +31,12 @@
  */
 
 
-#ifndef ROW_H
-#define ROW_H
+#ifndef KM_ROW_H
+#define KM_ROW_H
 
-#include "../../db/db_con.h"
-#include "../../db/db_res.h"
-#include "../../db/db_row.h"
+#include "../../lib/srdb1/db_con.h"
+#include "../../lib/srdb1/db_res.h"
+#include "../../lib/srdb1/db_row.h"
 
 
 /*!

+ 3 - 3
modules/db_mysql/km_val.c

@@ -28,9 +28,9 @@
  */
 
 #include "../../dprint.h"
-#include "../../db/db_ut.h"
-#include "val.h"
-#include "my_con.h"
+#include "../../lib/srdb1/db_ut.h"
+#include "km_val.h"
+#include "km_my_con.h"
 
 
 /*!

+ 4 - 4
modules/db_mysql/km_val.h

@@ -29,12 +29,12 @@
  */
 
 
-#ifndef VAL_H
-#define VAL_H
+#ifndef KM_VAL_H
+#define KM_VAL_H
 
 #include <mysql/mysql.h>
-#include "../../db/db_val.h"
-#include "../../db/db.h"
+#include "../../lib/srdb1/db_val.h"
+#include "../../lib/srdb1/db.h"
 
 
 /*!