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

Function parse_param_name

parser/digest/param_parser.c:194–235  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

192
193
194int parse_param_name(str* _s, dig_par_t* _type)
195{
196 register char* p;
197 register int val;
198 char* end;
199
200 end = _s->s + _s->len;
201
202 p = _s->s;
203 val = READ(p);
204
205 if (_s->len < 4) {
206 goto other;
207 }
208
209 switch(LOWER_DWORD(val)) {
210 FIRST_QUATERNIONS;
211 default:
212 PARSE_SHORT;
213 goto other;
214 }
215
216 end:
217 _s->len -= p - _s->s;
218 _s->s = p;
219
220 trim_leading(_s);
221 if (_s->s[0] == '=') {
222 return 0;
223 }
224
225 other:
226 p = q_memchr(p, '=', end - p);
227 if (!p) {
228 return -1; /* Parse error */
229 } else {
230 *_type = PAR_OTHER;
231 _s->len -= p - _s->s;
232 _s->s = p;
233 return 0;
234 }
235}

Callers 1

parse_digest_paramFunction · 0.70

Calls 2

trim_leadingFunction · 0.85
q_memchrFunction · 0.85

Tested by

no test coverage detected