* Initialize all loaded modules, the initialization * is done *AFTER* the configuration file is parsed */
| 810 | * is done *AFTER* the configuration file is parsed |
| 811 | */ |
| 812 | int init_modules(void) |
| 813 | { |
| 814 | struct sr_module *currentMod; |
| 815 | int ret; |
| 816 | |
| 817 | if (testing_framework) |
| 818 | init_unit_tests(); |
| 819 | |
| 820 | /* pre-initialize all modules */ |
| 821 | for (currentMod=modules; currentMod; currentMod=currentMod->next) { |
| 822 | if (currentMod->exports->preinit_f == NULL) |
| 823 | continue; |
| 824 | ret = currentMod->exports->preinit_f(); |
| 825 | if (ret < 0) { |
| 826 | LM_ERR("could not pre-initialize module %s!\n", |
| 827 | currentMod->exports->name); |
| 828 | return ret; |
| 829 | } |
| 830 | } |
| 831 | |
| 832 | return init_mod(modules, 0); |
| 833 | } |
| 834 | |
| 835 | |
| 836 | /* Returns 1 if the module with name 'name' is loaded, and zero otherwise. */ |
nothing calls this directly
no test coverage detected