MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / pv_parse_spec

Function pv_parse_spec

pvar.c:4979–5287  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4977}
4978
4979char* pv_parse_spec(const str *in, const pv_spec_p e)
4980{
4981 char *p;
4982 str s;
4983 str pvname;
4984 str pvcontext;
4985 int pvstate;
4986 int has_inner_name;
4987 trans_t *tr = NULL;
4988 const pv_export_t *pte = NULL;
4989 int n=0;
4990
4991 if(in==NULL || in->s==NULL || e==NULL || *in->s!=PV_MARKER)
4992 {
4993 LM_ERR("bad parameters\n");
4994 return NULL;
4995 }
4996
4997// LM_DBG("***** input [%.*s] (%d)\n", in->len, in->s, in->len);
4998 tr = 0;
4999 pvstate = 0;
5000 memset(e, 0, sizeof(pv_spec_t));
5001 p = in->s;
5002 p++;
5003 if(*p==PV_LNBRACKET)
5004 {
5005 p++;
5006 pvstate = 1;
5007 }
5008 pvname.s = p;
5009 if(*p == PV_MARKER) {
5010 p++;
5011 if(pvstate==1)
5012 {
5013 if(*p!=PV_RNBRACKET)
5014 goto error;
5015 p++;
5016 }
5017 e->getf = pv_get_marker;
5018 e->type = PVT_MARKER;
5019 pvname.len = 1;
5020 goto done_all;
5021 }
5022
5023 if (*p==PV_LCBRACKET)
5024 { /* context definition*/
5025 p++;
5026 pvcontext.s = p;
5027
5028 while(is_in_str(p,in) && is_pv_valid_char(*p))
5029 p++;
5030
5031 if(*p != PV_RCBRACKET)
5032 {
5033 LM_ERR("Expected to find the end of the context\n");
5034 return 0;
5035 }
5036 pvcontext.len = p - pvcontext.s;

Callers 15

parse_sdp_pv_indexFunction · 0.85
pv_parse_hdr_nameFunction · 0.85
pv_parse_avp_nameFunction · 0.85
pv_parse_indexFunction · 0.85
pv_parse_formatFunction · 0.85
parse_pvname_listFunction · 0.85
pv_parse_param_nameFunction · 0.85
pv_parse_return_valueFunction · 0.85
fix_actionsFunction · 0.85
parse_replFunction · 0.85
tr_parse_nparamFunction · 0.85
tr_parse_sparamFunction · 0.85

Calls 5

is_pv_valid_charFunction · 0.85
pv_get_contextFunction · 0.85
add_pv_contextFunction · 0.85
pv_lookup_spec_nameFunction · 0.85
parse_transformationFunction · 0.85

Tested by

no test coverage detected