* searches the module list and returns pointer to "name" function in module * "mod" or 0 if not found * flags parameter is OR value of all flags that must match */
| 575 | * flags parameter is OR value of all flags that must match |
| 576 | */ |
| 577 | cmd_function find_mod_export(const char* mod, const char* name, int flags) |
| 578 | { |
| 579 | struct sr_module* t; |
| 580 | const cmd_export_t* cmd; |
| 581 | |
| 582 | for (t = modules; t; t = t->next) { |
| 583 | if (strcmp(t->exports->name, mod) == 0) { |
| 584 | for (cmd = t->exports->cmds; cmd && cmd->name; cmd++) { |
| 585 | if ((strcmp(name, cmd->name) == 0) && |
| 586 | ((cmd->flags & flags) == flags) |
| 587 | ){ |
| 588 | LM_DBG("found <%s> in module %s [%s]\n", |
| 589 | name, t->exports->name, t->path); |
| 590 | return cmd->function; |
| 591 | } |
| 592 | } |
| 593 | } |
| 594 | } |
| 595 | |
| 596 | LM_DBG("<%s> in module %s not found\n", name, mod); |
| 597 | return 0; |
| 598 | } |
| 599 | |
| 600 | |
| 601 |
no outgoing calls
no test coverage detected