Commit b535d1f1 authored by Ghislain MARY's avatar Ghislain MARY

Use bctbx_list_t instead of MSList that has been deprecated.

parent 9f01da42
......@@ -231,7 +231,7 @@ static bool_t realm_match(const char *realm1, const char *realm2){
}
static const LinphoneAuthInfo *find_auth_info(LinphoneCore *lc, const char *username, const char *realm, const char *domain, bool_t ignore_realm){
MSList *elem;
bctbx_list_t *elem;
const LinphoneAuthInfo *ret=NULL;
for (elem=lc->auth_info;elem!=NULL;elem=elem->next) {
......@@ -286,7 +286,7 @@ const LinphoneAuthInfo *linphone_core_find_auth_info(LinphoneCore *lc, const cha
/*the auth info is expected to be in the core's list*/
void linphone_core_write_auth_info(LinphoneCore *lc, LinphoneAuthInfo *ai){
int i;
MSList *elem = lc->auth_info;
bctbx_list_t *elem = lc->auth_info;
if (!lc->sip_conf.save_auth_info) return;
......@@ -298,12 +298,12 @@ void linphone_core_write_auth_info(LinphoneCore *lc, LinphoneAuthInfo *ai){
}
static void write_auth_infos(LinphoneCore *lc){
MSList *elem;
bctbx_list_t *elem;
int i;
if (!linphone_core_ready(lc)) return;
if (!lc->sip_conf.save_auth_info) return;
for(elem=lc->auth_info,i=0;elem!=NULL;elem=ms_list_next(elem),i++){
for(elem=lc->auth_info,i=0;elem!=NULL;elem=bctbx_list_next(elem),i++){
LinphoneAuthInfo *ai=(LinphoneAuthInfo*)(elem->data);
linphone_auth_info_write_config(lc->config,ai,i);
}
......@@ -321,8 +321,8 @@ LinphoneAuthInfo * linphone_core_create_auth_info(LinphoneCore *lc, const char *
**/
void linphone_core_add_auth_info(LinphoneCore *lc, const LinphoneAuthInfo *info){
LinphoneAuthInfo *ai;
MSList *elem;
MSList *l;
bctbx_list_t *elem;
bctbx_list_t *l;
int restarted_op_count=0;
bool_t updating=FALSE;
......@@ -333,11 +333,11 @@ void linphone_core_add_auth_info(LinphoneCore *lc, const LinphoneAuthInfo *info)
/* find if we are attempting to modify an existing auth info */
ai=(LinphoneAuthInfo*)linphone_core_find_auth_info(lc,info->realm,info->username,info->domain);
if (ai!=NULL && ai->domain && info->domain && strcmp(ai->domain, info->domain)==0){
lc->auth_info=ms_list_remove(lc->auth_info,ai);
lc->auth_info=bctbx_list_remove(lc->auth_info,ai);
linphone_auth_info_destroy(ai);
updating=TRUE;
}
lc->auth_info=ms_list_append(lc->auth_info,linphone_auth_info_clone(info));
lc->auth_info=bctbx_list_append(lc->auth_info,linphone_auth_info_clone(info));
/* retry pending authentication operations */
for(l=elem=sal_get_pending_auths(lc->sal);elem!=NULL;elem=elem->next){
......@@ -347,14 +347,14 @@ void linphone_core_add_auth_info(LinphoneCore *lc, const LinphoneAuthInfo *info)
ai=(LinphoneAuthInfo*)_linphone_core_find_auth_info(lc,req_sai->realm,req_sai->username,req_sai->domain, FALSE);
if (ai){
SalAuthInfo sai;
MSList* proxy;
bctbx_list_t* proxy;
sai.username=ai->username;
sai.userid=ai->userid;
sai.realm=ai->realm;
sai.password=ai->passwd;
sai.ha1=ai->ha1;
/*proxy case*/
for (proxy=(MSList*)linphone_core_get_proxy_config_list(lc);proxy!=NULL;proxy=proxy->next) {
for (proxy=(bctbx_list_t*)linphone_core_get_proxy_config_list(lc);proxy!=NULL;proxy=proxy->next) {
if (proxy->data == sal_op_get_user_pointer(op)) {
linphone_proxy_config_set_state((LinphoneProxyConfig*)(proxy->data),LinphoneRegistrationProgress,"Authentication...");
break;
......@@ -375,7 +375,7 @@ void linphone_core_add_auth_info(LinphoneCore *lc, const LinphoneAuthInfo *info)
info->realm ? info->realm : "",
info->domain ? info->domain : "");
}
ms_list_free(l);
bctbx_list_free(l);
write_auth_infos(lc);
}
......@@ -394,7 +394,7 @@ void linphone_core_remove_auth_info(LinphoneCore *lc, const LinphoneAuthInfo *in
LinphoneAuthInfo *r;
r=(LinphoneAuthInfo*)linphone_core_find_auth_info(lc,info->realm,info->username,info->domain);
if (r){
lc->auth_info=ms_list_remove(lc->auth_info,r);
lc->auth_info=bctbx_list_remove(lc->auth_info,r);
linphone_auth_info_destroy(r);
write_auth_infos(lc);
}
......@@ -405,7 +405,7 @@ void linphone_core_remove_auth_info(LinphoneCore *lc, const LinphoneAuthInfo *in
* @param[in] lc The LinphoneCore object
* @return \mslist{LinphoneAuthInfo}
**/
const MSList *linphone_core_get_auth_info_list(const LinphoneCore *lc){
const bctbx_list_t *linphone_core_get_auth_info_list(const LinphoneCore *lc){
return lc->auth_info;
}
......@@ -413,14 +413,14 @@ const MSList *linphone_core_get_auth_info_list(const LinphoneCore *lc){
* Clear all authentication information.
**/
void linphone_core_clear_all_auth_info(LinphoneCore *lc){
MSList *elem;
bctbx_list_t *elem;
int i;
for(i=0,elem=lc->auth_info;elem!=NULL;elem=ms_list_next(elem),i++){
for(i=0,elem=lc->auth_info;elem!=NULL;elem=bctbx_list_next(elem),i++){
LinphoneAuthInfo *info=(LinphoneAuthInfo*)elem->data;
linphone_auth_info_destroy(info);
linphone_auth_info_write_config(lc->config,NULL,i);
}
ms_list_free(lc->auth_info);
bctbx_list_free(lc->auth_info);
lc->auth_info=NULL;
}
......
......@@ -115,8 +115,8 @@ void sal_set_log_level(OrtpLogLevel level) {
}
void sal_add_pending_auth(Sal *sal, SalOp *op){
if (ms_list_find(sal->pending_auths,op)==NULL){
sal->pending_auths=ms_list_append(sal->pending_auths,op);
if (bctbx_list_find(sal->pending_auths,op)==NULL){
sal->pending_auths=bctbx_list_append(sal->pending_auths,op);
op->has_auth_pending=TRUE;
}
}
......@@ -124,8 +124,8 @@ void sal_add_pending_auth(Sal *sal, SalOp *op){
void sal_remove_pending_auth(Sal *sal, SalOp *op){
if (op->has_auth_pending){
op->has_auth_pending=FALSE;
if (ms_list_find(sal->pending_auths,op)){
sal->pending_auths=ms_list_remove(sal->pending_auths,op);
if (bctbx_list_find(sal->pending_auths,op)){
sal->pending_auths=bctbx_list_remove(sal->pending_auths,op);
}
}
}
......@@ -593,7 +593,7 @@ void sal_uninit(Sal* sal){
belle_sip_object_unref(sal->stack);
belle_sip_object_unref(sal->listener);
if (sal->supported) belle_sip_object_unref(sal->supported);
ms_list_free_with_data(sal->supported_tags,ms_free);
bctbx_list_free_with_data(sal->supported_tags,ms_free);
if (sal->uuid) ms_free(sal->uuid);
if (sal->root_ca) ms_free(sal->root_ca);
ms_free(sal);
......@@ -804,8 +804,8 @@ int sal_iterate(Sal *sal){
belle_sip_stack_sleep(sal->stack,0);
return 0;
}
MSList * sal_get_pending_auths(Sal *sal){
return ms_list_copy(sal->pending_auths);
bctbx_list_t * sal_get_pending_auths(Sal *sal){
return bctbx_list_copy(sal->pending_auths);
}
/*misc*/
......@@ -858,10 +858,10 @@ int sal_get_transport_timeout(const Sal* sal) {
return belle_sip_stack_get_transport_timeout(sal->stack);
}
void sal_set_dns_servers(Sal *sal, const MSList *servers){
void sal_set_dns_servers(Sal *sal, const bctbx_list_t *servers){
belle_sip_list_t *l = NULL;
/*we have to convert the MSList into a belle_sip_list_t first*/
/*we have to convert the bctbx_list_t into a belle_sip_list_t first*/
for (; servers != NULL; servers = servers->next){
l = belle_sip_list_append(l, servers->data);
}
......@@ -1055,7 +1055,7 @@ int sal_create_uuid(Sal*ctx, char *uuid, size_t len) {
}
static void make_supported_header(Sal *sal){
MSList *it;
bctbx_list_t *it;
char *alltags=NULL;
size_t buflen=64;
size_t written=0;
......@@ -1080,7 +1080,7 @@ static void make_supported_header(Sal *sal){
}
void sal_set_supported_tags(Sal *ctx, const char* tags){
ctx->supported_tags=ms_list_free_with_data(ctx->supported_tags,ms_free);
ctx->supported_tags=bctbx_list_free_with_data(ctx->supported_tags,ms_free);
if (tags){
char *iter;
char *buffer=ms_strdup(tags);
......@@ -1089,7 +1089,7 @@ void sal_set_supported_tags(Sal *ctx, const char* tags){
iter=buffer;
while((tag=strtok_r(iter,", ",&context))!=NULL){
iter=NULL;
ctx->supported_tags=ms_list_append(ctx->supported_tags,ms_strdup(tag));
ctx->supported_tags=bctbx_list_append(ctx->supported_tags,ms_strdup(tag));
}
ms_free(buffer);
}
......@@ -1104,19 +1104,19 @@ const char *sal_get_supported_tags(Sal *ctx){
}
void sal_add_supported_tag(Sal *ctx, const char* tag){
MSList *elem=ms_list_find_custom(ctx->supported_tags,(MSCompareFunc)strcasecmp,tag);
bctbx_list_t *elem=bctbx_list_find_custom(ctx->supported_tags,(bctbx_compare_func)strcasecmp,tag);
if (!elem){
ctx->supported_tags=ms_list_append(ctx->supported_tags,ms_strdup(tag));
ctx->supported_tags=bctbx_list_append(ctx->supported_tags,ms_strdup(tag));
make_supported_header(ctx);
}
}
void sal_remove_supported_tag(Sal *ctx, const char* tag){
MSList *elem=ms_list_find_custom(ctx->supported_tags,(MSCompareFunc)strcasecmp,tag);
bctbx_list_t *elem=bctbx_list_find_custom(ctx->supported_tags,(bctbx_compare_func)strcasecmp,tag);
if (elem){
ms_free(elem->data);
ctx->supported_tags=ms_list_remove_link(ctx->supported_tags,elem);
ctx->supported_tags=bctbx_list_remove_link(ctx->supported_tags,elem);
make_supported_header(ctx);
}
}
......
......@@ -70,7 +70,7 @@ static void add_ice_remote_candidates(belle_sdp_media_description_t *md, const S
}
static bool_t is_rtcp_fb_trr_int_the_same_for_all_payloads(const SalStreamDescription *stream, uint16_t *trr_int) {
MSList *pt_it;
bctbx_list_t *pt_it;
bool_t first = TRUE;
for (pt_it = stream->payloads; pt_it != NULL; pt_it = pt_it->next) {
PayloadType *pt = (PayloadType *)pt_it->data;
......@@ -119,7 +119,7 @@ static void add_rtcp_fb_ccm_attribute(belle_sdp_media_description_t *media_desc,
}
static void add_rtcp_fb_attributes(belle_sdp_media_description_t *media_desc, const SalMediaDescription *md, const SalStreamDescription *stream) {
MSList *pt_it;
bctbx_list_t *pt_it;
PayloadType *pt;
PayloadTypeAvpfParams avpf_params;
bool_t general_trr_int;
......@@ -191,7 +191,7 @@ static void stream_description_to_sdp ( belle_sdp_session_description_t *session
belle_sdp_mime_parameter_t* mime_param;
belle_sdp_media_description_t* media_desc;
int j;
MSList* pt_it;
bctbx_list_t* pt_it;
PayloadType* pt;
char buffer[1024];
char* dir=NULL;
......@@ -470,7 +470,7 @@ static void sdp_parse_payload_types(belle_sdp_media_description_t *media_desc, S
pt->channels=belle_sdp_mime_parameter_get_channel_count ( mime_param );
payload_type_set_send_fmtp ( pt,belle_sdp_mime_parameter_get_parameters ( mime_param ) );
payload_type_set_avpf_params(pt, avpf_params);
stream->payloads=ms_list_append ( stream->payloads,pt );
stream->payloads=bctbx_list_append ( stream->payloads,pt );
stream->ptime=belle_sdp_mime_parameter_get_ptime ( mime_param );
ms_message ( "Found payload %s/%i fmtp=%s",pt->mime_type,pt->clock_rate,
pt->send_fmtp ? pt->send_fmtp : "" );
......@@ -577,7 +577,7 @@ static void sdp_parse_media_ice_parameters(belle_sdp_media_description_t *media_
}
static void enable_avpf_for_stream(SalStreamDescription *stream) {
MSList *pt_it;
bctbx_list_t *pt_it;
for (pt_it = stream->payloads; pt_it != NULL; pt_it = pt_it->next) {
PayloadType *pt = (PayloadType *)pt_it->data;
payload_type_set_flag(pt, PAYLOAD_TYPE_RTCP_FEEDBACK_ENABLED);
......@@ -639,7 +639,7 @@ static bool_t sdp_parse_rtcp_fb_parameters(belle_sdp_media_description_t *media_
belle_sip_list_t *it;
belle_sdp_attribute_t *attribute;
belle_sdp_rtcp_fb_attribute_t *fb_attribute;
MSList *pt_it;
bctbx_list_t *pt_it;
PayloadType *pt;
int8_t pt_num;
bool_t retval = FALSE;
......
......@@ -74,7 +74,7 @@ static void set_call_log_date(LinphoneCallLog *cl, time_t start_time){
******************************************************************************/
void call_logs_write_to_config_file(LinphoneCore *lc){
MSList *elem;
bctbx_list_t *elem;
char logsection[32];
unsigned int i;
char *tmp;
......@@ -147,7 +147,7 @@ void call_logs_read_from_config_file(LinphoneCore *lc){
cl->video_enabled=lp_config_get_int(cfg,logsection,"video_enabled",0);
tmp=lp_config_get_string(cfg,logsection,"call_id",NULL);
if (tmp) cl->call_id=ms_strdup(tmp);
lc->call_logs=ms_list_append(lc->call_logs,cl);
lc->call_logs=bctbx_list_append(lc->call_logs,cl);
}else break;
}
}
......@@ -414,7 +414,7 @@ void linphone_core_call_log_storage_close(LinphoneCore *lc) {
* | 11 | refkey
*/
static int create_call_log(void *data, int argc, char **argv, char **colName) {
MSList **list = (MSList **)data;
bctbx_list_t **list = (bctbx_list_t **)data;
LinphoneAddress *from;
LinphoneAddress *to;
LinphoneCallDir dir;
......@@ -447,7 +447,7 @@ static int create_call_log(void *data, int argc, char **argv, char **colName) {
}
}
*list = ms_list_append(*list, log);
*list = bctbx_list_append(*list, log);
return 0;
error:
......@@ -461,7 +461,7 @@ error:
return 0;
}
static void linphone_sql_request_call_log(sqlite3 *db, const char *stmt, MSList **list) {
static void linphone_sql_request_call_log(sqlite3 *db, const char *stmt, bctbx_list_t **list) {
char* errmsg = NULL;
int ret;
ret = sqlite3_exec(db, stmt, create_call_log, list, &errmsg);
......@@ -511,33 +511,33 @@ void linphone_core_store_call_log(LinphoneCore *lc, LinphoneCallLog *log) {
}
if (lc) {
lc->call_logs = ms_list_prepend(lc->call_logs, linphone_call_log_ref(log));
lc->call_logs = bctbx_list_prepend(lc->call_logs, linphone_call_log_ref(log));
}
}
static void copy_user_data_from_existing_log(MSList *existing_logs, LinphoneCallLog *log) {
static void copy_user_data_from_existing_log(bctbx_list_t *existing_logs, LinphoneCallLog *log) {
while (existing_logs) {
LinphoneCallLog *existing_log = (LinphoneCallLog *)existing_logs->data;
if (existing_log->storage_id == log->storage_id) {
log->user_data = existing_log->user_data;
break;
}
existing_logs = ms_list_next(existing_logs);
existing_logs = bctbx_list_next(existing_logs);
}
}
static void copy_user_data_from_existing_logs(MSList *existing_logs, MSList *new_logs) {
static void copy_user_data_from_existing_logs(bctbx_list_t *existing_logs, bctbx_list_t *new_logs) {
while (new_logs) {
LinphoneCallLog *new_log = (LinphoneCallLog *)new_logs->data;
copy_user_data_from_existing_log(existing_logs, new_log);
new_logs = ms_list_next(new_logs);
new_logs = bctbx_list_next(new_logs);
}
}
const MSList *linphone_core_get_call_history(LinphoneCore *lc) {
const bctbx_list_t *linphone_core_get_call_history(LinphoneCore *lc) {
char *buf;
uint64_t begin,end;
MSList *result = NULL;
bctbx_list_t *result = NULL;
if (!lc || lc->logs_db == NULL) return NULL;
......@@ -553,7 +553,7 @@ const MSList *linphone_core_get_call_history(LinphoneCore *lc) {
copy_user_data_from_existing_logs(lc->call_logs, result);
}
lc->call_logs = ms_list_free_with_data(lc->call_logs, (void (*)(void*))linphone_call_log_unref);
lc->call_logs = bctbx_list_free_with_data(lc->call_logs, (void (*)(void*))linphone_call_log_unref);
lc->call_logs = result;
return lc->call_logs;
......@@ -600,11 +600,11 @@ int linphone_core_get_call_history_size(LinphoneCore *lc) {
return numrows;
}
MSList * linphone_core_get_call_history_for_address(LinphoneCore *lc, const LinphoneAddress *addr) {
bctbx_list_t * linphone_core_get_call_history_for_address(LinphoneCore *lc, const LinphoneAddress *addr) {
char *buf;
char *sipAddress;
uint64_t begin,end;
MSList *result = NULL;
bctbx_list_t *result = NULL;
if (!lc || lc->logs_db == NULL || addr == NULL) return NULL;
......@@ -629,7 +629,7 @@ MSList * linphone_core_get_call_history_for_address(LinphoneCore *lc, const Linp
LinphoneCallLog * linphone_core_get_last_outgoing_call_log(LinphoneCore *lc) {
char *buf;
uint64_t begin,end;
MSList *list = NULL;
bctbx_list_t *list = NULL;
LinphoneCallLog* result = NULL;
if (!lc || lc->logs_db == NULL) return NULL;
......@@ -657,7 +657,7 @@ LinphoneCallLog * linphone_core_get_last_outgoing_call_log(LinphoneCore *lc) {
LinphoneCallLog * linphone_core_find_call_log_from_call_id(LinphoneCore *lc, const char *call_id) {
char *buf;
uint64_t begin,end;
MSList *list = NULL;
bctbx_list_t *list = NULL;
LinphoneCallLog* result = NULL;
if (!lc || lc->logs_db == NULL) return NULL;
......@@ -693,7 +693,7 @@ void linphone_core_call_log_storage_close(LinphoneCore *lc) {
void linphone_core_store_call_log(LinphoneCore *lc, LinphoneCallLog *log) {
}
const MSList *linphone_core_get_call_history(LinphoneCore *lc) {
const bctbx_list_t *linphone_core_get_call_history(LinphoneCore *lc) {
return NULL;
}
......@@ -707,7 +707,7 @@ int linphone_core_get_call_history_size(LinphoneCore *lc) {
return 0;
}
MSList * linphone_core_get_call_history_for_address(LinphoneCore *lc, const LinphoneAddress *addr) {
bctbx_list_t * linphone_core_get_call_history_for_address(LinphoneCore *lc, const LinphoneAddress *addr) {
return NULL;
}
......
......@@ -111,12 +111,12 @@ void linphone_call_update_frozen_payloads(LinphoneCall *call, SalMediaDescriptio
SalMediaDescription *local=call->localdesc;
int i;
for(i=0;i<result_desc->nb_streams;++i){
MSList *elem;
bctbx_list_t *elem;
for (elem=result_desc->streams[i].payloads;elem!=NULL;elem=elem->next){
PayloadType *pt=(PayloadType*)elem->data;
if (is_payload_type_number_available(local->streams[i].already_assigned_payloads, payload_type_get_number(pt), NULL)){
/*new codec, needs to be added to the list*/
local->streams[i].already_assigned_payloads=ms_list_append(local->streams[i].already_assigned_payloads, payload_type_clone(pt));
local->streams[i].already_assigned_payloads=bctbx_list_append(local->streams[i].already_assigned_payloads, payload_type_clone(pt));
ms_message("LinphoneCall[%p] : payload type %i %s/%i fmtp=%s added to frozen list.",
call, payload_type_get_number(pt), pt->mime_type, pt->clock_rate, pt->recv_fmtp ? pt->recv_fmtp : "");
}
......@@ -201,7 +201,7 @@ void linphone_core_update_streams(LinphoneCore *lc, LinphoneCall *call, SalMedia
prepare_early_media_forking(call);
}
linphone_call_start_media_streams(call, target_state);
if (call->state==LinphoneCallPausing && call->paused_by_app && ms_list_size(lc->calls)==1){
if (call->state==LinphoneCallPausing && call->paused_by_app && bctbx_list_size(lc->calls)==1){
linphone_core_play_named_tone(lc,LinphoneToneCallOnHold);
}
linphone_call_update_frozen_payloads(call, new_md);
......@@ -212,7 +212,7 @@ void linphone_core_update_streams(LinphoneCore *lc, LinphoneCall *call, SalMedia
}
#if 0
static bool_t is_duplicate_call(LinphoneCore *lc, const LinphoneAddress *from, const LinphoneAddress *to){
MSList *elem;
bctbx_list_t *elem;
for(elem=lc->calls;elem!=NULL;elem=elem->next){
LinphoneCall *call=(LinphoneCall*)elem->data;
if (linphone_address_weak_equal(call->log->from,from) &&
......@@ -225,7 +225,7 @@ static bool_t is_duplicate_call(LinphoneCore *lc, const LinphoneAddress *from, c
#endif
static bool_t already_a_call_with_remote_address(const LinphoneCore *lc, const LinphoneAddress *remote) {
MSList *elem;
bctbx_list_t *elem;
ms_message("Searching for already_a_call_with_remote_address.");
for(elem=lc->calls;elem!=NULL;elem=elem->next){
......@@ -786,7 +786,7 @@ static void call_terminated(SalOp *op, const char *from){
linphone_core_start_refered_call(lc,call,NULL);
}
//we stop the call only if we have this current call or if we are in call
if ((ms_list_size(lc->calls) == 1) || linphone_core_in_call(lc)) {
if ((bctbx_list_size(lc->calls) == 1) || linphone_core_in_call(lc)) {
linphone_core_stop_ringing(lc);
}
linphone_call_stop_media_streams(call);
......@@ -1088,8 +1088,8 @@ static void refer_received(Sal *sal, SalOp *op, const char *referto){
}
static bool_t is_duplicate_msg(LinphoneCore *lc, const char *msg_id){
MSList *elem=lc->last_recv_msg_ids;
MSList *tail=NULL;
bctbx_list_t *elem=lc->last_recv_msg_ids;
bctbx_list_t *tail=NULL;
int i;
bool_t is_duplicate=FALSE;
for(i=0;elem!=NULL;elem=elem->next,i++){
......@@ -1099,11 +1099,11 @@ static bool_t is_duplicate_msg(LinphoneCore *lc, const char *msg_id){
tail=elem;
}
if (!is_duplicate){
lc->last_recv_msg_ids=ms_list_prepend(lc->last_recv_msg_ids,ms_strdup(msg_id));
lc->last_recv_msg_ids=bctbx_list_prepend(lc->last_recv_msg_ids,ms_strdup(msg_id));
}
if (i>=10){
ms_free(tail->data);
lc->last_recv_msg_ids=ms_list_remove_link(lc->last_recv_msg_ids,tail);
lc->last_recv_msg_ids=bctbx_list_remove_link(lc->last_recv_msg_ids,tail);
}
return is_duplicate;
}
......
......@@ -105,15 +105,15 @@ static void linphone_carddav_response_free(LinphoneCardDavResponse *response) {
ms_free(response);
}
static void linphone_carddav_vcards_pulled(LinphoneCardDavContext *cdc, MSList *vCards) {
if (vCards != NULL && ms_list_size(vCards) > 0) {
MSList *friends = cdc->friend_list->friends;
static void linphone_carddav_vcards_pulled(LinphoneCardDavContext *cdc, bctbx_list_t *vCards) {
if (vCards != NULL && bctbx_list_size(vCards) > 0) {
bctbx_list_t *friends = cdc->friend_list->friends;
while (vCards) {
LinphoneCardDavResponse *vCard = (LinphoneCardDavResponse *)vCards->data;
if (vCard) {
LinphoneVcard *lvc = linphone_vcard_new_from_vcard4_buffer(vCard->vcard);
LinphoneFriend *lf = NULL;
MSList *local_friend = NULL;
bctbx_list_t *local_friend = NULL;
if (lvc) {
// Compute downloaded vCards' URL and save it (+ eTag)
......@@ -126,7 +126,7 @@ static void linphone_carddav_vcards_pulled(LinphoneCardDavContext *cdc, MSList *
lf = linphone_friend_new_from_vcard(lvc);
if (lf) {
local_friend = ms_list_find_custom(friends, (int (*)(const void*, const void*))find_matching_friend, lf);
local_friend = bctbx_list_find_custom(friends, (int (*)(const void*, const void*))find_matching_friend, lf);
if (local_friend) {
LinphoneFriend *lf2 = (LinphoneFriend *)local_friend->data;
......@@ -156,15 +156,15 @@ static void linphone_carddav_vcards_pulled(LinphoneCardDavContext *cdc, MSList *
ms_error("[carddav] Couldn't parse vCard %s", vCard->vcard);
}
}
vCards = ms_list_next(vCards);
vCards = bctbx_list_next(vCards);
}
ms_list_free_with_data(vCards, (void (*)(void *))linphone_carddav_response_free);
bctbx_list_free_with_data(vCards, (void (*)(void *))linphone_carddav_response_free);
}
linphone_carddav_server_to_client_sync_done(cdc, TRUE, NULL);
}
static MSList* parse_vcards_from_xml_response(const char *body) {
MSList *result = NULL;
static bctbx_list_t* parse_vcards_from_xml_response(const char *body) {
bctbx_list_t *result = NULL;
xmlparsing_context_t *xml_ctx = linphone_xmlparsing_context_new();
xmlSetGenericErrorFunc(xml_ctx, linphone_xmlparsing_genericxml_error);
xml_ctx->doc = xmlReadDoc((const unsigned char*)body, 0, NULL, 0);
......@@ -188,7 +188,7 @@ static MSList* parse_vcards_from_xml_response(const char *body) {
response->etag = ms_strdup(etag);
response->url = ms_strdup(url);
response->vcard = ms_strdup(vcard);
result = ms_list_append(result, response);
result = bctbx_list_append(result, response);
ms_debug("Added vCard object with eTag %s, URL %s and vCard %s", etag, url, vcard);
}
}
......@@ -209,19 +209,19 @@ static int find_matching_vcard(LinphoneCardDavResponse *response, LinphoneFriend
return strcmp(response->url, linphone_vcard_get_url(lf->vcard));
}
static void linphone_carddav_vcards_fetched(LinphoneCardDavContext *cdc, MSList *vCards) {
if (vCards != NULL && ms_list_size(vCards) > 0) {
MSList *friends = cdc->friend_list->friends;
MSList *friends_to_remove = NULL;
MSList *temp_list = NULL;
static void linphone_carddav_vcards_fetched(LinphoneCardDavContext *cdc, bctbx_list_t *vCards) {
if (vCards != NULL && bctbx_list_size(vCards) > 0) {
bctbx_list_t *friends = cdc->friend_list->friends;
bctbx_list_t *friends_to_remove = NULL;
bctbx_list_t *temp_list = NULL;
while (friends) {
LinphoneFriend *lf = (LinphoneFriend *)friends->data;
if (lf) {
MSList *vCard = ms_list_find_custom(vCards, (int (*)(const void*, const void*))find_matching_vcard, lf);
bctbx_list_t *vCard = bctbx_list_find_custom(vCards, (int (*)(const void*, const void*))find_matching_vcard, lf);
if (!vCard) {
ms_debug("Local friend %s isn't in the remote vCard list, delete it", linphone_friend_get_name(lf));
temp_list = ms_list_append(temp_list, linphone_friend_ref(lf));
temp_list = bctbx_list_append(temp_list, linphone_friend_ref(lf));
} else {
LinphoneCardDavResponse *response = (LinphoneCardDavResponse *)vCard->data;
ms_debug("Local friend %s is in the remote vCard list, check eTag", linphone_friend_get_name(lf));
......@@ -230,13 +230,13 @@ static void linphone_carddav_vcards_fetched(LinphoneCardDavContext *cdc, MSList
const char *etag = linphone_vcard_get_etag(lvc);
ms_debug("Local friend eTag is %s, remote vCard eTag is %s", etag, response->etag);
if (lvc && etag && strcmp(etag, response->etag) == 0) {
ms_list_remove(vCards, vCard);
bctbx_list_remove(vCards, vCard);
linphone_carddav_response_free(response);
}
}
}
}
friends = ms_list_next(friends);
friends = bctbx_list_next(friends);
}
friends_to_remove = temp_list;
while(friends_to_remove) {
......@@ -247,17 +247,17 @@ static void linphone_carddav_vcards_fetched(LinphoneCardDavContext *cdc, MSList
cdc->contact_removed_cb(cdc, lf);
}
}
friends_to_remove = ms_list_next(friends_to_remove);
friends_to_remove = bctbx_list_next(friends_to_remove);
}
temp_list = ms_list_free_with_data(temp_list, (void (*)(void *))linphone_friend_unref);
temp_list = bctbx_list_free_with_data(temp_list, (void (*)(void *))linphone_friend_unref);
linphone_carddav_pull_vcards(cdc, vCards);
ms_list_free_with_data(vCards, (void (*)(void *))linphone_carddav_response_free);
bctbx_list_free_with_data(vCards, (void (*)(void *))linphone_carddav_response_free);
}
}
static MSList* parse_vcards_etags_from_xml_response(const char *body) {
MSList *result = NULL;
static bctbx_list_t* parse_vcards_etags_from_xml_response(const char *body) {
bctbx_list_t *result = NULL;
xmlparsing_context_t *xml_ctx = linphone_xmlparsing_context_new();
xmlSetGenericErrorFunc(xml_ctx, linphone_xmlparsing_genericxml_error);
xml_ctx->doc = xmlReadDoc((const unsigned char*)body, 0, NULL, 0);
......@@ -279,7 +279,7 @@ static MSList* parse_vcards_etags_from_xml_response(const char *body) {
LinphoneCardDavResponse *response = ms_new0(LinphoneCardDavResponse, 1);
response->etag = ms_strdup(etag);
response->url = ms_strdup(url);
result = ms_list_append(result, response);
result = bctbx_list_append(result, response);
ms_debug("Added vCard object with eTag %s and URL %s", etag, url);
}
}
......@@ -396,12 +396,12 @@ static void process_response_from_carddav_request(void *data, const belle_http_r
} else {
// For some reason, server didn't return the eTag of the updated/created vCard
// We need to do a GET on the vCard to get the correct one
MSList *vcard = NULL;
bctbx_list_t *vcard = NULL;
LinphoneCardDavResponse *response = (LinphoneCardDavResponse *)ms_new0(LinphoneCardDavResponse, 1);
response->url = linphone_vcard_get_url(lvc);
vcard = ms_list_append(vcard, response);
vcard = bctbx_list_append(vcard, response);
linphone_carddav_pull_vcards(query->context, vcard);
ms_list_free_with_data(vcard, (void (*)(void *))linphone_carddav_response_free);
bctbx_list_free_with_data(vcard, (void (*)(void *))linphone_carddav_response_free);
}
}
else {
......@@ -459,7 +459,7 @@ static void process_auth_requested_from_carddav_request(void *data, belle_sip_au
belle_sip_auth_event_set_ha1(event, cdc->auth_info->ha1);
} else {
LinphoneCore *lc = cdc->friend_list->lc;
const MSList *auth_infos = linphone_core_get_auth_info_list(lc);
const bctbx_list_t *auth_infos = linphone_core_get_auth_info_list(lc);
ms_debug("Looking for auth info for domain %s and realm %s", domain, realm);
while (auth_infos) {
......@@ -473,7 +473,7 @@ static void process_auth_requested_from_carddav_request(void *data, belle_sip_au
break;
}
}
auth_infos = ms_list_next(auth_infos);
auth_infos = bctbx_list_next(auth_infos);
}
if (!auth_infos) {
......@@ -716,10 +716,10 @@ void linphone_carddav_fetch_vcards(LinphoneCardDavContext *cdc) {
linphone_carddav_send_query(query);
}
static LinphoneCardDavQuery* linphone_carddav_create_addressbook_multiget_query(LinphoneCardDavContext *cdc, MSList *vcards) {
static LinphoneCardDavQuery* linphone_carddav_create_addressbook_multiget_query(LinphoneCardDavContext *cdc, bctbx_list_t *vcards) {
LinphoneCardDavQuery *query = (LinphoneCardDavQuery *)ms_new0(LinphoneCardDavQuery, 1);
char *body = (char *)ms_malloc((ms_list_size(vcards) + 1) * 300 * sizeof(char));
MSList *iterator = vcards;
char *body = (char *)ms_malloc((bctbx_list_size(vcards) + 1) * 300 * sizeof(char));
bctbx_list_t *iterator = vcards;
query->context = cdc;
query->depth = "1";
......@@ -735,7 +735,7 @@ static LinphoneCardDavQuery* linphone_carddav_create_addressbook_multiget_query(
char temp_body[300];
snprintf(temp_body, sizeof(temp_body), "<d:href>%s</d:href>", response->url);
sprintf(body, "%s%s", body, temp_body);
iterator = ms_list_next(iterator);
iterator = bctbx_list_next(iterator);
}
}
sprintf(body, "%s%s", body, "</card:addressbook-multiget>");
......@@ -745,7 +745,7 @@ static LinphoneCardDavQuery* linphone_carddav_create_addressbook_multiget_query(
return query;
}
void linphone_carddav_pull_vcards(LinphoneCardDavContext *cdc, MSList *vcards_to_pull) {
void linphone_carddav_pull_vcards(LinphoneCardDavContext *cdc, bctbx_list_t *vcards_to_pull) {
LinphoneCardDavQuery *query = linphone_carddav_create_addressbook_multiget_query(cdc, vcards_to_pull);
linphone_carddav_send_query(query);
}
\ No newline at end of file
......@@ -114,18 +114,18 @@ void linphone_chat_message_cbs_set_file_transfer_progress_indication(
BELLE_SIP_DECLARE_NO_IMPLEMENTED_INTERFACES(LinphoneChatMessage);
static void _linphone_chat_room_destroy(LinphoneChatRoom *cr) {
ms_list_free_with_data(cr->transient_messages, (void (*)(void *))linphone_chat_message_release);
bctbx_list_free_with_data(cr->transient_messages, (void (*)(void *))linphone_chat_message_release);
linphone_chat_room_delete_composing_idle_timer(cr);
linphone_chat_room_delete_composing_refresh_timer(cr);
linphone_chat_room_delete_remote_composing_refresh_timer(cr);
if (cr->lc != NULL) {
if (ms_list_find(cr->lc->chatrooms, cr)) {
if (bctbx_list_find(cr->lc->chatrooms, cr)) {
ms_error("LinphoneChatRoom[%p] is destroyed while still being used by the LinphoneCore. This is abnormal."
" linphone_core_get_chat_room() doesn't give a reference, there is no need to call "
"linphone_chat_room_unref(). "
"In order to remove a chat room from the core, use linphone_core_delete_chat_room().",
cr);
cr->lc->chatrooms = ms_list_remove(cr->lc->chatrooms, cr);
cr->lc->chatrooms = bctbx_list_remove(cr->lc->chatrooms, cr);
}
}
linphone_address_destroy(cr->peer_url);
......@@ -167,7 +167,7 @@ bool_t linphone_core_chat_enabled(const LinphoneCore *lc) {
return lc->chat_deny_code != LinphoneReasonNone;
}
const MSList *linphone_core_get_chat_rooms(LinphoneCore *lc) {
const bctbx_list_t *linphone_core_get_chat_rooms(LinphoneCore *lc) {
return lc->chatrooms;
}