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,74 +0,0 @@
1
-/* 
2
- * MySQL module result related functions
3
- *
4
- * Copyright (C) 2001-2003 FhG Fokus
5
- * Copyright (C) 2007-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 :: Result related functions
26
- *  \ingroup db_mysql
27
- *  Module: \ref db_mysql
28
- */
29
-
30
-
31
-#ifndef KM_RES_H
32
-#define KM_RES_H
33
-
34
-#include "../../lib/srdb1/db_res.h"
35
-#include "../../lib/srdb1/db_con.h"
36
-
37
-
38
-struct my_res {
39
-	MYSQL_RES* res;          /*!< Actual result */
40
-	MYSQL_ROW row;           /*!< Actual row in the result */
41
-};
42
-
43
-/*
44
- * Some convenience wrappers
45
- */
46
-#define RES_RESULT(db_res)     (((struct my_res*)((db_res)->ptr))->res)
47
-#define RES_ROW(db_res)        (((struct my_res*)((db_res)->ptr))->row)
48
-
49
-
50
-/*!
51
- * \brief Fill the result structure with data from database
52
- * \param _h database connection
53
- * \param _r database result
54
- * \return 0 on success, negative on failure
55
- */
56
-int db_mysql_convert_result(const db1_con_t* _h, db1_res_t* _r);
57
-
58
-
59
-/*!
60
- * \brief Get and convert columns from a result
61
- * \param _h database connection
62
- * \param _r database result set
63
- * \return 0 on success, negative on failure
64
- */
65
-int db_mysql_get_columns(const db1_con_t* _h, db1_res_t* _r);
66
-
67
-
68
-/*!
69
- * \brief Allocate new result set with private structure
70
- * \return db1_res_t object on success, NULL on failure
71
- */
72
-db1_res_t* db_mysql_new_result(void);
73
-
74
-#endif
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 result related 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: 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
... ...
@@ -37,6 +37,18 @@
37 37
 #include "../../lib/srdb1/db_con.h"
38 38
 
39 39
 
40
+struct my_res {
41
+	MYSQL_RES* res;          /*!< Actual result */
42
+	MYSQL_ROW row;           /*!< Actual row in the result */
43
+};
44
+
45
+/*
46
+ * Some convenience wrappers
47
+ */
48
+#define RES_RESULT(db_res)     (((struct my_res*)((db_res)->ptr))->res)
49
+#define RES_ROW(db_res)        (((struct my_res*)((db_res)->ptr))->row)
50
+
51
+
40 52
 /*!
41 53
  * \brief Fill the result structure with data from database
42 54
  * \param _h database connection
... ...
@@ -54,4 +66,11 @@ int db_mysql_convert_result(const db1_con_t* _h, db1_res_t* _r);
54 66
  */
55 67
 int db_mysql_get_columns(const db1_con_t* _h, db1_res_t* _r);
56 68
 
69
+
70
+/*!
71
+ * \brief Allocate new result set with private structure
72
+ * \return db1_res_t object on success, NULL on failure
73
+ */
74
+db1_res_t* db_mysql_new_result(void);
75
+
57 76
 #endif
Browse code

modules: several small doxygen bug fixes

Henning Westerholt authored on 04/09/2011 20:13:23
Showing 1 changed files
... ...
@@ -25,7 +25,6 @@
25 25
 
26 26
 /*! \file
27 27
  *  \brief DB_MYSQL :: Result related functions
28
- *  \ref res.c
29 28
  *  \ingroup db_mysql
30 29
  *  Module: \ref db_mysql
31 30
  */
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
... ...
@@ -44,7 +44,7 @@
44 44
  * \param _r database result
45 45
  * \return 0 on success, negative on failure
46 46
  */
47
-int db_mysql_convert_result(const db1_con_t* _h, db_res_t* _r);
47
+int db_mysql_convert_result(const db1_con_t* _h, db1_res_t* _r);
48 48
 
49 49
 
50 50
 /*!
... ...
@@ -53,6 +53,6 @@ int db_mysql_convert_result(const db1_con_t* _h, db_res_t* _r);
53 53
  * \param _r database result set
54 54
  * \return 0 on success, negative on failure
55 55
  */
56
-int db_mysql_get_columns(const db1_con_t* _h, db_res_t* _r);
56
+int db_mysql_get_columns(const db1_con_t* _h, db1_res_t* _r);
57 57
 
58 58
 #endif
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
... ...
@@ -44,7 +44,7 @@
44 44
  * \param _r database result
45 45
  * \return 0 on success, negative on failure
46 46
  */
47
-int db_mysql_convert_result(const db_con_t* _h, db_res_t* _r);
47
+int db_mysql_convert_result(const db1_con_t* _h, db_res_t* _r);
48 48
 
49 49
 
50 50
 /*!
... ...
@@ -53,6 +53,6 @@ int db_mysql_convert_result(const db_con_t* _h, db_res_t* _r);
53 53
  * \param _r database result set
54 54
  * \return 0 on success, negative on failure
55 55
  */
56
-int db_mysql_get_columns(const db_con_t* _h, db_res_t* _r);
56
+int db_mysql_get_columns(const db1_con_t* _h, db_res_t* _r);
57 57
 
58 58
 #endif
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,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
 /*!
Browse code

- fix a few errors in doxygen documentation - sync one function definitions variables with declaration

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

Henning Westerholt authored on 25/11/2008 09:34:15
Showing 1 changed files
... ...
@@ -38,11 +38,21 @@
38 38
 #include "../../db/db_con.h"
39 39
 
40 40
 
41
-/*
42
- * Fill the structure with data from database
41
+/*!
42
+ * \brief Fill the result structure with data from database
43
+ * \param _h database connection
44
+ * \param _r database result
45
+ * \return 0 on success, negative on failure
43 46
  */
44 47
 int db_mysql_convert_result(const db_con_t* _h, db_res_t* _r);
45 48
 
49
+
50
+/*!
51
+ * \brief Get and convert columns from a result
52
+ * \param _h database connection
53
+ * \param _r database result set
54
+ * \return 0 on success, negative on failure
55
+ */
46 56
 int db_mysql_get_columns(const db_con_t* _h, db_res_t* _r);
47 57
 
48
-#endif /* RES_H */
58
+#endif
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) 2007-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,14 @@
23 23
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
24 24
  */
25 25
 
26
+/*! \file
27
+ *  \brief DB_MYSQL :: Result related functions
28
+ *  \ref res.c
29
+ *  \ingroup db_mysql
30
+ *  Module: \ref db_mysql
31
+ */
32
+
33
+
26 34
 #ifndef RES_H
27 35
 #define RES_H
28 36
 
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,40 @@
1
+/* 
2
+ * $Id$ 
3
+ *
4
+ * MySQL module result related functions
5
+ *
6
+ * Copyright (C) 2001-2003 FhG Fokus
7
+ * Copyright (C) 2007-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
+#ifndef RES_H
27
+#define RES_H
28
+
29
+#include "../../db/db_res.h"
30
+#include "../../db/db_con.h"
31
+
32
+
33
+/*
34
+ * Fill the structure with data from database
35
+ */
36
+int db_mysql_convert_result(const db_con_t* _h, db_res_t* _r);
37
+
38
+int db_mysql_get_columns(const db_con_t* _h, db_res_t* _r);
39
+
40
+#endif /* RES_H */