"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/osipparser2/sdp_accessor.c" between
libosip2-5.1.0.tar.gz and libosip2-5.1.1.tar.gz

About: The GNU oSIP library is an implementation of SIP (RFC3261).

sdp_accessor.c  (libosip2-5.1.0):sdp_accessor.c  (libosip2-5.1.1)
/* /*
The oSIP library implements the Session Initiation Protocol (SIP -rfc3261-) The oSIP library implements the Session Initiation Protocol (SIP -rfc3261-)
Copyright (C) 2001-2015 Aymeric MOIZARD amoizard@antisip.com Copyright (C) 2001-2020 Aymeric MOIZARD amoizard@antisip.com
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
skipping to change at line 583 skipping to change at line 583
} }
else else
i++; i++;
} }
return OSIP_SUCCESS; return OSIP_SUCCESS;
} }
int int
sdp_message_a_attribute_del_at_index (sdp_message_t * sdp, int pos_media, char * att_field, int pos_attr) sdp_message_a_attribute_del_at_index (sdp_message_t * sdp, int pos_media, char * att_field, int pos_attr)
{ {
int i;
sdp_media_t *med; sdp_media_t *med;
sdp_attribute_t *attr; sdp_attribute_t *attr;
if (sdp == NULL) if (sdp == NULL)
return OSIP_BADPARAMETER; return OSIP_BADPARAMETER;
if ((pos_media != -1) && (osip_list_size (&sdp->m_medias) < pos_media + 1)) if ((pos_media != -1) && (osip_list_size (&sdp->m_medias) < pos_media + 1))
return OSIP_UNDEFINED_ERROR; return OSIP_BADPARAMETER;
if (pos_attr == -1)
return sdp_message_a_attribute_del (sdp, pos_media, att_field);
if (pos_media == -1) { if (pos_media == -1) {
if (pos_attr == -1) { if ((attr = osip_list_get (&sdp->a_attributes, pos_attr)) != NULL) {
for (i = 0; i < osip_list_size (&sdp->a_attributes);) { if (strcmp (attr->a_att_field, att_field) == 0) {
attr = osip_list_get (&sdp->a_attributes, i); osip_list_remove (&sdp->a_attributes, pos_attr);
if (strcmp (attr->a_att_field, att_field) == 0) { sdp_attribute_free (attr);
osip_list_remove (&sdp->a_attributes, i); return OSIP_SUCCESS;
sdp_attribute_free (attr);
}
else
i++;
} }
} }
else if ((attr = osip_list_get (&sdp->a_attributes, pos_attr)) != NULL) { return OSIP_BADPARAMETER;
osip_list_remove (&sdp->a_attributes, pos_attr);
sdp_attribute_free (attr);
}
return OSIP_SUCCESS;
} }
med = (sdp_media_t *) osip_list_get (&sdp->m_medias, pos_media); med = (sdp_media_t *) osip_list_get (&sdp->m_medias, pos_media);
if (med == NULL) if (med == NULL)
return OSIP_UNDEFINED_ERROR; return OSIP_UNDEFINED_ERROR;
for (i = 0; i < osip_list_size (&med->a_attributes);) { if ((attr = osip_list_get (&med->a_attributes, pos_attr)) != NULL) {
if (pos_attr == -1) { if (strcmp (attr->a_att_field, att_field) == 0) {
attr = osip_list_get (&med->a_attributes, i);
if (strcmp (attr->a_att_field, att_field) == 0) {
osip_list_remove (&med->a_attributes, i);
sdp_attribute_free (attr);
}
else
i++;
}
else if ((attr = osip_list_get (&med->a_attributes, pos_attr)) != NULL) {
osip_list_remove (&med->a_attributes, pos_attr); osip_list_remove (&med->a_attributes, pos_attr);
sdp_attribute_free (attr); sdp_attribute_free (attr);
return OSIP_SUCCESS;
} }
} }
return OSIP_SUCCESS; return OSIP_BADPARAMETER;
} }
sdp_attribute_t * sdp_attribute_t *
sdp_message_attribute_get (sdp_message_t * sdp, int pos_media, int pos) sdp_message_attribute_get (sdp_message_t * sdp, int pos_media, int pos)
{ {
sdp_media_t *med; sdp_media_t *med;
if (sdp == NULL) if (sdp == NULL)
return NULL; return NULL;
if (pos_media == -1) if (pos_media == -1)
 End of changes. 8 change blocks. 
29 lines changed or deleted 15 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)