Browse code

db_postgres: clang format of the code

Daniel-Constantin Mierla authored on 11/10/2017 16:23:19
Showing 1 changed files
... ...
@@ -49,7 +49,7 @@
49 49
  * @param cmd The command whose data will be used to generate the query.
50 50
  * @return 0 on success, negative number on error
51 51
  */
52
-int build_update_sql(str* sql_cmd, db_cmd_t* cmd);
52
+int build_update_sql(str *sql_cmd, db_cmd_t *cmd);
53 53
 
54 54
 
55 55
 /** Builds an INSERT SQL statement.
... ...
@@ -62,7 +62,7 @@ int build_update_sql(str* sql_cmd, db_cmd_t* cmd);
62 62
  * @param cmd The command whose data will be used to generate the query.
63 63
  * @return 0 on success, negative number on error
64 64
  */
65
-int build_insert_sql(str* sql_cmd, db_cmd_t* cmd);
65
+int build_insert_sql(str *sql_cmd, db_cmd_t *cmd);
66 66
 
67 67
 
68 68
 /** Builds a DELETE SQL statement.
... ...
@@ -76,7 +76,7 @@ int build_insert_sql(str* sql_cmd, db_cmd_t* cmd);
76 76
  * @param cmd The command whose data will be used to generate the query.
77 77
  * @return 0 on success, negative number on error
78 78
  */
79
-int build_delete_sql(str* sql_cmd, db_cmd_t* cmd);
79
+int build_delete_sql(str *sql_cmd, db_cmd_t *cmd);
80 80
 
81 81
 
82 82
 /** Builds a SELECT SQL statement.
... ...
@@ -90,14 +90,14 @@ int build_delete_sql(str* sql_cmd, db_cmd_t* cmd);
90 90
  * @param cmd The command whose data will be used to generate the query.
91 91
  * @return 0 on success, negative number on error
92 92
  */
93
-int build_select_sql(str* sql_cmd, db_cmd_t* cmd);
93
+int build_select_sql(str *sql_cmd, db_cmd_t *cmd);
94 94
 
95 95
 
96 96
 /* Builds SQL query used to obtain the list of supported field types.
97 97
  * This function builds a special SQL query that is used to obtain the list
98 98
  * of supported field type from the server's system catalogs.
99 99
  */
100
-int build_select_oid_sql(str* sql_cmd);
100
+int build_select_oid_sql(str *sql_cmd);
101 101
 
102 102
 
103 103
 /** Builds the SQL query used to determine the format of timestamp fields.
... ...
@@ -105,7 +105,7 @@ int build_select_oid_sql(str* sql_cmd);
105 105
  * immediately after establishing a connection to determine the format of
106 106
  * timestamp fields used on the server.
107 107
  */
108
-int build_timestamp_format_sql(str* sql_cmd);
108
+int build_timestamp_format_sql(str *sql_cmd);
109 109
 
110 110
 /** @} */
111 111
 
Browse code

core, lib, modules: updated include paths for header files

Daniel-Constantin Mierla authored on 07/12/2016 11:07:22
Showing 1 changed files
... ...
@@ -35,7 +35,7 @@
35 35
  */
36 36
 
37 37
 #include "../../lib/srdb2/db_cmd.h"
38
-#include "../../str.h"
38
+#include "../../core/str.h"
39 39
 
40 40
 
41 41
 /** Builds an UPDATE SQL statement.
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
new file mode 100644
... ...
@@ -0,0 +1,112 @@
1
+/* 
2
+ * PostgreSQL Database Driver for Kamailio
3
+ *
4
+ * Portions Copyright (C) 2001-2003 FhG FOKUS
5
+ * Copyright (C) 2003 August.Net Services, LLC
6
+ * Portions Copyright (C) 2005-2008 iptelorg GmbH
7
+ *
8
+ * This file is part of Kamailio, a free SIP server.
9
+ *
10
+ * Kamailio is free software; you can redistribute it and/or modify it under the
11
+ * terms of the GNU General Public License as published by the Free Software
12
+ * Foundation; either version 2 of the License, or (at your option) any later
13
+ * version
14
+ *
15
+ * Kamailio is distributed in the hope that it will be useful, but WITHOUT ANY
16
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
17
+ * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
18
+ * details.
19
+ *
20
+ * You should have received a copy of the GNU General Public License along
21
+ * with this program; if not, write to the Free Software Foundation, Inc., 59
22
+ * Temple Place, Suite 330, Boston, MA 02111-1307 USA
23
+ */
24
+
25
+#ifndef _PG_SQL_H
26
+#define _PG_SQL_H
27
+
28
+/** \addtogroup postgres
29
+ * @{ 
30
+ */
31
+
32
+/** \file
33
+ * Implementation of various functions that assemble SQL query strings for
34
+ * PostgreSQL.
35
+ */
36
+
37
+#include "../../lib/srdb2/db_cmd.h"
38
+#include "../../str.h"
39
+
40
+
41
+/** Builds an UPDATE SQL statement.
42
+ * This function creates an UPDATE SQL statement where column values are
43
+ * replaced with special markers. The resulting SQL statement is suitable
44
+ * for submitting as prepared statement. The result string is zero terminated.
45
+ * @param sql_cmd Pointer to a str variable where the resulting SQL statement
46
+ *                will be stored. The buffer in sql_cmd->s is allocated using
47
+ *                pkg_malloc and the caller of the function is responsible for
48
+ *                freeing it.
49
+ * @param cmd The command whose data will be used to generate the query.
50
+ * @return 0 on success, negative number on error
51
+ */
52
+int build_update_sql(str* sql_cmd, db_cmd_t* cmd);
53
+
54
+
55
+/** Builds an INSERT SQL statement.
56
+ * This function creates an INSERT SQL statement where column values are
57
+ * replaced with special markers. The resulting SQL statement is suitable
58
+ * for submitting as prepared statement. The result string is zero terminated.
59
+ * @param sql_cmd Pointer to a str variable where the resulting SQL statement
60
+ *                will be stored. The buffer in sql_cmd->s is allocated using
61
+ *                pkg_malloc and the caller of the function is responsible for *                freeing it.
62
+ * @param cmd The command whose data will be used to generate the query.
63
+ * @return 0 on success, negative number on error
64
+ */
65
+int build_insert_sql(str* sql_cmd, db_cmd_t* cmd);
66
+
67
+
68
+/** Builds a DELETE SQL statement.
69
+ * This function creates a DELETE SQL statement where column values are
70
+ * replaced with special markers. The resulting SQL statement is suitable
71
+ * for submitting as prepared statement. The result string is zero terminated.
72
+ * @param sql_cmd Pointer to a str variable where the resulting SQL statement
73
+ *                will be stored. The buffer in sql_cmd->s is allocated using
74
+ *                pkg_malloc and the caller of the function is responsible for
75
+ *                freeing it.
76
+ * @param cmd The command whose data will be used to generate the query.
77
+ * @return 0 on success, negative number on error
78
+ */
79
+int build_delete_sql(str* sql_cmd, db_cmd_t* cmd);
80
+
81
+
82
+/** Builds a SELECT SQL statement.
83
+ * This function creates a SELECT SQL statement where column values are
84
+ * replaced with special markers. The resulting SQL statement is suitable
85
+ * for submitting as prepared statement. The result string is zero terminated.
86
+ * @param sql_cmd Pointer to a str variable where the resulting SQL statement
87
+ *                will be stored. The buffer in sql_cmd->s is allocated using
88
+ *                pkg_malloc and the caller of the function is responsible for
89
+ *                freeing it.
90
+ * @param cmd The command whose data will be used to generate the query.
91
+ * @return 0 on success, negative number on error
92
+ */
93
+int build_select_sql(str* sql_cmd, db_cmd_t* cmd);
94
+
95
+
96
+/* Builds SQL query used to obtain the list of supported field types.
97
+ * This function builds a special SQL query that is used to obtain the list
98
+ * of supported field type from the server's system catalogs.
99
+ */
100
+int build_select_oid_sql(str* sql_cmd);
101
+
102
+
103
+/** Builds the SQL query used to determine the format of timestamp fields.
104
+ * This function builds a special SQL query that is sent to the server
105
+ * immediately after establishing a connection to determine the format of
106
+ * timestamp fields used on the server.
107
+ */
108
+int build_timestamp_format_sql(str* sql_cmd);
109
+
110
+/** @} */
111
+
112
+#endif /* _PG_SQL_H */