Defines | Functions

mod_fix.c File Reference

SIP-router core :: kamailio compatible fixupsModule: SIP-router core. More...

#include "mod_fix.h"
#include "mem/mem.h"
#include "trim.h"
Include dependency graph for mod_fix.c:

Go to the source code of this file.

Defines

Functions


Detailed Description

Definition in file mod_fix.c.


Define Documentation

#define FIXUP_F1T (   suffix,
  minp,
  maxp,
  type 
)    FIXUP_F2T(suffix, minp, maxp, maxp, type, 0)
See also:
FIXUP_F2T.

Definition at line 157 of file mod_fix.c.

#define FIXUP_F2FP (   suffix,
  minp,
  maxp,
  no1,
  type1,
  type2 
)
Value:
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.

Parameters:
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

Definition at line 67 of file mod_fix.c.

#define FIXUP_F2FP_T (   suffix,
  minp,
  maxp,
  no1,
  type1,
  type2 
)
Value:
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; \
        }
See also:
FIXUP_F2FP for the parameters with the exception that only the first no1 parameters are converted to fparamt_t and the rest directly to the correponding type

Side effect: declares also some _fpt_helper functions

Definition at line 129 of file mod_fix.c.

#define FIXUP_F2T (   suffix,
  minp,
  maxp,
  no1,
  type1,
  type2 
)
Value:
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; \
        }
See also:
FIXUP_F2FP for the parameters Side effect: declares also some _fp_helper functions

Definition at line 96 of file mod_fix.c.

#define FIXUP_F_SPVE_T (   suffix,
  minp,
  maxp,
  no1,
  type2 
)
See also:
FIXUP_F2FP for the parameters with the exception that the first no1 parameters are converted to fparam_t from spve and the rest directly to the corresponding type

Side effect: declares also some _spvet_helper functions

Definition at line 474 of file mod_fix.c.


Function Documentation

free_fixup_function mod_fix_get_fixup_free ( fixup_function  f  ) 

fixup_free* function.

Parameters:
f -fixup function pointer.
Returns:
- pointer to free_fixup function if known, 0 otherwise.

Definition at line 519 of file mod_fix.c.

Referenced by get_fixup_free().

Here is the caller graph for this function: