| 678 | } |
| 679 | |
| 680 | int is_mod_async_func_used(struct action *a, const char *name, int param_no) |
| 681 | { |
| 682 | const acmd_export_t *acmd; |
| 683 | |
| 684 | for (; a; a=a->next) { |
| 685 | if (a->type==ASYNC_T || a->type==LAUNCH_T) { |
| 686 | acmd = ((struct action *)(a->elem[0].u.data))->elem[0].u.data_const; |
| 687 | |
| 688 | if (strcasecmp(acmd->name, name)==0) { |
| 689 | if (param_no==-1 || |
| 690 | (((struct action *)(a->elem[0].u.data))->elem[param_no].type != NOSUBTYPE && |
| 691 | ((struct action *)(a->elem[0].u.data))->elem[param_no].type != NULLV_ST)) { |
| 692 | LM_DBG("function %s found to be used in script\n",name); |
| 693 | return 1; |
| 694 | } |
| 695 | |
| 696 | } |
| 697 | } |
| 698 | |
| 699 | /* follow all leads from actions than may have |
| 700 | * sub-blocks of instructions */ |
| 701 | if (a->elem[0].type==ACTIONS_ST) |
| 702 | if (is_mod_async_func_used((struct action*)a->elem[0].u.data, |
| 703 | name,param_no)==1) |
| 704 | return 1; |
| 705 | |
| 706 | if (a->elem[1].type==ACTIONS_ST) |
| 707 | if (is_mod_async_func_used((struct action*)a->elem[1].u.data, |
| 708 | name,param_no)==1) |
| 709 | return 1; |
| 710 | |
| 711 | if (a->elem[2].type==ACTIONS_ST) |
| 712 | if (is_mod_async_func_used((struct action*)a->elem[2].u.data, |
| 713 | name,param_no)==1) |
| 714 | return 1; |
| 715 | } |
| 716 | |
| 717 | return 0; |
| 718 | } |
no outgoing calls
no test coverage detected