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

Function parse_to_param

parser/parse_to.c:92–489  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

90
91
92static inline char* parse_to_param(char *buffer, char *end,
93 struct to_body *to_b,
94 int *returned_status,
95 int multi)
96{
97 struct to_param *param;
98 int status;
99 int saved_status;
100 char *tmp;
101
102 param=0;
103 status=E_PARA_VALUE;
104 saved_status=E_PARA_VALUE;
105 for( tmp=buffer; tmp<end; tmp++)
106 {
107 switch(*tmp)
108 {
109 case ' ':
110 case '\t':
111 switch (status)
112 {
113 case TAG3:
114 param->type=TAG_PARAM;
115 case PARA_NAME:
116 case TAG1:
117 case TAG2:
118 param->name.len = tmp-param->name.s;
119 status = S_EQUAL;
120 break;
121 case PARA_VALUE_TOKEN:
122 param->value.len = tmp-param->value.s;
123 status = E_PARA_VALUE;
124 add_param( param , to_b );
125 break;
126 case F_CRLF:
127 case F_LF:
128 case F_CR:
129 /*previous=crlf and now =' '*/
130 status=saved_status;
131 break;
132 }
133 break;
134 case '\n':
135 switch (status)
136 {
137 case S_PARA_NAME:
138 case S_EQUAL:
139 case S_PARA_VALUE:
140 case E_PARA_VALUE:
141 saved_status=status;
142 status=F_LF;
143 break;
144 case TAG3:
145 param->type=TAG_PARAM;
146 case PARA_NAME:
147 case TAG1:
148 case TAG2:
149 param->name.len = tmp-param->name.s;

Callers 1

_parse_toFunction · 0.85

Calls 1

free_to_paramsFunction · 0.85

Tested by

no test coverage detected