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,147 +0,0 @@
1
-/* 
2
- * Copyright (C) 2008 iptelorg GmbH
3
- *
4
- * Permission to use, copy, modify, and distribute this software for any
5
- * purpose with or without fee is hereby granted, provided that the above
6
- * copyright notice and this permission notice appear in all copies.
7
- *
8
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15
- */
16
-
17
-/**
18
- * @file mod_fix.h
19
- * @brief Kamailio core :: Generic fixup functions for module function parameter.
20
- * (kamailio compatibility)
21
- * @ingroup core
22
- * Module: \ref core
23
- */
24
-
25
-#ifndef _mod_fix_h_
26
-#define _mod_fix_h_
27
-
28
-#include "sr_module.h"
29
-#include "pvar.h"
30
-
31
-#define GPARAM_TYPE_INT		FPARAM_INT
32
-#define GPARAM_TYPE_STR		FPARAM_STR
33
-#define GPARAM_TYPE_PVS		FPARAM_PVS
34
-#define GPARAM_TYPE_PVE		FPARAM_PVE
35
-
36
-/**
37
- * generic parameter that holds a string, an int, a pseudo-variable
38
- * or a ser select, avp, or subst.
39
- * 
40
- * Note: used only for compatibility with existing kamailio code,
41
- *  please use fparam_t directly in the future.
42
- *
43
- * @see fparam_t
44
- */
45
-
46
-/* reuse ser fparam_t */
47
-#define gparam_t fparam_t
48
-
49
-typedef gparam_t *gparam_p;
50
-
51
-int fixup_get_svalue(struct sip_msg* msg, gparam_p gp, str *val);
52
-
53
-/** get a string value out of a fparam_t.
54
-  *
55
-  * Note: this macro/function is  for kamailio compatibility
56
-  * (please use get_str_fparam() directly in the future)
57
-  *
58
-  * @param msg  - pointer to the sip message
59
-  * @param fp   - pointer to the fparam_t
60
-  * @param sval - pointer to str, used to store the result
61
-  * @return  0 on success, -1 on error
62
-  */
63
-#define fixup_get_svalue(msg, fp, sval) get_str_fparam(sval, msg, fp)
64
-
65
-/** get an int value out of a fparam_t.
66
-  *
67
-  * Note: this macro/function is  for kamailio compatibility
68
-  * (please use get_int_fparam() directly in the future)
69
-  *
70
-  * @param msg  - pointer to the sip message
71
-  * @param fp   - pointer to the fparam_t
72
-  * @param ival - pointer to str, used to store the result
73
-  * @return  0 on success, -1 on error
74
-  */
75
-#define fixup_get_ivalue(msg, fp, ival) get_int_fparam(ival, msg, fp)
76
-
77
-int fixup_str_null(void** param, int param_no);
78
-int fixup_str_str(void** param, int param_no);
79
-
80
-int fixup_free_str_null(void** param, int param_no);
81
-int fixup_free_str_str(void** param, int param_no);
82
-
83
-int fixup_uint_null(void** param, int param_no);
84
-int fixup_uint_uint(void** param, int param_no);
85
-
86
-
87
-int fixup_regexp_null(void** param, int param_no);
88
-int fixup_free_regexp_null(void** param, int param_no);
89
-#if 0
90
-int fixup_regexp_none(void** param, int param_no);
91
-int fixup_free_regexp_none(void** param, int param_no);
92
-/* not implemened yet */
93
-int fixup_regexpNL_null(void** param, int param_no);
94
-int fixup_regexpNL_none(void** param, int param_no);
95
-#endif
96
-
97
-int fixup_pvar_null(void **param, int param_no);
98
-int fixup_free_pvar_null(void** param, int param_no);
99
-
100
-int fixup_pvar_none(void** param, int param_no);
101
-int fixup_free_pvar_none(void** param, int param_no);
102
-
103
-int fixup_pvar_pvar(void **param, int param_no);
104
-int fixup_free_pvar_pvar(void** param, int param_no);
105
-
106
-int fixup_pvar_pvar_pvar(void **param, int param_no);
107
-int fixup_free_pvar_pvar_pvar(void** param, int param_no);
108
-
109
-int fixup_pvar_str(void** param, int param_no);
110
-int fixup_free_pvar_str(void** param, int param_no);
111
-
112
-int fixup_pvar_str_str(void** param, int param_no);
113
-int fixup_free_pvar_str_str(void** param, int param_no);
114
-
115
-int fixup_pvar_uint(void** param, int param_no);
116
-int fixup_free_pvar_uint(void** param, int param_no);
117
-
118
-int fixup_igp_igp(void** param, int param_no);
119
-int fixup_free_igp_igp(void** param, int param_no);
120
-int fixup_igp_null(void** param, int param_no);
121
-int fixup_free_igp_null(void** param, int param_no);
122
-int fixup_get_ivalue(struct sip_msg* msg, gparam_p gp, int *val);
123
-
124
-int fixup_igp_pvar(void** param, int param_no);
125
-int fixup_free_igp_pvar(void** param, int param_no);
126
-
127
-int fixup_igp_pvar_pvar(void** param, int param_no);
128
-int fixup_free_igp_pvar_pvar(void** param, int param_no);
129
-
130
-int fixup_spve_spve(void** param, int param_no);
131
-int fixup_free_spve_spve(void** param, int param_no);
132
-int fixup_spve_null(void** param, int param_no);
133
-int fixup_free_spve_null(void** param, int param_no);
134
-int fixup_spve_uint(void** param, int param_no);
135
-int fixup_spve_str(void** param, int param_no);
136
-int fixup_free_spve_str(void** param, int param_no);
137
-
138
-int fixup_spve_all(void** param, int param_no);
139
-int fixup_igp_all(void** param, int param_no);
140
-
141
-int fixup_spve_igp(void** param, int param_no);
142
-int fixup_free_spve_igp(void** param, int param_no);
143
-
144
-/** get the corresp. free fixup function.*/
145
-free_fixup_function mod_fix_get_fixup_free(fixup_function f);
146
-
147
-#endif
Browse code

core: add fixup_pvar_pvar_pvar()

Victor Seva authored on 09/09/2015 08:30:27
Showing 1 changed files
... ...
@@ -103,6 +103,9 @@ int fixup_free_pvar_none(void** param, int param_no);
103 103
 int fixup_pvar_pvar(void **param, int param_no);
104 104
 int fixup_free_pvar_pvar(void** param, int param_no);
105 105
 
106
+int fixup_pvar_pvar_pvar(void **param, int param_no);
107
+int fixup_free_pvar_pvar_pvar(void** param, int param_no);
108
+
106 109
 int fixup_pvar_str(void** param, int param_no);
107 110
 int fixup_free_pvar_str(void** param, int param_no);
108 111
 
Browse code

core: Modify doxygen, remove history, remove SVN IDs, change "ser" and "sip-router" to "KAMAILIO"

Olle E. Johansson authored on 16/01/2015 16:38:46
Showing 1 changed files
... ...
@@ -16,7 +16,7 @@
16 16
 
17 17
 /**
18 18
  * @file mod_fix.h
19
- * @brief Generic fixup functions for module function parameter.
19
+ * @brief Kamailio core :: Generic fixup functions for module function parameter.
20 20
  * (kamailio compatibility)
21 21
  * @ingroup core
22 22
  * Module: \ref core
Browse code

Core Update of doxygen, removal of history, changing "ser" to "kamailio"

Olle E. Johansson authored on 03/01/2015 14:03:24
Showing 1 changed files
... ...
@@ -1,6 +1,4 @@
1 1
 /* 
2
- * $Id$
3
- * 
4 2
  * Copyright (C) 2008 iptelorg GmbH
5 3
  *
6 4
  * Permission to use, copy, modify, and distribute this software for any
... ...
@@ -15,10 +13,13 @@
15 13
  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 14
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 15
  */
16
+
18 17
 /**
19 18
  * @file mod_fix.h
20 19
  * @brief Generic fixup functions for module function parameter.
21 20
  * (kamailio compatibility)
21
+ * @ingroup core
22
+ * Module: \ref core
22 23
  */
23 24
 
24 25
 #ifndef _mod_fix_h_
Browse code

core: added mod fix helper fixup_pvar_none(...)

- first parameter is PV and the rest are not fixed up

Daniel-Constantin Mierla authored on 06/10/2012 07:38:57
Showing 1 changed files
... ...
@@ -96,6 +96,9 @@ int fixup_regexpNL_none(void** param, int param_no);
96 96
 int fixup_pvar_null(void **param, int param_no);
97 97
 int fixup_free_pvar_null(void** param, int param_no);
98 98
 
99
+int fixup_pvar_none(void** param, int param_no);
100
+int fixup_free_pvar_none(void** param, int param_no);
101
+
99 102
 int fixup_pvar_pvar(void **param, int param_no);
100 103
 int fixup_free_pvar_pvar(void** param, int param_no);
101 104
 
Browse code

core: fixup helper function for spve - igp parameters

Daniel-Constantin Mierla authored on 19/07/2012 08:23:20
Showing 1 changed files
... ...
@@ -131,6 +131,9 @@ int fixup_free_spve_str(void** param, int param_no);
131 131
 int fixup_spve_all(void** param, int param_no);
132 132
 int fixup_igp_all(void** param, int param_no);
133 133
 
134
+int fixup_spve_igp(void** param, int param_no);
135
+int fixup_free_spve_igp(void** param, int param_no);
136
+
134 137
 /** get the corresp. free fixup function.*/
135 138
 free_fixup_function mod_fix_get_fixup_free(fixup_function f);
136 139
 
Browse code

core: helper fixup function for all parameters int/pvar

Daniel-Constantin Mierla authored on 22/02/2012 16:40:33
Showing 1 changed files
... ...
@@ -129,6 +129,7 @@ int fixup_spve_str(void** param, int param_no);
129 129
 int fixup_free_spve_str(void** param, int param_no);
130 130
 
131 131
 int fixup_spve_all(void** param, int param_no);
132
+int fixup_igp_all(void** param, int param_no);
132 133
 
133 134
 /** get the corresp. free fixup function.*/
134 135
 free_fixup_function mod_fix_get_fixup_free(fixup_function f);
Browse code

core: helper function for mod fixup when all parameters are spve

Daniel-Constantin Mierla authored on 16/01/2012 15:36:24
Showing 1 changed files
... ...
@@ -128,6 +128,7 @@ int fixup_spve_uint(void** param, int param_no);
128 128
 int fixup_spve_str(void** param, int param_no);
129 129
 int fixup_free_spve_str(void** param, int param_no);
130 130
 
131
+int fixup_spve_all(void** param, int param_no);
131 132
 
132 133
 /** get the corresp. free fixup function.*/
133 134
 free_fixup_function mod_fix_get_fixup_free(fixup_function f);
Browse code

core: Add fixup_pvar_uint helper function

Alex Hermann authored on 10/06/2011 10:56:11
Showing 1 changed files
... ...
@@ -105,6 +105,9 @@ int fixup_free_pvar_str(void** param, int param_no);
105 105
 int fixup_pvar_str_str(void** param, int param_no);
106 106
 int fixup_free_pvar_str_str(void** param, int param_no);
107 107
 
108
+int fixup_pvar_uint(void** param, int param_no);
109
+int fixup_free_pvar_uint(void** param, int param_no);
110
+
108 111
 int fixup_igp_igp(void** param, int param_no);
109 112
 int fixup_free_igp_igp(void** param, int param_no);
110 113
 int fixup_igp_null(void** param, int param_no);
Browse code

core: functions to get a fixup corresp. fixup_free function

Added functions that given a known fixup, returns its
corresponding fixup_free function.
The known fixups are the fparam style fixups and the kamailio
style fixups (from mod_fix.h).

Andrei Pelinescu-Onciul authored on 05/08/2010 21:09:26
Showing 1 changed files
... ...
@@ -125,4 +125,8 @@ int fixup_spve_uint(void** param, int param_no);
125 125
 int fixup_spve_str(void** param, int param_no);
126 126
 int fixup_free_spve_str(void** param, int param_no);
127 127
 
128
+
129
+/** get the corresp. free fixup function.*/
130
+free_fixup_function mod_fix_get_fixup_free(fixup_function f);
131
+
128 132
 #endif
Browse code

core: k style fixup_free fixes

- always restore the original parameter pointer value in
fixup_free function.
- fixup_uint_*() re-written (don't use fparam and hence avoid
a pkg_malloc()).
- remove fixup_free_uint_*(): since the fixup_uint_*() functions
replace the original string pointer directly with an integer,
it's never possible to restore the original value => it's not
possible to have a proper fixup_free_uint_*().
- fixup_regexp_null() and fixup_free_regexp_null() fixed &
re-written. fixup_regexp_null() now uses a hack to save the
original pointer so that fixup_free_regexp_null() can restore
it (now fixup_free_regexp_null() works).
- fixup_pvar_*() and fixup_free_pvar_*() fixed & re-written
(similar with fixup_regexp_null()).
- fixup_igp_pvar(), fixup_igp_pvar_pvar(), fixup_free_igp_pvar()
and fixup_free_igp_pvar_pvar() fixed & re-written
(similar with fixup_regexp_null()).
- added missing fixup_free_* declarations.

Andrei Pelinescu-Onciul authored on 05/08/2010 20:55:18
Showing 1 changed files
... ...
@@ -106,7 +106,9 @@ int fixup_pvar_str_str(void** param, int param_no);
106 106
 int fixup_free_pvar_str_str(void** param, int param_no);
107 107
 
108 108
 int fixup_igp_igp(void** param, int param_no);
109
+int fixup_free_igp_igp(void** param, int param_no);
109 110
 int fixup_igp_null(void** param, int param_no);
111
+int fixup_free_igp_null(void** param, int param_no);
110 112
 int fixup_get_ivalue(struct sip_msg* msg, gparam_p gp, int *val);
111 113
 
112 114
 int fixup_igp_pvar(void** param, int param_no);
... ...
@@ -116,8 +118,11 @@ int fixup_igp_pvar_pvar(void** param, int param_no);
116 118
 int fixup_free_igp_pvar_pvar(void** param, int param_no);
117 119
 
118 120
 int fixup_spve_spve(void** param, int param_no);
121
+int fixup_free_spve_spve(void** param, int param_no);
119 122
 int fixup_spve_null(void** param, int param_no);
123
+int fixup_free_spve_null(void** param, int param_no);
120 124
 int fixup_spve_uint(void** param, int param_no);
121 125
 int fixup_spve_str(void** param, int param_no);
126
+int fixup_free_spve_str(void** param, int param_no);
122 127
 
123 128
 #endif
Browse code

* core

* Added fixup_igp_pvar and fixup_free_igp_pvar fixup functions.

Juha Heinanen authored on 19/06/2009 13:40:24
Showing 1 changed files
... ...
@@ -109,6 +109,9 @@ int fixup_igp_igp(void** param, int param_no);
109 109
 int fixup_igp_null(void** param, int param_no);
110 110
 int fixup_get_ivalue(struct sip_msg* msg, gparam_p gp, int *val);
111 111
 
112
+int fixup_igp_pvar(void** param, int param_no);
113
+int fixup_free_igp_pvar(void** param, int param_no);
114
+
112 115
 int fixup_igp_pvar_pvar(void** param, int param_no);
113 116
 int fixup_free_igp_pvar_pvar(void** param, int param_no);
114 117
 
Browse code

core: removed fixup_pvar(param) prototype

- no longer implemented as standalone function
- use fixup_pvar_null(param, 1) instead

Daniel-Constantin Mierla authored on 08/05/2009 06:12:18
Showing 1 changed files
... ...
@@ -117,7 +117,4 @@ int fixup_spve_null(void** param, int param_no);
117 117
 int fixup_spve_uint(void** param, int param_no);
118 118
 int fixup_spve_str(void** param, int param_no);
119 119
 
120
-
121
-int fixup_pvar(void **param);
122
-
123 120
 #endif
Browse code

core: commented prototype of free_/fixup_regexp_none()

- these functions are used only by textops module
- implementation of these functions added to textops

Daniel-Constantin Mierla authored on 16/04/2009 22:27:37
Showing 1 changed files
... ...
@@ -85,9 +85,9 @@ int fixup_uint_uint(void** param, int param_no);
85 85
 
86 86
 int fixup_regexp_null(void** param, int param_no);
87 87
 int fixup_free_regexp_null(void** param, int param_no);
88
+#if 0
88 89
 int fixup_regexp_none(void** param, int param_no);
89 90
 int fixup_free_regexp_none(void** param, int param_no);
90
-#if 0
91 91
 /* not implemened yet */
92 92
 int fixup_regexpNL_null(void** param, int param_no);
93 93
 int fixup_regexpNL_none(void** param, int param_no);
Browse code

fixups: added kamailio compatible fixups

- added kamailio compatible fixups (e.g. fixup_str_str), which use
ser fix_param() underneath
- added kamailio compatible macros for gparam_t (which is now fparam_t)
and fixup_get_[si]value() (to get_{int,str}_value)

Andrei Pelinescu-Onciul authored on 27/11/2008 01:46:50
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,123 @@
1
+/* 
2
+ * $Id$
3
+ * 
4
+ * Copyright (C) 2008 iptelorg GmbH
5
+ *
6
+ * Permission to use, copy, modify, and distribute this software for any
7
+ * purpose with or without fee is hereby granted, provided that the above
8
+ * copyright notice and this permission notice appear in all copies.
9
+ *
10
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17
+ */
18
+/**
19
+ * @file mod_fix.h
20
+ * @brief Generic fixup functions for module function parameter.
21
+ * (kamailio compatibility)
22
+ */
23
+
24
+#ifndef _mod_fix_h_
25
+#define _mod_fix_h_
26
+
27
+#include "sr_module.h"
28
+#include "pvar.h"
29
+
30
+#define GPARAM_TYPE_INT		FPARAM_INT
31
+#define GPARAM_TYPE_STR		FPARAM_STR
32
+#define GPARAM_TYPE_PVS		FPARAM_PVS
33
+#define GPARAM_TYPE_PVE		FPARAM_PVE
34
+
35
+/**
36
+ * generic parameter that holds a string, an int, a pseudo-variable
37
+ * or a ser select, avp, or subst.
38
+ * 
39
+ * Note: used only for compatibility with existing kamailio code,
40
+ *  please use fparam_t directly in the future.
41
+ *
42
+ * @see fparam_t
43
+ */
44
+
45
+/* reuse ser fparam_t */
46
+#define gparam_t fparam_t
47
+
48
+typedef gparam_t *gparam_p;
49
+
50
+int fixup_get_svalue(struct sip_msg* msg, gparam_p gp, str *val);
51
+
52
+/** get a string value out of a fparam_t.
53
+  *
54
+  * Note: this macro/function is  for kamailio compatibility
55
+  * (please use get_str_fparam() directly in the future)
56
+  *
57
+  * @param msg  - pointer to the sip message
58
+  * @param fp   - pointer to the fparam_t
59
+  * @param sval - pointer to str, used to store the result
60
+  * @return  0 on success, -1 on error
61
+  */
62
+#define fixup_get_svalue(msg, fp, sval) get_str_fparam(sval, msg, fp)
63
+
64
+/** get an int value out of a fparam_t.
65
+  *
66
+  * Note: this macro/function is  for kamailio compatibility
67
+  * (please use get_int_fparam() directly in the future)
68
+  *
69
+  * @param msg  - pointer to the sip message
70
+  * @param fp   - pointer to the fparam_t
71
+  * @param ival - pointer to str, used to store the result
72
+  * @return  0 on success, -1 on error
73
+  */
74
+#define fixup_get_ivalue(msg, fp, ival) get_int_fparam(ival, msg, fp)
75
+
76
+int fixup_str_null(void** param, int param_no);
77
+int fixup_str_str(void** param, int param_no);
78
+
79
+int fixup_free_str_null(void** param, int param_no);
80
+int fixup_free_str_str(void** param, int param_no);
81
+
82
+int fixup_uint_null(void** param, int param_no);
83
+int fixup_uint_uint(void** param, int param_no);
84
+
85
+
86
+int fixup_regexp_null(void** param, int param_no);
87
+int fixup_free_regexp_null(void** param, int param_no);
88
+int fixup_regexp_none(void** param, int param_no);
89
+int fixup_free_regexp_none(void** param, int param_no);
90
+#if 0
91
+/* not implemened yet */
92
+int fixup_regexpNL_null(void** param, int param_no);
93
+int fixup_regexpNL_none(void** param, int param_no);
94
+#endif
95
+
96
+int fixup_pvar_null(void **param, int param_no);
97
+int fixup_free_pvar_null(void** param, int param_no);
98
+
99
+int fixup_pvar_pvar(void **param, int param_no);
100
+int fixup_free_pvar_pvar(void** param, int param_no);
101
+
102
+int fixup_pvar_str(void** param, int param_no);
103
+int fixup_free_pvar_str(void** param, int param_no);
104
+
105
+int fixup_pvar_str_str(void** param, int param_no);
106
+int fixup_free_pvar_str_str(void** param, int param_no);
107
+
108
+int fixup_igp_igp(void** param, int param_no);
109
+int fixup_igp_null(void** param, int param_no);
110
+int fixup_get_ivalue(struct sip_msg* msg, gparam_p gp, int *val);
111
+
112
+int fixup_igp_pvar_pvar(void** param, int param_no);
113
+int fixup_free_igp_pvar_pvar(void** param, int param_no);
114
+
115
+int fixup_spve_spve(void** param, int param_no);
116
+int fixup_spve_null(void** param, int param_no);
117
+int fixup_spve_uint(void** param, int param_no);
118
+int fixup_spve_str(void** param, int param_no);
119
+
120
+
121
+int fixup_pvar(void **param);
122
+
123
+#endif
Browse code

- no more needed

Jan Janak authored on 11/10/2005 16:56:20
Showing 1 changed files
1 1
deleted file mode 100644
... ...
@@ -1,37 +0,0 @@
1
-/*
2
- *$Id$
3
- *
4
- */
5
-
6
-
7
-#ifndef _modfix_h
8
-#define _modfix_h
9
-
10
-#include "mem/mem.h"
11
-#include "str.h"
12
-#include "error.h"
13
-
14
-
15
-/*  
16
- * Convert char* parameter to str* parameter   
17
- */
18
-static int str_fixup(void** param, int param_no)
19
-{
20
-	str* s;
21
-	
22
-	if (param_no == 1 || param_no == 2 ) {
23
-		s = (str*)pkg_malloc(sizeof(str));
24
-		if (!s) {
25
-			LOG(L_ERR, "str_fixup(): No memory left\n");
26
-			return E_UNSPEC;
27
-		}
28
-		
29
-		s->s = (char*)*param;
30
-		s->len = strlen(s->s);
31
-		*param = (void*)s;
32
-	}
33
-	
34
-	return 0;
35
-}
36
-
37
-#endif
Browse code

AVP support introduced (not tested yet)

Jiri Kuthan authored on 27/09/2004 03:11:07
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,37 @@
1
+/*
2
+ *$Id$
3
+ *
4
+ */
5
+
6
+
7
+#ifndef _modfix_h
8
+#define _modfix_h
9
+
10
+#include "mem/mem.h"
11
+#include "str.h"
12
+#include "error.h"
13
+
14
+
15
+/*  
16
+ * Convert char* parameter to str* parameter   
17
+ */
18
+static int str_fixup(void** param, int param_no)
19
+{
20
+	str* s;
21
+	
22
+	if (param_no == 1 || param_no == 2 ) {
23
+		s = (str*)pkg_malloc(sizeof(str));
24
+		if (!s) {
25
+			LOG(L_ERR, "str_fixup(): No memory left\n");
26
+			return E_UNSPEC;
27
+		}
28
+		
29
+		s->s = (char*)*param;
30
+		s->len = strlen(s->s);
31
+		*param = (void*)s;
32
+	}
33
+	
34
+	return 0;
35
+}
36
+
37
+#endif