Browse Source

core: define module_loaded to use find_module_by_name

- it was declared but not implemented
- in use by snmpstats and perlvdb modules
- reported by Santiago Gimeno
(cherry picked from commit d4db8304926d30a4244b9ee05d21b5614eae5f94)
Daniel-Constantin Mierla 15 năm trước cách đây
mục cha
commit
4627c2f4e7
1 tập tin đã thay đổi với 4 bổ sung14 xóa
  1. 4 14
      sr_module.h

+ 4 - 14
sr_module.h

@@ -389,6 +389,10 @@ int init_child(int rank);
 int init_modules(void);
 int init_modules(void);
 struct sr_module* find_module_by_name(char* mod);
 struct sr_module* find_module_by_name(char* mod);
 
 
+/* true if the module with name 'mod_name' is loaded */
+#define module_loaded(mod_name) (find_module_by_name(mod_name)!=0)
+
+
 /*! \brief
 /*! \brief
  * Find a parameter with given type and return it's
  * Find a parameter with given type and return it's
  * address in memory
  * address in memory
@@ -520,18 +524,4 @@ int get_int_fparam(int* dst, struct sip_msg* msg, fparam_t* param);
 int get_regex_fparam(regex_t *dst, struct sip_msg* msg, fparam_t* param);
 int get_regex_fparam(regex_t *dst, struct sip_msg* msg, fparam_t* param);
 
 
 
 
-/* functions needed for kamailio/openser compatibility */
-
-/*! \brief Check if module is loaded
- * \return Returns 1 if the module with name 'name' is loaded, and zero otherwise. */
-int module_loaded(char *name);
-
-/*! \brief Counts the additional the number of processes
- requested by modules */
-int count_module_procs(void);
-
-
-/*! \brief Forks and starts the additional processes required by modules */
-int start_module_procs(void);
-
 #endif /* sr_module_h */
 #endif /* sr_module_h */