[SR-Dev] git:sip-router: module interface: minor changes from kamailio

Andrei Pelinescu-Onciul andrei at iptel.org
Tue Nov 18 01:11:13 CET 2008

Module: sip-router
Branch: andrei/mod_f_params
Commit: 1dd086b90c043db12f70974d7de46691feb0aa0b
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=1dd086b90c043db12f70974d7de46691feb0aa0b

Author: Andrei Pelinescu-Onciul <andrei at iptel.org>
Committer: Andrei Pelinescu-Onciul <andrei at iptel.org>
Date:   Mon Nov 17 18:21:53 2008 +0100

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 at 1und1.de>


 sr_module.h |   19 ++++++++++++++-----
 1 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/sr_module.h b/sr_module.h
index 15aed59..f099f37 100644
--- a/sr_module.h
+++ b/sr_module.h
@@ -41,6 +41,13 @@
  *  2007-06-07  added PROC_INIT, called in the main process context
  *               (same as PROC_MAIN), buf guaranteed to be called before
  *               any other process is forked (andrei)
+ *  2008-11-17  sip-router version: includes some of the openser/kamailio
+ *               changes: f(void) instead of f(), free_fixup_function()
+ */
+ * \file
+ * \brief modules/plug-in structures declarations
@@ -53,12 +60,14 @@
 #include "route_struct.h"
 #include "str.h"
-typedef  struct module_exports* (*module_register)();
+typedef  struct module_exports* (*module_register)(void);
 typedef  int (*cmd_function)(struct sip_msg*, char*, char*);
 typedef  int (*fixup_function)(void** param, int param_no);
+typedef  int (*free_fixup_function)(void** param, int param_no);
 typedef  int (*response_function)(struct sip_msg*);
 typedef  void (*onbreak_function)(struct sip_msg*);
-typedef void (*destroy_function)();
+typedef void (*destroy_function)(void);
 typedef int (*init_function)(void);
 typedef int (*child_init_function)(int rank);
@@ -193,19 +202,19 @@ extern struct sr_module* modules; /* global module list*/
 extern response_function* mod_response_cbks;/* response callback array */
 extern int mod_response_cbk_no;    /* size of reponse callbacks array */
-int register_builtin_modules();
+int register_builtin_modules(void);
 int register_module(struct module_exports*, char*,  void*);
 int load_module(char* path);
 cmd_export_t* find_export_record(char* name, int param_no, int flags);
 cmd_function find_export(char* name, int param_no, int flags);
 cmd_function find_mod_export(char* mod, char* name, int param_no, int flags);
 rpc_export_t* find_rpc_export(char* name, int flags);
-void destroy_modules();
+void destroy_modules(void);
 int init_child(int rank);
 int init_modules(void);
 struct sr_module* find_module_by_name(char* mod);
+/*! \brief
  * Find a parameter with given type and return it's
  * address in memory
  * If there is no such parameter, NULL is returned

More information about the sr-dev mailing list