Browse code

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 authored on 16/02/2009 21:58:33
Showing 14 changed files
... ...
@@ -20,6 +20,6 @@ LIBS=-L/usr/lib/mysql -L$(LOCALBASE)/lib -L$(LOCALBASE)/lib/mysql \
20 20
 		-lmysqlclient -lz
21 21
 
22 22
 SERLIBPATH=../../lib
23
-SER_LIBS=$(SERLIBPATH)/srdb2/srdb2
23
+SER_LIBS=$(SERLIBPATH)/srdb2/srdb2 $(SERLIBPATH)/srdb1/srdb1
24 24
 
25 25
 include ../../Makefile.modules
26 26
deleted file mode 100644
... ...
@@ -1,41 +0,0 @@
1
-# $Id$
2
-#
3
-# WARNING: do not run this directly, it should be run by the master Makefile
4
-
5
-include ../../Makefile.defs
6
-auto_gen=
7
-NAME=db_mysql.so
8
-
9
-# set CROSS_COMPILE to true if you want to skip
10
-# the autodetection
11
-# CROSS_COMPILE=true
12
-
13
-ifeq ($(CROSS_COMPILE),)
14
-MYSQLCFG=$(shell which mysql_config)
15
-endif
16
-
17
-ifneq ($(MYSQLCFG),)
18
-
19
-	# use autodetection
20
-	DEFS += $(shell $(MYSQLCFG) --include | sed 's/\(-I.*\)\/mysql/\1/g' )
21
-	LIBS = $(shell $(MYSQLCFG) --libs)
22
-
23
-else
24
-
25
-	# use standard know paths
26
-	# mysql.h locations (freebsd,openbsd  solaris)
27
-	DEFS +=-I$(LOCALBASE)/include -I$(LOCALBASE)/include/mysql \
28
-		-I$(LOCALBASE)/mysql/include/mysql -I$(LOCALBASE)/mysql/include \
29
-		-I$(SYSBASE)/include/mysql
30
-
31
-	# libmysqlclient locations on RH/Suse, Solaris /OpenBSD, FreeBSD
32
-	# (Debian does the right thing and puts it in /usr/lib)
33
-	LIBS=-L$(SYSBASE)/lib/mysql -L$(LOCALBASE)/lib -L$(LOCALBASE)/lib/mysql \
34
-		-L$(LOCALBASE)/mysql/lib/mysql/ \
35
-		-L$(LOCALBASE)/mysql/lib \
36
-		-L$(SYSBASE)/lib64/mysql \
37
-		-lm -lmysqlclient -lz
38
-
39
-endif
40
-
41
-include ../../Makefile.modules
... ...
@@ -42,9 +42,9 @@
42 42
  */
43 43
 
44 44
 #include "../../sr_module.h"
45
-#include "../../db/db.h"
46
-#include "dbase.h"
47
-#include "db_mysql.h"
45
+#include "../../lib/srdb1/db.h"
46
+#include "km_dbase.h"
47
+#include "km_db_mysql.h"
48 48
 
49 49
 #include <mysql/mysql.h>
50 50
 
... ...
@@ -35,11 +35,11 @@
35 35
  */
36 36
 
37 37
 
38
-#ifndef DB_MOD_H
39
-#define DB_MOD_H
38
+#ifndef KM_DB_MOD_H
39
+#define KM_DB_MOD_H
40 40
 
41 41
 extern unsigned int db_mysql_ping_interval;
42 42
 extern unsigned int db_mysql_timeout_interval;
43 43
 extern unsigned int db_mysql_auto_reconnect;
44 44
 
45
-#endif /* DB_MOD_H */
45
+#endif /* KM_DB_MOD_H */
... ...
@@ -40,14 +40,14 @@
40 40
 #include <mysql/mysql_version.h>
41 41
 #include "../../mem/mem.h"
42 42
 #include "../../dprint.h"
43
-#include "../../db/db_query.h"
44
-#include "../../db/db_ut.h"
45
-#include "val.h"
46
-#include "my_con.h"
47
-#include "res.h"
48
-#include "row.h"
49
-#include "db_mysql.h"
50
-#include "dbase.h"
43
+#include "../../lib/srdb1/db_query.h"
44
+#include "../../lib/srdb1/db_ut.h"
45
+#include "km_val.h"
46
+#include "km_my_con.h"
47
+#include "km_res.h"
48
+#include "km_row.h"
49
+#include "km_db_mysql.h"
50
+#include "km_dbase.h"
51 51
 
52 52
 
53 53
 /**
... ...
@@ -31,15 +31,15 @@
31 31
 
32 32
 
33 33
 
34
-#ifndef DBASE_H
35
-#define DBASE_H
34
+#ifndef KM_DBASE_H
35
+#define KM_DBASE_H
36 36
 
37 37
 
38
-#include "../../db/db_con.h"
39
-#include "../../db/db_res.h"
40
-#include "../../db/db_key.h"
41
-#include "../../db/db_op.h"
42
-#include "../../db/db_val.h"
38
+#include "../../lib/srdb1/db_con.h"
39
+#include "../../lib/srdb1/db_res.h"
40
+#include "../../lib/srdb1/db_key.h"
41
+#include "../../lib/srdb1/db_op.h"
42
+#include "../../lib/srdb1/db_val.h"
43 43
 #include "../../str.h"
44 44
 
45 45
 /*! \brief
... ...
@@ -125,4 +125,4 @@ int db_insert_update(const db_con_t* _h, const db_key_t* _k, const db_val_t* _v,
125 125
 int db_mysql_use_table(db_con_t* _h, const str* _t);
126 126
 
127 127
 
128
-#endif /* DBASE_H */
128
+#endif /* KM_DBASE_H */
... ...
@@ -28,8 +28,8 @@
28 28
  */
29 29
 
30 30
 
31
-#include "my_con.h"
32
-#include "db_mysql.h"
31
+#include "km_my_con.h"
32
+#include "km_db_mysql.h"
33 33
 #include <mysql/mysql_version.h>
34 34
 #include "../../mem/mem.h"
35 35
 #include "../../dprint.h"
... ...
@@ -29,11 +29,11 @@
29 29
  */
30 30
 
31 31
 
32
-#ifndef MY_CON_H
33
-#define MY_CON_H
32
+#ifndef KM_MY_CON_H
33
+#define KM_MY_CON_H
34 34
 
35
-#include "../../db/db_pool.h"
36
-#include "../../db/db_id.h"
35
+#include "../../lib/srdb1/db_pool.h"
36
+#include "../../lib/srdb1/db_id.h"
37 37
 
38 38
 #include <time.h>
39 39
 #include <mysql/mysql.h>
... ...
@@ -72,4 +72,4 @@ struct my_con* db_mysql_new_connection(const struct db_id* id);
72 72
  */
73 73
 void db_mysql_free_connection(struct pool_con* con);
74 74
 
75
-#endif /* MY_CON_H */
75
+#endif /* KM_MY_CON_H */
... ...
@@ -33,12 +33,12 @@
33 33
 
34 34
 #include <string.h>
35 35
 #include <mysql/mysql.h>
36
-#include "../../db/db_res.h"
36
+#include "../../lib/srdb1/db_res.h"
37 37
 #include "../../mem/mem.h"
38 38
 #include "../../dprint.h"
39
-#include "row.h"
40
-#include "my_con.h"
41
-#include "res.h"
39
+#include "km_row.h"
40
+#include "km_my_con.h"
41
+#include "km_res.h"
42 42
 
43 43
 
44 44
 /*!
... ...
@@ -31,11 +31,11 @@
31 31
  */
32 32
 
33 33
 
34
-#ifndef RES_H
35
-#define RES_H
34
+#ifndef KM_RES_H
35
+#define KM_RES_H
36 36
 
37
-#include "../../db/db_res.h"
38
-#include "../../db/db_con.h"
37
+#include "../../lib/srdb1/db_res.h"
38
+#include "../../lib/srdb1/db_con.h"
39 39
 
40 40
 
41 41
 /*!
... ...
@@ -31,11 +31,11 @@
31 31
 
32 32
 #include "../../dprint.h"
33 33
 #include "../../mem/mem.h"
34
-#include "../../db/db_row.h"
35
-#include "../../db/db_val.h"
36
-#include "my_con.h"
37
-#include "val.h"
38
-#include "row.h"
34
+#include "../../lib/srdb1/db_row.h"
35
+#include "../../lib/srdb1/db_val.h"
36
+#include "km_my_con.h"
37
+#include "km_val.h"
38
+#include "km_row.h"
39 39
 
40 40
 /*!
41 41
  * \brief Convert a row from result into DB API representation
... ...
@@ -31,12 +31,12 @@
31 31
  */
32 32
 
33 33
 
34
-#ifndef ROW_H
35
-#define ROW_H
34
+#ifndef KM_ROW_H
35
+#define KM_ROW_H
36 36
 
37
-#include "../../db/db_con.h"
38
-#include "../../db/db_res.h"
39
-#include "../../db/db_row.h"
37
+#include "../../lib/srdb1/db_con.h"
38
+#include "../../lib/srdb1/db_res.h"
39
+#include "../../lib/srdb1/db_row.h"
40 40
 
41 41
 
42 42
 /*!
... ...
@@ -28,9 +28,9 @@
28 28
  */
29 29
 
30 30
 #include "../../dprint.h"
31
-#include "../../db/db_ut.h"
32
-#include "val.h"
33
-#include "my_con.h"
31
+#include "../../lib/srdb1/db_ut.h"
32
+#include "km_val.h"
33
+#include "km_my_con.h"
34 34
 
35 35
 
36 36
 /*!
... ...
@@ -29,12 +29,12 @@
29 29
  */
30 30
 
31 31
 
32
-#ifndef VAL_H
33
-#define VAL_H
32
+#ifndef KM_VAL_H
33
+#define KM_VAL_H
34 34
 
35 35
 #include <mysql/mysql.h>
36
-#include "../../db/db_val.h"
37
-#include "../../db/db.h"
36
+#include "../../lib/srdb1/db_val.h"
37
+#include "../../lib/srdb1/db.h"
38 38
 
39 39
 
40 40
 /*!