Browse code

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 authored on 04/01/2010 20:32:24
Showing 1 changed files
... ...
@@ -389,6 +389,10 @@ int init_child(int rank);
389 389
 int init_modules(void);
390 390
 struct sr_module* find_module_by_name(char* mod);
391 391
 
392
+/* true if the module with name 'mod_name' is loaded */
393
+#define module_loaded(mod_name) (find_module_by_name(mod_name)!=0)
394
+
395
+
392 396
 /*! \brief
393 397
  * Find a parameter with given type and return it's
394 398
  * address in memory
... ...
@@ -520,18 +524,4 @@ int get_int_fparam(int* dst, struct sip_msg* msg, fparam_t* param);
520 520
 int get_regex_fparam(regex_t *dst, struct sip_msg* msg, fparam_t* param);
521 521
 
522 522
 
523
-/* functions needed for kamailio/openser compatibility */
524
-
525
-/*! \brief Check if module is loaded
526
- * \return Returns 1 if the module with name 'name' is loaded, and zero otherwise. */
527
-int module_loaded(char *name);
528
-
529
-/*! \brief Counts the additional the number of processes
530
- requested by modules */
531
-int count_module_procs(void);
532
-
533
-
534
-/*! \brief Forks and starts the additional processes required by modules */
535
-int start_module_procs(void);
536
-
537 523
 #endif /* sr_module_h */