Commit eface52f authored by Pekka Pessi's avatar Pekka Pessi

Removed duplicate function msg_params_matching().

darcs-hash:20051201091131-65a35-48942f6b8b643af4766ba7aa84627a40307382e1.gz
parent 40912386
......@@ -184,8 +184,6 @@ int msg_random_token(char token[], int tlen, void const *data, int dlen);
msg_param_t msg_params_find(msg_param_t const pp[], msg_param_t);
msg_param_t *msg_params_find_slot(msg_param_t params[], msg_param_t token);
msg_param_t msg_params_matching(msg_param_t const params[],
msg_param_t param);
int msg_params_add(su_home_t *sh, msg_param_t **pp, msg_param_t);
int msg_params_cmp(msg_param_t const a[], msg_param_t const b[]);
int msg_params_replace(su_home_t *, msg_param_t **pp, msg_param_t);
......
......@@ -831,42 +831,6 @@ msg_param_t *msg_params_find_slot(msg_param_t params[], msg_param_t token)
return NULL;
}
/** Find a matching parameter from a parameter list.
*
* Searches for a matching parameter @a token from the parameter list. If a
* matching parameter is found, it returns a non-NULL pointer to the
* parameter value. If there is no value for the parameter (the parameter is
* of form "name"), the returned pointer points to a NUL character.
*
* @param params list (or vector) of parameters
* @param param parameter to be matched
*
* @return
* A pointer to parameter value, or NULL if no matching parameter was not
* found.
*/
msg_param_t msg_params_matching(msg_param_t const params[],
msg_param_t param)
{
if (params && param) {
int i, n = strcspn(param, "=");
assert(n > 0);
for (i = 0; params[i]; i++) {
msg_param_t match = params[i];
if (strncasecmp(match, param, n) == 0) {
if (match[n] == '=' && match[n + 1] != '\0')
return match + n + 1;
else if (match[n] == 0)
return match + n;
}
}
}
return NULL;
}
/** Replace or add a parameter from a list.
*
*/
......
......@@ -353,7 +353,7 @@ int sip_contact_accept(sip_contact_t const *m,
N++;
cap = msg_params_matching(m->m_params, acc);
cap = msg_params_find(m->m_params, acc);
if (cap) {
eq = strcspn(acc, "=");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment