- 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)
1 | 1 |
deleted file mode 100644 |
... | ... |
@@ -1,73 +0,0 @@ |
1 |
-/* |
|
2 |
- * Copyright (C) 2001-2003 FhG Fokus |
|
3 |
- * Copyright (C) 2008 1&1 Internet AG |
|
4 |
- * |
|
5 |
- * This file is part of Kamailio, a free SIP server. |
|
6 |
- * |
|
7 |
- * Kamailio is free software; you can redistribute it and/or modify |
|
8 |
- * it under the terms of the GNU General Public License as published by |
|
9 |
- * the Free Software Foundation; either version 2 of the License, or |
|
10 |
- * (at your option) any later version |
|
11 |
- * |
|
12 |
- * Kamailio is distributed in the hope that it will be useful, |
|
13 |
- * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
14 |
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
15 |
- * GNU General Public License for more details. |
|
16 |
- * |
|
17 |
- * You should have received a copy of the GNU General Public License |
|
18 |
- * along with this program; if not, write to the Free Software |
|
19 |
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
|
20 |
- */ |
|
21 |
- |
|
22 |
-/*! \file |
|
23 |
- * \brief DB_MYSQL :: Core |
|
24 |
- * \ref my_con.c |
|
25 |
- * \ingroup db_mysql |
|
26 |
- * Module: \ref db_mysql |
|
27 |
- */ |
|
28 |
- |
|
29 |
- |
|
30 |
-#ifndef KM_MY_CON_H |
|
31 |
-#define KM_MY_CON_H |
|
32 |
- |
|
33 |
-#include "../../lib/srdb1/db_pool.h" |
|
34 |
-#include "../../lib/srdb1/db_id.h" |
|
35 |
- |
|
36 |
-#include <time.h> |
|
37 |
-#include <mysql.h> |
|
38 |
- |
|
39 |
- |
|
40 |
-struct my_con { |
|
41 |
- struct db_id* id; /*!< Connection identifier */ |
|
42 |
- unsigned int ref; /*!< Reference count */ |
|
43 |
- struct pool_con* next; /*!< Next connection in the pool */ |
|
44 |
- |
|
45 |
- MYSQL* con; /*!< Connection representation */ |
|
46 |
- time_t timestamp; /*!< Timestamp of last query */ |
|
47 |
- int transaction; /*!< Multi-query transaction is currently open */ |
|
48 |
- int lockedtables; /*!< Table locks were aquired */ |
|
49 |
-}; |
|
50 |
- |
|
51 |
- |
|
52 |
-/* |
|
53 |
- * Some convenience wrappers |
|
54 |
- */ |
|
55 |
-#define CON_CONNECTION(db_con) (((struct my_con*)((db_con)->tail))->con) |
|
56 |
-#define CON_TIMESTAMP(db_con) (((struct my_con*)((db_con)->tail))->timestamp) |
|
57 |
-#define CON_TRANSACTION(db_con) (((struct my_con*)((db_con)->tail))->transaction) |
|
58 |
-#define CON_LOCKEDTABLES(db_con) (((struct my_con*)((db_con)->tail))->lockedtables) |
|
59 |
- |
|
60 |
- |
|
61 |
-/*! \brief |
|
62 |
- * Create a new connection structure, |
|
63 |
- * open the MySQL connection and set reference count to 1 |
|
64 |
- */ |
|
65 |
-struct my_con* db_mysql_new_connection(const struct db_id* id); |
|
66 |
- |
|
67 |
- |
|
68 |
-/*! \brief |
|
69 |
- * Close the connection and release memory |
|
70 |
- */ |
|
71 |
-void db_mysql_free_connection(struct pool_con* con); |
|
72 |
- |
|
73 |
-#endif /* KM_MY_CON_H */ |
- direct use of mysql_config, the old substitution done in module
Makefile can break the includes of libmysqlclient files
- reported by Ian Yu-Hsun Lin, GH#419
... | ... |
@@ -18,7 +18,7 @@ |
18 | 18 |
* |
19 | 19 |
* You should have received a copy of the GNU General Public License |
20 | 20 |
* along with this program; if not, write to the Free Software |
21 |
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
21 |
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
|
22 | 22 |
*/ |
23 | 23 |
|
24 | 24 |
/*! \file |
... | ... |
@@ -46,7 +46,8 @@ struct my_con { |
46 | 46 |
|
47 | 47 |
MYSQL* con; /*!< Connection representation */ |
48 | 48 |
time_t timestamp; /*!< Timestamp of last query */ |
49 |
- int transaction; /*!< indicates whether a multi-query transaction is currently open */ |
|
49 |
+ int transaction; /*!< Multi-query transaction is currently open */ |
|
50 |
+ int lockedtables; /*!< Table locks were aquired */ |
|
50 | 51 |
}; |
51 | 52 |
|
52 | 53 |
|
... | ... |
@@ -56,6 +57,7 @@ struct my_con { |
56 | 57 |
#define CON_CONNECTION(db_con) (((struct my_con*)((db_con)->tail))->con) |
57 | 58 |
#define CON_TIMESTAMP(db_con) (((struct my_con*)((db_con)->tail))->timestamp) |
58 | 59 |
#define CON_TRANSACTION(db_con) (((struct my_con*)((db_con)->tail))->transaction) |
60 |
+#define CON_LOCKEDTABLES(db_con) (((struct my_con*)((db_con)->tail))->lockedtables) |
|
59 | 61 |
|
60 | 62 |
|
61 | 63 |
/*! \brief |
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.
... | ... |
@@ -44,9 +44,7 @@ struct my_con { |
44 | 44 |
unsigned int ref; /*!< Reference count */ |
45 | 45 |
struct pool_con* next; /*!< Next connection in the pool */ |
46 | 46 |
|
47 |
- MYSQL_RES* res; /*!< Actual result */ |
|
48 | 47 |
MYSQL* con; /*!< Connection representation */ |
49 |
- MYSQL_ROW row; /*!< Actual row in the result */ |
|
50 | 48 |
time_t timestamp; /*!< Timestamp of last query */ |
51 | 49 |
int transaction; /*!< indicates whether a multi-query transaction is currently open */ |
52 | 50 |
}; |
... | ... |
@@ -55,9 +53,7 @@ struct my_con { |
55 | 53 |
/* |
56 | 54 |
* Some convenience wrappers |
57 | 55 |
*/ |
58 |
-#define CON_RESULT(db_con) (((struct my_con*)((db_con)->tail))->res) |
|
59 | 56 |
#define CON_CONNECTION(db_con) (((struct my_con*)((db_con)->tail))->con) |
60 |
-#define CON_ROW(db_con) (((struct my_con*)((db_con)->tail))->row) |
|
61 | 57 |
#define CON_TIMESTAMP(db_con) (((struct my_con*)((db_con)->tail))->timestamp) |
62 | 58 |
#define CON_TRANSACTION(db_con) (((struct my_con*)((db_con)->tail))->transaction) |
63 | 59 |
|
Patch contributed via Google+ by Håkon Nassjöen <haakon.nassjoen@gmail.com>
... | ... |
@@ -48,16 +48,18 @@ struct my_con { |
48 | 48 |
MYSQL* con; /*!< Connection representation */ |
49 | 49 |
MYSQL_ROW row; /*!< Actual row in the result */ |
50 | 50 |
time_t timestamp; /*!< Timestamp of last query */ |
51 |
+ int transaction; /*!< indicates whether a multi-query transaction is currently open */ |
|
51 | 52 |
}; |
52 | 53 |
|
53 | 54 |
|
54 | 55 |
/* |
55 | 56 |
* Some convenience wrappers |
56 | 57 |
*/ |
57 |
-#define CON_RESULT(db_con) (((struct my_con*)((db_con)->tail))->res) |
|
58 |
-#define CON_CONNECTION(db_con) (((struct my_con*)((db_con)->tail))->con) |
|
59 |
-#define CON_ROW(db_con) (((struct my_con*)((db_con)->tail))->row) |
|
60 |
-#define CON_TIMESTAMP(db_con) (((struct my_con*)((db_con)->tail))->timestamp) |
|
58 |
+#define CON_RESULT(db_con) (((struct my_con*)((db_con)->tail))->res) |
|
59 |
+#define CON_CONNECTION(db_con) (((struct my_con*)((db_con)->tail))->con) |
|
60 |
+#define CON_ROW(db_con) (((struct my_con*)((db_con)->tail))->row) |
|
61 |
+#define CON_TIMESTAMP(db_con) (((struct my_con*)((db_con)->tail))->timestamp) |
|
62 |
+#define CON_TRANSACTION(db_con) (((struct my_con*)((db_con)->tail))->transaction) |
|
61 | 63 |
|
62 | 64 |
|
63 | 65 |
/*! \brief |
* 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
... | ... |
@@ -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 */ |
git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@4518 689a6050-402a-0410-94f2-e92a70836424
... | ... |
@@ -4,14 +4,14 @@ |
4 | 4 |
* Copyright (C) 2001-2003 FhG Fokus |
5 | 5 |
* Copyright (C) 2008 1&1 Internet AG |
6 | 6 |
* |
7 |
- * This file is part of openser, a free SIP server. |
|
7 |
+ * This file is part of Kamailio, a free SIP server. |
|
8 | 8 |
* |
9 |
- * openser is free software; you can redistribute it and/or modify |
|
9 |
+ * Kamailio is free software; you can redistribute it and/or modify |
|
10 | 10 |
* it under the terms of the GNU General Public License as published by |
11 | 11 |
* the Free Software Foundation; either version 2 of the License, or |
12 | 12 |
* (at your option) any later version |
13 | 13 |
* |
14 |
- * openser is distributed in the hope that it will be useful, |
|
14 |
+ * Kamailio is distributed in the hope that it will be useful, |
|
15 | 15 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | 16 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
17 | 17 |
* GNU General Public License for more details. |
git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@4505 689a6050-402a-0410-94f2-e92a70836424
... | ... |
@@ -21,6 +21,14 @@ |
21 | 21 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
22 | 22 |
*/ |
23 | 23 |
|
24 |
+/*! \file |
|
25 |
+ * \brief DB_MYSQL :: Core |
|
26 |
+ * \ref my_con.c |
|
27 |
+ * \ingroup db_mysql |
|
28 |
+ * Module: \ref db_mysql |
|
29 |
+ */ |
|
30 |
+ |
|
31 |
+ |
|
24 | 32 |
#ifndef MY_CON_H |
25 | 33 |
#define MY_CON_H |
26 | 34 |
|
... | ... |
@@ -32,14 +40,14 @@ |
32 | 40 |
|
33 | 41 |
|
34 | 42 |
struct my_con { |
35 |
- struct db_id* id; /* Connection identifier */ |
|
36 |
- unsigned int ref; /* Reference count */ |
|
37 |
- struct pool_con* next; /* Next connection in the pool */ |
|
43 |
+ struct db_id* id; /*!< Connection identifier */ |
|
44 |
+ unsigned int ref; /*!< Reference count */ |
|
45 |
+ struct pool_con* next; /*!< Next connection in the pool */ |
|
38 | 46 |
|
39 |
- MYSQL_RES* res; /* Actual result */ |
|
40 |
- MYSQL* con; /* Connection representation */ |
|
41 |
- MYSQL_ROW row; /* Actual row in the result */ |
|
42 |
- time_t timestamp; /* Timestamp of last query */ |
|
47 |
+ MYSQL_RES* res; /*!< Actual result */ |
|
48 |
+ MYSQL* con; /*!< Connection representation */ |
|
49 |
+ MYSQL_ROW row; /*!< Actual row in the result */ |
|
50 |
+ time_t timestamp; /*!< Timestamp of last query */ |
|
43 | 51 |
}; |
44 | 52 |
|
45 | 53 |
|
... | ... |
@@ -52,14 +60,14 @@ struct my_con { |
52 | 60 |
#define CON_TIMESTAMP(db_con) (((struct my_con*)((db_con)->tail))->timestamp) |
53 | 61 |
|
54 | 62 |
|
55 |
-/* |
|
63 |
+/*! \brief |
|
56 | 64 |
* Create a new connection structure, |
57 | 65 |
* open the MySQL connection and set reference count to 1 |
58 | 66 |
*/ |
59 | 67 |
struct my_con* db_mysql_new_connection(const struct db_id* id); |
60 | 68 |
|
61 | 69 |
|
62 |
-/* |
|
70 |
+/*! \brief |
|
63 | 71 |
* Close the connection and release memory |
64 | 72 |
*/ |
65 | 73 |
void db_mysql_free_connection(struct pool_con* con); |
git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@3638 689a6050-402a-0410-94f2-e92a70836424
1 | 1 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,67 @@ |
1 |
+/* |
|
2 |
+ * $Id$ |
|
3 |
+ * |
|
4 |
+ * Copyright (C) 2001-2003 FhG Fokus |
|
5 |
+ * Copyright (C) 2008 1&1 Internet AG |
|
6 |
+ * |
|
7 |
+ * This file is part of openser, a free SIP server. |
|
8 |
+ * |
|
9 |
+ * openser 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 |
+ * openser 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
22 |
+ */ |
|
23 |
+ |
|
24 |
+#ifndef MY_CON_H |
|
25 |
+#define MY_CON_H |
|
26 |
+ |
|
27 |
+#include "../../db/db_pool.h" |
|
28 |
+#include "../../db/db_id.h" |
|
29 |
+ |
|
30 |
+#include <time.h> |
|
31 |
+#include <mysql/mysql.h> |
|
32 |
+ |
|
33 |
+ |
|
34 |
+struct my_con { |
|
35 |
+ struct db_id* id; /* Connection identifier */ |
|
36 |
+ unsigned int ref; /* Reference count */ |
|
37 |
+ struct pool_con* next; /* Next connection in the pool */ |
|
38 |
+ |
|
39 |
+ MYSQL_RES* res; /* Actual result */ |
|
40 |
+ MYSQL* con; /* Connection representation */ |
|
41 |
+ MYSQL_ROW row; /* Actual row in the result */ |
|
42 |
+ time_t timestamp; /* Timestamp of last query */ |
|
43 |
+}; |
|
44 |
+ |
|
45 |
+ |
|
46 |
+/* |
|
47 |
+ * Some convenience wrappers |
|
48 |
+ */ |
|
49 |
+#define CON_RESULT(db_con) (((struct my_con*)((db_con)->tail))->res) |
|
50 |
+#define CON_CONNECTION(db_con) (((struct my_con*)((db_con)->tail))->con) |
|
51 |
+#define CON_ROW(db_con) (((struct my_con*)((db_con)->tail))->row) |
|
52 |
+#define CON_TIMESTAMP(db_con) (((struct my_con*)((db_con)->tail))->timestamp) |
|
53 |
+ |
|
54 |
+ |
|
55 |
+/* |
|
56 |
+ * Create a new connection structure, |
|
57 |
+ * open the MySQL connection and set reference count to 1 |
|
58 |
+ */ |
|
59 |
+struct my_con* db_mysql_new_connection(const struct db_id* id); |
|
60 |
+ |
|
61 |
+ |
|
62 |
+/* |
|
63 |
+ * Close the connection and release memory |
|
64 |
+ */ |
|
65 |
+void db_mysql_free_connection(struct pool_con* con); |
|
66 |
+ |
|
67 |
+#endif /* MY_CON_H */ |