Browse code

core, lib, modules: restructured source code tree

- new folder src/ to hold the source code for main project applications
- main.c is in src/
- all core files are subfolder are in src/core/
- modules are in src/modules/
- libs are in src/lib/
- application Makefiles are in src/
- application binary is built in src/ (src/kamailio)

Daniel-Constantin Mierla authored on 07/12/2016 11:03:51
Showing 1 changed files
1 1
deleted file mode 100644
... ...
@@ -1,170 +0,0 @@
1
-/*
2
- * MySQL module core functions
3
- *
4
- * Copyright (C) 2001-2003 FhG Fokus
5
- * Copyright (C) 2008 1&1 Internet AG
6
- *
7
- * This file is part of Kamailio, a free SIP server.
8
- *
9
- * Kamailio is free software; you can redistribute it and/or modify
10
- * it under the terms of the GNU General Public License as published by
11
- * the Free Software Foundation; either version 2 of the License, or
12
- * (at your option) any later version
13
- *
14
- * Kamailio is distributed in the hope that it will be useful,
15
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
- * GNU General Public License for more details.
18
- *
19
- * You should have received a copy of the GNU General Public License 
20
- * along with this program; if not, write to the Free Software 
21
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
22
- */
23
-
24
-/*! \file
25
- *  \brief DB_MYSQL :: Core
26
- *  \ingroup db_mysql
27
- *  Module: \ref db_mysql
28
- */
29
-
30
-
31
-
32
-#ifndef KM_DBASE_H
33
-#define KM_DBASE_H
34
-
35
-
36
-#include "../../lib/srdb1/db_con.h"
37
-#include "../../lib/srdb1/db_res.h"
38
-#include "../../lib/srdb1/db_key.h"
39
-#include "../../lib/srdb1/db_op.h"
40
-#include "../../lib/srdb1/db_val.h"
41
-#include "../../lib/srdb1/db_locking.h"
42
-#include "../../str.h"
43
-
44
-/*! \brief
45
- * Initialize database connection
46
- */
47
-db1_con_t* db_mysql_init(const str* _sqlurl);
48
-
49
-
50
-/*! \brief
51
- * Close a database connection
52
- */
53
-void db_mysql_close(db1_con_t* _h);
54
-
55
-
56
-/*! \brief
57
- * Free all memory allocated by get_result
58
- */
59
-int db_mysql_free_result(const db1_con_t* _h, db1_res_t* _r);
60
-
61
-
62
-/*! \brief
63
- * Do a query
64
- */
65
-int db_mysql_query(const db1_con_t* _h, const db_key_t* _k, const db_op_t* _op,
66
-	     const db_val_t* _v, const db_key_t* _c, const int _n, const int _nc,
67
-	     const db_key_t _o, db1_res_t** _r);
68
-
69
-
70
-/*! \brief
71
- * fetch rows from a result
72
- */
73
-int db_mysql_fetch_result(const db1_con_t* _h, db1_res_t** _r, const int nrows);
74
-
75
-
76
-/*! \brief
77
- * Raw SQL query
78
- */
79
-int db_mysql_raw_query(const db1_con_t* _h, const str* _s, db1_res_t** _r);
80
-
81
-
82
-/*! \brief
83
- * Raw SQL query via async framework
84
- */
85
-int db_mysql_raw_query_async(const db1_con_t* _h, const str* _s);
86
-
87
-
88
-/*! \brief
89
- * Insert a row into table
90
- */
91
-int db_mysql_insert(const db1_con_t* _h, const db_key_t* _k, const db_val_t* _v, const int _n);
92
-
93
-
94
-/*! \brief
95
- * Delete a row from table
96
- */
97
-int db_mysql_delete(const db1_con_t* _h, const db_key_t* _k, const 
98
-	db_op_t* _o, const db_val_t* _v, const int _n);
99
-
100
-
101
-/*! \brief
102
- * Update a row in table
103
- */
104
-int db_mysql_update(const db1_con_t* _h, const db_key_t* _k, const db_op_t* _o,
105
-	const db_val_t* _v, const db_key_t* _uk, const db_val_t* _uv, const int _n,
106
-	const int _un);
107
-
108
-
109
-/*! \brief
110
- * Just like insert, but replace the row if it exists
111
- */
112
-int db_mysql_replace(const db1_con_t* handle, const db_key_t* keys,
113
-		const db_val_t* vals, const int n, const int _un, const int _m);
114
-
115
-/*! \brief
116
- * Returns the last inserted ID
117
- */
118
-int db_mysql_last_inserted_id(const db1_con_t* _h);
119
-
120
-
121
-/*! \brief
122
- * Returns number of affected rows for last query
123
- */
124
-int db_mysql_affected_rows(const db1_con_t* _h);
125
-
126
-/*! \brief
127
- * Starts transaction
128
- */
129
-int db_mysql_start_transaction(db1_con_t* _h, db_locking_t _l);
130
-
131
-/*! \brief
132
- * Commits transaction
133
- */
134
-int db_mysql_end_transaction(db1_con_t* _h);
135
-
136
-/*! \brief
137
- * Aborts transaction
138
- */
139
-int db_mysql_abort_transaction(db1_con_t* _h);
140
-
141
-
142
-/*! \brief
143
- * Insert a row into table, update on duplicate key
144
- */
145
-int db_mysql_insert_update(const db1_con_t* _h, const db_key_t* _k, const db_val_t* _v,
146
-	const int _n);
147
-
148
-
149
-/*! \brief
150
- * Insert a row into table
151
- */
152
-int db_mysql_insert_delayed(const db1_con_t* _h, const db_key_t* _k,
153
-		const db_val_t* _v, const int _n);
154
-
155
-
156
-/*! \brief
157
- * Insert a row into table via async framework
158
- */
159
-int db_mysql_insert_async(const db1_con_t* _h, const db_key_t* _k,
160
-		const db_val_t* _v, const int _n);
161
-
162
-
163
-/*! \brief
164
- * Store name of table that will be used by
165
- * subsequent database functions
166
- */
167
-int db_mysql_use_table(db1_con_t* _h, const str* _t);
168
-
169
-
170
-#endif /* KM_DBASE_H */
Browse code

db_mysql: Remove SVN ID's, remove history sections

Olle E. Johansson authored on 11/03/2015 15:26:21
Showing 1 changed files
... ...
@@ -1,6 +1,4 @@
1 1
 /*
2
- * $Id$
3
- *
4 2
  * MySQL module core functions
5 3
  *
6 4
  * Copyright (C) 2001-2003 FhG Fokus
Browse code

all: updated FSF address in GPL text

Anthony Messina authored on 04/07/2014 09:36:37 • Daniel-Constantin Mierla committed on 04/07/2014 09:37:36
Showing 1 changed files
... ...
@@ -20,7 +20,7 @@
20 20
  *
21 21
  * You should have received a copy of the GNU General Public License 
22 22
  * along with this program; if not, write to the Free Software 
23
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
23
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
24 24
  */
25 25
 
26 26
 /*! \file
Browse code

db_mysql: implemented async raw query and async insert

- both use the core async framework

Daniel-Constantin Mierla authored on 14/04/2014 20:17:51
Showing 1 changed files
... ...
@@ -81,6 +81,12 @@ int db_mysql_fetch_result(const db1_con_t* _h, db1_res_t** _r, const int nrows);
81 81
 int db_mysql_raw_query(const db1_con_t* _h, const str* _s, db1_res_t** _r);
82 82
 
83 83
 
84
+/*! \brief
85
+ * Raw SQL query via async framework
86
+ */
87
+int db_mysql_raw_query_async(const db1_con_t* _h, const str* _s);
88
+
89
+
84 90
 /*! \brief
85 91
  * Insert a row into table
86 92
  */
... ...
@@ -149,6 +155,13 @@ int db_mysql_insert_delayed(const db1_con_t* _h, const db_key_t* _k,
149 155
 		const db_val_t* _v, const int _n);
150 156
 
151 157
 
158
+/*! \brief
159
+ * Insert a row into table via async framework
160
+ */
161
+int db_mysql_insert_async(const db1_con_t* _h, const db_key_t* _k,
162
+		const db_val_t* _v, const int _n);
163
+
164
+
152 165
 /*! \brief
153 166
  * Store name of table that will be used by
154 167
  * subsequent database functions
Browse code

db_mysql: fix segfault when recursive queries are made

The MySQL result object (MYSQL_RES) should not be stored within the
srdb1 connection object, but rather within the srdb1 result object.
Otherwise recursive queries overwrite each other's result sets, which
results in segfault.

Richard Fuchs authored on 10/04/2013 13:34:49
Showing 1 changed files
... ...
@@ -58,7 +58,7 @@ void db_mysql_close(db1_con_t* _h);
58 58
 /*! \brief
59 59
  * Free all memory allocated by get_result
60 60
  */
61
-int db_mysql_free_result(db1_con_t* _h, db1_res_t* _r);
61
+int db_mysql_free_result(const db1_con_t* _h, db1_res_t* _r);
62 62
 
63 63
 
64 64
 /*! \brief
Browse code

db_mysql Add transaction support

Patch contributed via Google+ by Håkon Nassjöen <haakon.nassjoen@gmail.com>

Olle E. Johansson authored on 02/04/2013 12:13:01
Showing 1 changed files
... ...
@@ -40,6 +40,7 @@
40 40
 #include "../../lib/srdb1/db_key.h"
41 41
 #include "../../lib/srdb1/db_op.h"
42 42
 #include "../../lib/srdb1/db_val.h"
43
+#include "../../lib/srdb1/db_locking.h"
43 44
 #include "../../str.h"
44 45
 
45 46
 /*! \brief
... ...
@@ -118,6 +119,21 @@ int db_mysql_last_inserted_id(const db1_con_t* _h);
118 119
  */
119 120
 int db_mysql_affected_rows(const db1_con_t* _h);
120 121
 
122
+/*! \brief
123
+ * Starts transaction
124
+ */
125
+int db_mysql_start_transaction(db1_con_t* _h, db_locking_t _l);
126
+
127
+/*! \brief
128
+ * Commits transaction
129
+ */
130
+int db_mysql_end_transaction(db1_con_t* _h);
131
+
132
+/*! \brief
133
+ * Aborts transaction
134
+ */
135
+int db_mysql_abort_transaction(db1_con_t* _h);
136
+
121 137
 
122 138
 /*! \brief
123 139
  * Insert a row into table, update on duplicate key
Browse code

db_mysql: DB API v1 replace prototype updated

Daniel-Constantin Mierla authored on 13/03/2012 13:08:08
Showing 1 changed files
... ...
@@ -104,7 +104,8 @@ int db_mysql_update(const db1_con_t* _h, const db_key_t* _k, const db_op_t* _o,
104 104
 /*! \brief
105 105
  * Just like insert, but replace the row if it exists
106 106
  */
107
-int db_mysql_replace(const db1_con_t* handle, const db_key_t* keys, const db_val_t* vals, const int n);
107
+int db_mysql_replace(const db1_con_t* handle, const db_key_t* keys,
108
+		const db_val_t* vals, const int n, const int _un, const int _m);
108 109
 
109 110
 /*! \brief
110 111
  * Returns the last inserted ID
Browse code

db_mysql: initialize DB API in mod_register() function

- internal buffer sql_buf initialized in this function
- renamed sql_buf to mysql_sql_buf to avoid potential conflict with
global variable in srdb1 library

Daniel-Constantin Mierla authored on 01/11/2011 19:18:36
Showing 1 changed files
... ...
@@ -139,11 +139,4 @@ int db_mysql_insert_delayed(const db1_con_t* _h, const db_key_t* _k,
139 139
 int db_mysql_use_table(db1_con_t* _h, const str* _t);
140 140
 
141 141
 
142
-/**
143
- * Allocate a buffer for database module
144
- * No function should be called before this
145
- * \return zero on success, negative value on failure
146
- */
147
-int db_mysql_alloc_buffer(void);
148
-
149 142
 #endif /* KM_DBASE_H */
Browse code

modules/db_mysql: Implement affected_rows for mysql

Alex Hermann authored on 09/08/2011 09:58:01
Showing 1 changed files
... ...
@@ -111,6 +111,13 @@ int db_mysql_replace(const db1_con_t* handle, const db_key_t* keys, const db_val
111 111
  */
112 112
 int db_mysql_last_inserted_id(const db1_con_t* _h);
113 113
 
114
+
115
+/*! \brief
116
+ * Returns number of affected rows for last query
117
+ */
118
+int db_mysql_affected_rows(const db1_con_t* _h);
119
+
120
+
114 121
 /*! \brief
115 122
  * Insert a row into table, update on duplicate key
116 123
  */
Browse code

db_mysql: renamed some internal functions

- 'mysql' added in the name of some functions from DB APIv1 to be
consistent with the rest of them

Daniel-Constantin Mierla authored on 17/08/2011 22:35:48
Showing 1 changed files
... ...
@@ -109,12 +109,12 @@ int db_mysql_replace(const db1_con_t* handle, const db_key_t* keys, const db_val
109 109
 /*! \brief
110 110
  * Returns the last inserted ID
111 111
  */
112
-int db_last_inserted_id(const db1_con_t* _h);
112
+int db_mysql_last_inserted_id(const db1_con_t* _h);
113 113
 
114 114
 /*! \brief
115 115
  * Insert a row into table, update on duplicate key
116 116
  */
117
-int db_insert_update(const db1_con_t* _h, const db_key_t* _k, const db_val_t* _v,
117
+int db_mysql_insert_update(const db1_con_t* _h, const db_key_t* _k, const db_val_t* _v,
118 118
 	const int _n);
119 119
 
120 120
 
Browse code

db_mysql: insert delayed implemented for DB API v1

Daniel-Constantin Mierla authored on 17/08/2011 22:33:51
Showing 1 changed files
... ...
@@ -118,6 +118,13 @@ int db_insert_update(const db1_con_t* _h, const db_key_t* _k, const db_val_t* _v
118 118
 	const int _n);
119 119
 
120 120
 
121
+/*! \brief
122
+ * Insert a row into table
123
+ */
124
+int db_mysql_insert_delayed(const db1_con_t* _h, const db_key_t* _k,
125
+		const db_val_t* _v, const int _n);
126
+
127
+
121 128
 /*! \brief
122 129
  * Store name of table that will be used by
123 130
  * subsequent database functions
Browse code

modules/db_mysql: Add function declaration to prevent compiler warning.

- Define db_mysql_alloc_buffer(void) in km_dbase.h.

Timo Reimann authored on 17/08/2011 09:33:55
Showing 1 changed files
... ...
@@ -125,4 +125,11 @@ int db_insert_update(const db1_con_t* _h, const db_key_t* _k, const db_val_t* _v
125 125
 int db_mysql_use_table(db1_con_t* _h, const str* _t);
126 126
 
127 127
 
128
+/**
129
+ * Allocate a buffer for database module
130
+ * No function should be called before this
131
+ * \return zero on success, negative value on failure
132
+ */
133
+int db_mysql_alloc_buffer(void);
134
+
128 135
 #endif /* KM_DBASE_H */
Browse code

db_res renamed to db1_res in files originating from kamailio/db_mysql.

The structure db_res has been renamed in lib/srdb1 to db1_res, thus we need to
change the name of the structure in all files originating from
kamailio/modules/db_mysql (and using lib/srdb1).

Jan Janak authored on 16/02/2009 22:13:16
Showing 1 changed files
... ...
@@ -57,7 +57,7 @@ void db_mysql_close(db1_con_t* _h);
57 57
 /*! \brief
58 58
  * Free all memory allocated by get_result
59 59
  */
60
-int db_mysql_free_result(db1_con_t* _h, db_res_t* _r);
60
+int db_mysql_free_result(db1_con_t* _h, db1_res_t* _r);
61 61
 
62 62
 
63 63
 /*! \brief
... ...
@@ -65,19 +65,19 @@ int db_mysql_free_result(db1_con_t* _h, db_res_t* _r);
65 65
  */
66 66
 int db_mysql_query(const db1_con_t* _h, const db_key_t* _k, const db_op_t* _op,
67 67
 	     const db_val_t* _v, const db_key_t* _c, const int _n, const int _nc,
68
-	     const db_key_t _o, db_res_t** _r);
68
+	     const db_key_t _o, db1_res_t** _r);
69 69
 
70 70
 
71 71
 /*! \brief
72 72
  * fetch rows from a result
73 73
  */
74
-int db_mysql_fetch_result(const db1_con_t* _h, db_res_t** _r, const int nrows);
74
+int db_mysql_fetch_result(const db1_con_t* _h, db1_res_t** _r, const int nrows);
75 75
 
76 76
 
77 77
 /*! \brief
78 78
  * Raw SQL query
79 79
  */
80
-int db_mysql_raw_query(const db1_con_t* _h, const str* _s, db_res_t** _r);
80
+int db_mysql_raw_query(const db1_con_t* _h, const str* _s, db1_res_t** _r);
81 81
 
82 82
 
83 83
 /*! \brief
Browse code

db_con renamed to db1_con in files originating from kamailio/db_mysql.

The structure db_con has been renamed in lib/srdb1 to db1_con, thus we
need to change the name of the structure in all files originating from
kamailio/modules/db_mysql (and using lib/srdb1).

Jan Janak authored on 16/02/2009 22:09:32
Showing 1 changed files
... ...
@@ -45,25 +45,25 @@
45 45
 /*! \brief
46 46
  * Initialize database connection
47 47
  */
48
-db_con_t* db_mysql_init(const str* _sqlurl);
48
+db1_con_t* db_mysql_init(const str* _sqlurl);
49 49
 
50 50
 
51 51
 /*! \brief
52 52
  * Close a database connection
53 53
  */
54
-void db_mysql_close(db_con_t* _h);
54
+void db_mysql_close(db1_con_t* _h);
55 55
 
56 56
 
57 57
 /*! \brief
58 58
  * Free all memory allocated by get_result
59 59
  */
60
-int db_mysql_free_result(db_con_t* _h, db_res_t* _r);
60
+int db_mysql_free_result(db1_con_t* _h, db_res_t* _r);
61 61
 
62 62
 
63 63
 /*! \brief
64 64
  * Do a query
65 65
  */
66
-int db_mysql_query(const db_con_t* _h, const db_key_t* _k, const db_op_t* _op,
66
+int db_mysql_query(const db1_con_t* _h, const db_key_t* _k, const db_op_t* _op,
67 67
 	     const db_val_t* _v, const db_key_t* _c, const int _n, const int _nc,
68 68
 	     const db_key_t _o, db_res_t** _r);
69 69
 
... ...
@@ -71,32 +71,32 @@ int db_mysql_query(const db_con_t* _h, const db_key_t* _k, const db_op_t* _op,
71 71
 /*! \brief
72 72
  * fetch rows from a result
73 73
  */
74
-int db_mysql_fetch_result(const db_con_t* _h, db_res_t** _r, const int nrows);
74
+int db_mysql_fetch_result(const db1_con_t* _h, db_res_t** _r, const int nrows);
75 75
 
76 76
 
77 77
 /*! \brief
78 78
  * Raw SQL query
79 79
  */
80
-int db_mysql_raw_query(const db_con_t* _h, const str* _s, db_res_t** _r);
80
+int db_mysql_raw_query(const db1_con_t* _h, const str* _s, db_res_t** _r);
81 81
 
82 82
 
83 83
 /*! \brief
84 84
  * Insert a row into table
85 85
  */
86
-int db_mysql_insert(const db_con_t* _h, const db_key_t* _k, const db_val_t* _v, const int _n);
86
+int db_mysql_insert(const db1_con_t* _h, const db_key_t* _k, const db_val_t* _v, const int _n);
87 87
 
88 88
 
89 89
 /*! \brief
90 90
  * Delete a row from table
91 91
  */
92
-int db_mysql_delete(const db_con_t* _h, const db_key_t* _k, const 
92
+int db_mysql_delete(const db1_con_t* _h, const db_key_t* _k, const 
93 93
 	db_op_t* _o, const db_val_t* _v, const int _n);
94 94
 
95 95
 
96 96
 /*! \brief
97 97
  * Update a row in table
98 98
  */
99
-int db_mysql_update(const db_con_t* _h, const db_key_t* _k, const db_op_t* _o,
99
+int db_mysql_update(const db1_con_t* _h, const db_key_t* _k, const db_op_t* _o,
100 100
 	const db_val_t* _v, const db_key_t* _uk, const db_val_t* _uv, const int _n,
101 101
 	const int _un);
102 102
 
... ...
@@ -104,17 +104,17 @@ int db_mysql_update(const db_con_t* _h, const db_key_t* _k, const db_op_t* _o,
104 104
 /*! \brief
105 105
  * Just like insert, but replace the row if it exists
106 106
  */
107
-int db_mysql_replace(const db_con_t* handle, const db_key_t* keys, const db_val_t* vals, const int n);
107
+int db_mysql_replace(const db1_con_t* handle, const db_key_t* keys, const db_val_t* vals, const int n);
108 108
 
109 109
 /*! \brief
110 110
  * Returns the last inserted ID
111 111
  */
112
-int db_last_inserted_id(const db_con_t* _h);
112
+int db_last_inserted_id(const db1_con_t* _h);
113 113
 
114 114
 /*! \brief
115 115
  * Insert a row into table, update on duplicate key
116 116
  */
117
-int db_insert_update(const db_con_t* _h, const db_key_t* _k, const db_val_t* _v,
117
+int db_insert_update(const db1_con_t* _h, const db_key_t* _k, const db_val_t* _v,
118 118
 	const int _n);
119 119
 
120 120
 
... ...
@@ -122,7 +122,7 @@ int db_insert_update(const db_con_t* _h, const db_key_t* _k, const db_val_t* _v,
122 122
  * Store name of table that will be used by
123 123
  * subsequent database functions
124 124
  */
125
-int db_mysql_use_table(db_con_t* _h, const str* _t);
125
+int db_mysql_use_table(db1_con_t* _h, const str* _t);
126 126
 
127 127
 
128 128
 #endif /* KM_DBASE_H */
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 1 changed files
... ...
@@ -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 */
Browse code

- fix one DBG msg (still using module prefix), two small indention fixes

git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@5425 689a6050-402a-0410-94f2-e92a70836424

Henning Westerholt authored on 07/01/2009 08:43:22
Showing 1 changed files
... ...
@@ -104,7 +104,7 @@ int db_mysql_update(const db_con_t* _h, const db_key_t* _k, const db_op_t* _o,
104 104
 /*! \brief
105 105
  * Just like insert, but replace the row if it exists
106 106
  */
107
-int db_mysql_replace(const db_con_t* handle, const db_key_t* keys, const db_val_t* 	vals, const int n);
107
+int db_mysql_replace(const db_con_t* handle, const db_key_t* keys, const db_val_t* vals, const int n);
108 108
 
109 109
 /*! \brief
110 110
  * Returns the last inserted ID
Browse code

- change name in copyright headers

git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@4518 689a6050-402a-0410-94f2-e92a70836424

Henning Westerholt authored on 28/07/2008 15:39:28
Showing 1 changed files
... ...
@@ -6,14 +6,14 @@
6 6
  * Copyright (C) 2001-2003 FhG Fokus
7 7
  * Copyright (C) 2008 1&1 Internet AG
8 8
  *
9
- * This file is part of openser, a free SIP server.
9
+ * This file is part of Kamailio, a free SIP server.
10 10
  *
11
- * openser is free software; you can redistribute it and/or modify
11
+ * Kamailio is free software; you can redistribute it and/or modify
12 12
  * it under the terms of the GNU General Public License as published by
13 13
  * the Free Software Foundation; either version 2 of the License, or
14 14
  * (at your option) any later version
15 15
  *
16
- * openser is distributed in the hope that it will be useful,
16
+ * Kamailio is distributed in the hope that it will be useful,
17 17
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 18
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19 19
  * GNU General Public License for more details.
Browse code

- small doxygen updates (group, syntax), small docs update - patch provided from Olle E. Johansson, closes #2025079

git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@4505 689a6050-402a-0410-94f2-e92a70836424

Henning Westerholt authored on 24/07/2008 15:20:11
Showing 1 changed files
... ...
@@ -23,6 +23,13 @@
23 23
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
24 24
  */
25 25
 
26
+/*! \file
27
+ *  \brief DB_MYSQL :: Core
28
+ *  \ingroup db_mysql
29
+ *  Module: \ref db_mysql
30
+ */
31
+
32
+
26 33
 
27 34
 #ifndef DBASE_H
28 35
 #define DBASE_H
... ...
@@ -35,25 +42,25 @@
35 42
 #include "../../db/db_val.h"
36 43
 #include "../../str.h"
37 44
 
38
-/*
45
+/*! \brief
39 46
  * Initialize database connection
40 47
  */
41 48
 db_con_t* db_mysql_init(const str* _sqlurl);
42 49
 
43 50
 
44
-/*
51
+/*! \brief
45 52
  * Close a database connection
46 53
  */
47 54
 void db_mysql_close(db_con_t* _h);
48 55
 
49 56
 
50
-/*
57
+/*! \brief
51 58
  * Free all memory allocated by get_result
52 59
  */
53 60
 int db_mysql_free_result(db_con_t* _h, db_res_t* _r);
54 61
 
55 62
 
56
-/*
63
+/*! \brief
57 64
  * Do a query
58 65
  */
59 66
 int db_mysql_query(const db_con_t* _h, const db_key_t* _k, const db_op_t* _op,
... ...
@@ -61,32 +68,32 @@ int db_mysql_query(const db_con_t* _h, const db_key_t* _k, const db_op_t* _op,
61 68
 	     const db_key_t _o, db_res_t** _r);
62 69
 
63 70
 
64
-/*
71
+/*! \brief
65 72
  * fetch rows from a result
66 73
  */
67 74
 int db_mysql_fetch_result(const db_con_t* _h, db_res_t** _r, const int nrows);
68 75
 
69 76
 
70
-/*
77
+/*! \brief
71 78
  * Raw SQL query
72 79
  */
73 80
 int db_mysql_raw_query(const db_con_t* _h, const str* _s, db_res_t** _r);
74 81
 
75 82
 
76
-/*
83
+/*! \brief
77 84
  * Insert a row into table
78 85
  */
79 86
 int db_mysql_insert(const db_con_t* _h, const db_key_t* _k, const db_val_t* _v, const int _n);
80 87
 
81 88
 
82
-/*
89
+/*! \brief
83 90
  * Delete a row from table
84 91
  */
85 92
 int db_mysql_delete(const db_con_t* _h, const db_key_t* _k, const 
86 93
 	db_op_t* _o, const db_val_t* _v, const int _n);
87 94
 
88 95
 
89
-/*
96
+/*! \brief
90 97
  * Update a row in table
91 98
  */
92 99
 int db_mysql_update(const db_con_t* _h, const db_key_t* _k, const db_op_t* _o,
... ...
@@ -94,24 +101,24 @@ int db_mysql_update(const db_con_t* _h, const db_key_t* _k, const db_op_t* _o,
94 101
 	const int _un);
95 102
 
96 103
 
97
-/*
104
+/*! \brief
98 105
  * Just like insert, but replace the row if it exists
99 106
  */
100 107
 int db_mysql_replace(const db_con_t* handle, const db_key_t* keys, const db_val_t* 	vals, const int n);
101 108
 
102
-/*
109
+/*! \brief
103 110
  * Returns the last inserted ID
104 111
  */
105 112
 int db_last_inserted_id(const db_con_t* _h);
106 113
 
107
-/*
114
+/*! \brief
108 115
  * Insert a row into table, update on duplicate key
109 116
  */
110 117
 int db_insert_update(const db_con_t* _h, const db_key_t* _k, const db_val_t* _v,
111 118
 	const int _n);
112 119
 
113 120
 
114
-/*
121
+/*! \brief
115 122
  * Store name of table that will be used by
116 123
  * subsequent database functions
117 124
  */
Browse code

- rename database modules to use the 'db_' prefix

git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@3638 689a6050-402a-0410-94f2-e92a70836424

Henning Westerholt authored on 06/02/2008 13:10:03
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,121 @@
1
+/*
2
+ * $Id$
3
+ *
4
+ * MySQL module core functions
5
+ *
6
+ * Copyright (C) 2001-2003 FhG Fokus
7
+ * Copyright (C) 2008 1&1 Internet AG
8
+ *
9
+ * This file is part of openser, a free SIP server.
10
+ *
11
+ * openser is free software; you can redistribute it and/or modify
12
+ * it under the terms of the GNU General Public License as published by
13
+ * the Free Software Foundation; either version 2 of the License, or
14
+ * (at your option) any later version
15
+ *
16
+ * openser is distributed in the hope that it will be useful,
17
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
18
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19
+ * GNU General Public License for more details.
20
+ *
21
+ * You should have received a copy of the GNU General Public License 
22
+ * along with this program; if not, write to the Free Software 
23
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
24
+ */
25
+
26
+
27
+#ifndef DBASE_H
28
+#define DBASE_H
29
+
30
+
31
+#include "../../db/db_con.h"
32
+#include "../../db/db_res.h"
33
+#include "../../db/db_key.h"
34
+#include "../../db/db_op.h"
35
+#include "../../db/db_val.h"
36
+#include "../../str.h"
37
+
38
+/*
39
+ * Initialize database connection
40
+ */
41
+db_con_t* db_mysql_init(const str* _sqlurl);
42
+
43
+
44
+/*
45
+ * Close a database connection
46
+ */
47
+void db_mysql_close(db_con_t* _h);
48
+
49
+
50
+/*
51
+ * Free all memory allocated by get_result
52
+ */
53
+int db_mysql_free_result(db_con_t* _h, db_res_t* _r);
54
+
55
+
56
+/*
57
+ * Do a query
58
+ */
59
+int db_mysql_query(const db_con_t* _h, const db_key_t* _k, const db_op_t* _op,
60
+	     const db_val_t* _v, const db_key_t* _c, const int _n, const int _nc,
61
+	     const db_key_t _o, db_res_t** _r);
62
+
63
+
64
+/*
65
+ * fetch rows from a result
66
+ */
67
+int db_mysql_fetch_result(const db_con_t* _h, db_res_t** _r, const int nrows);
68
+
69
+
70
+/*
71
+ * Raw SQL query
72
+ */
73
+int db_mysql_raw_query(const db_con_t* _h, const str* _s, db_res_t** _r);
74
+
75
+
76
+/*
77
+ * Insert a row into table
78
+ */
79
+int db_mysql_insert(const db_con_t* _h, const db_key_t* _k, const db_val_t* _v, const int _n);
80
+
81
+
82
+/*
83
+ * Delete a row from table
84
+ */
85
+int db_mysql_delete(const db_con_t* _h, const db_key_t* _k, const 
86
+	db_op_t* _o, const db_val_t* _v, const int _n);
87
+
88
+
89
+/*
90
+ * Update a row in table
91
+ */
92
+int db_mysql_update(const db_con_t* _h, const db_key_t* _k, const db_op_t* _o,
93
+	const db_val_t* _v, const db_key_t* _uk, const db_val_t* _uv, const int _n,
94
+	const int _un);
95
+
96
+
97
+/*
98
+ * Just like insert, but replace the row if it exists
99
+ */
100
+int db_mysql_replace(const db_con_t* handle, const db_key_t* keys, const db_val_t* 	vals, const int n);
101
+
102
+/*
103
+ * Returns the last inserted ID
104
+ */
105
+int db_last_inserted_id(const db_con_t* _h);
106
+
107
+/*
108
+ * Insert a row into table, update on duplicate key
109
+ */
110
+int db_insert_update(const db_con_t* _h, const db_key_t* _k, const db_val_t* _v,
111
+	const int _n);
112
+
113
+
114
+/*
115
+ * Store name of table that will be used by
116
+ * subsequent database functions
117
+ */
118
+int db_mysql_use_table(db_con_t* _h, const str* _t);
119
+
120
+
121
+#endif /* DBASE_H */