SIP-router core :: kamailio compatible fixupsModule: SIP-router core. More...
#include "mod_fix.h"#include "mem/mem.h"#include "trim.h"
Go to the source code of this file.
Definition in file mod_fix.c.
| #define FIXUP_F1T | ( | suffix, | ||
| minp, | ||||
| maxp, | ||||
| type | ||||
| ) | FIXUP_F2T(suffix, minp, maxp, maxp, type, 0) |
| #define FIXUP_F2FP | ( | suffix, | ||
| minp, | ||||
| maxp, | ||||
| no1, | ||||
| type1, | ||||
| type2 | ||||
| ) |
int fixup_##suffix (void** param, int param_no) \ { \ if ((param_no > (maxp)) || (param_no <(minp))) \ return E_UNSPEC; \ if (param_no <= (no1)){ \ if (fix_param_types((type1), param)!=0) {\ ERR("Cannot convert function parameter %d to" #type1 "\n", \ param_no);\ return E_UNSPEC; \ } \ }else{ \ if (fix_param_types((type2), param)!=0) {\ ERR("Cannot convert function parameter %d to" #type2 "\n", \ param_no); \ return E_UNSPEC; \ } \ }\ return 0; \ } \ FREE_FIXUP_FP(suffix, minp, maxp)
The result (in *param) will be a fparam_t.
| suffix | - function suffix (fixup_ will be pre-pended to it | |
| minp | - minimum parameter number acceptable | |
| maxp | - maximum parameter number | |
| no1 | - number of parameters of type1 | |
| type1 | - fix_param type for the 1st param | |
| type2 | - fix_param type for all the other params |
| #define FIXUP_F2FP_T | ( | suffix, | ||
| minp, | ||||
| maxp, | ||||
| no1, | ||||
| type1, | ||||
| type2 | ||||
| ) |
FIXUP_F2FP(fpt_##suffix, minp, maxp, no1, type1, type2) \ int fixup_##suffix (void** param, int param_no) \ { \ int ret; \ if ((ret=fixup_fpt_##suffix(param, param_no))!=0) \ return ret; \ if (param_no>(no1)) *param=&((fparam_t*)*param)->v; \ return 0; \ } \ int fixup_free_##suffix (void** param, int param_no) \ { \ void* p; \ int ret; \ if (param && *param){ \ p=(param_no>(no1))? *param - (long)&((fparam_t*)0)->v : *param;\ if ((ret=fixup_free_fpt_##suffix(&p, param_no))==0) *param=p; \ return ret; \ } \ return 0; \ }
Side effect: declares also some _fpt_helper functions
| #define FIXUP_F2T | ( | suffix, | ||
| minp, | ||||
| maxp, | ||||
| no1, | ||||
| type1, | ||||
| type2 | ||||
| ) |
FIXUP_F2FP(fp_##suffix, minp, maxp, no1, type1, type2) \ int fixup_##suffix (void** param, int param_no) \ { \ int ret; \ if ((ret=fixup_fp_##suffix (param, param_no))!=0) \ return ret; \ *param=((fparam_t*)*param)->fixed; \ return 0; \ } \ int fixup_free_##suffix (void** param, int param_no) \ { \ void* p; \ int ret; \ if (param && *param){ \ p=*param - (long)&((fparam_t*)0)->v; \ if ((ret=fixup_free_fp_##suffix(&p, param_no))==0) *param=p; \ return ret; \ } \ return 0; \ }
| #define FIXUP_F_SPVE_T | ( | suffix, | ||
| minp, | ||||
| maxp, | ||||
| no1, | ||||
| type2 | ||||
| ) |
Side effect: declares also some _spvet_helper functions
| free_fixup_function mod_fix_get_fixup_free | ( | fixup_function | f | ) |
fixup_free* function.
| f | -fixup function pointer. |
Definition at line 519 of file mod_fix.c.
Referenced by get_fixup_free().

1.7.1