Browse code

module interface: minor changes from kamailio

- changed callback with no params prototypes from f() into f(void), original
commit message:
- sync function definitions with declarations for functions w/o parameters
- this functions were declared as 'f()', that means they can have a
arbitrary number of arguments (because of compatibility to the old style
definitions in the C standard), even if they are defined as f(void)
- there is no warning reported if somebody call a function like this with
some parameters
- another potential problem is, when somebody change the definition to
accept some parameter, but forgot to change also the declaration. Then
the compiler will not report wrong usage of this functions too.
- sometimes ago the '-Wold-style-definition' warning was introduced, the
definitions get then fixed subsequently, but not all declarations

- added free_fixup_function type definition
- added some doxygen comments

Credits go to: Henning Westerholt <henning.westerholt@1und1.de>

Andrei Pelinescu-Onciul authored on 17/11/2008 17:21:53
Showing 1 changed files
... ...
@@ -41,6 +41,13 @@
41 41
  *  2007-06-07  added PROC_INIT, called in the main process context
42 42
  *               (same as PROC_MAIN), buf guaranteed to be called before
43 43
  *               any other process is forked (andrei)
44
+ *  2008-11-17  sip-router version: includes some of the openser/kamailio
45
+ *               changes: f(void) instead of f(), free_fixup_function()
46
+ */
47
+
48
+/*!
49
+ * \file
50
+ * \brief modules/plug-in structures declarations
44 51
  */
45 52
 
46 53
 
... ...
@@ -53,12 +60,14 @@
53 53
 #include "route_struct.h"
54 54
 #include "str.h"
55 55
 
56
-typedef  struct module_exports* (*module_register)();
56
+typedef  struct module_exports* (*module_register)(void);
57 57
 typedef  int (*cmd_function)(struct sip_msg*, char*, char*);
58 58
 typedef  int (*fixup_function)(void** param, int param_no);
59
+typedef  int (*free_fixup_function)(void** param, int param_no);
59 60
 typedef  int (*response_function)(struct sip_msg*);
60 61
 typedef  void (*onbreak_function)(struct sip_msg*);
61
-typedef void (*destroy_function)();
62
+typedef void (*destroy_function)(void);
63
+
62 64
 typedef int (*init_function)(void);
63 65
 typedef int (*child_init_function)(int rank);
64 66
 
... ...
@@ -193,19 +202,19 @@ extern struct sr_module* modules; /* global module list*/
193 193
 extern response_function* mod_response_cbks;/* response callback array */
194 194
 extern int mod_response_cbk_no;    /* size of reponse callbacks array */
195 195
 
196
-int register_builtin_modules();
196
+int register_builtin_modules(void);
197 197
 int register_module(struct module_exports*, char*,  void*);
198 198
 int load_module(char* path);
199 199
 cmd_export_t* find_export_record(char* name, int param_no, int flags);
200 200
 cmd_function find_export(char* name, int param_no, int flags);
201 201
 cmd_function find_mod_export(char* mod, char* name, int param_no, int flags);
202 202
 rpc_export_t* find_rpc_export(char* name, int flags);
203
-void destroy_modules();
203
+void destroy_modules(void);
204 204
 int init_child(int rank);
205 205
 int init_modules(void);
206 206
 struct sr_module* find_module_by_name(char* mod);
207 207
 
208
-/*
208
+/*! \brief
209 209
  * Find a parameter with given type and return it's
210 210
  * address in memory
211 211
  * If there is no such parameter, NULL is returned