Ejemplo n.º 1
0
/*! \brief
 * Parse body of a parameter. It can be quoted string or
 * a single token.
 */
static inline int parse_param_body(str *_s, param_t *_c, char separator)
{
	if(_s->s[0] == '\"' || _s->s[0] == '\'') {
		if(parse_quoted_param(_s, &(_c->body)) < 0) {
			LM_ERR("Error while parsing quoted string\n");
			return -2;
		}
	} else {
		if(parse_token_param(_s, &(_c->body), separator) < 0) {
			LM_ERR("Error while parsing token\n");
			return -3;
		}
	}

	return 0;
}
Ejemplo n.º 2
0
/*
 * Parse body of a parameter. It can be quoted string or
 * a single token.
 */
static inline int parse_param_body(str* _s, param_t* _c)
{
	if (_s->s[0] == '\"') {
		if (parse_quoted_param(_s, &(_c->body)) < 0) {
			LM_ERR("failed to parse quoted string\n");
			return -2;
		}
	} else {
		if (parse_token_param(_s, &(_c->body)) < 0) {
			LM_ERR("failed to parse token\n");
			return -3;
		}
	}

	return 0;
}
Ejemplo n.º 3
0
/*
 * Parse body of a parameter. It can be quoted string or
 * a single token.
 */
static inline int parse_param_body(str* _s, param_t* _c)
{
	if (_s->s[0] == '\"') {
		if (parse_quoted_param(_s, &(_c->body)) < 0) {
			LOG(L_ERR, "parse_param_body(): Error while parsing quoted string\n");
			return -2;
		}
	} else {
		if (parse_token_param(_s, &(_c->body)) < 0) {
			LOG(L_ERR, "parse_param_body(): Error while parsing token\n");
			return -3;
		}
	}

	return 0;
}