Commit b535d1f1 authored by Ghislain MARY's avatar Ghislain MARY
Browse files

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){ ...@@ -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){ 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; const LinphoneAuthInfo *ret=NULL;
for (elem=lc->auth_info;elem!=NULL;elem=elem->next) { 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 ...@@ -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*/ /*the auth info is expected to be in the core's list*/
void linphone_core_write_auth_info(LinphoneCore *lc, LinphoneAuthInfo *ai){ void linphone_core_write_auth_info(LinphoneCore *lc, LinphoneAuthInfo *ai){
int i; int i;
MSList *elem = lc->auth_info; bctbx_list_t *elem = lc->auth_info;
if (!lc->sip_conf.save_auth_info) return; if (!lc->sip_conf.save_auth_info) return;
...@@ -298,12 +298,12 @@ void linphone_core_write_auth_info(LinphoneCore *lc, LinphoneAuthInfo *ai){ ...@@ -298,12 +298,12 @@ void linphone_core_write_auth_info(LinphoneCore *lc, LinphoneAuthInfo *ai){
} }
static void write_auth_infos(LinphoneCore *lc){ static void write_auth_infos(LinphoneCore *lc){
MSList *elem; bctbx_list_t *elem;
int i; int i;
if (!linphone_core_ready(lc)) return; if (!linphone_core_ready(lc)) return;
if (!lc->sip_conf.save_auth_info) 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); LinphoneAuthInfo *ai=(LinphoneAuthInfo*)(elem->data);
linphone_auth_info_write_config(lc->config,ai,i); linphone_auth_info_write_config(lc->config,ai,i);
} }
...@@ -321,8 +321,8 @@ LinphoneAuthInfo * linphone_core_create_auth_info(LinphoneCore *lc, const char * ...@@ -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){ void linphone_core_add_auth_info(LinphoneCore *lc, const LinphoneAuthInfo *info){
LinphoneAuthInfo *ai; LinphoneAuthInfo *ai;
MSList *elem; bctbx_list_t *elem;
MSList *l; bctbx_list_t *l;
int restarted_op_count=0; int restarted_op_count=0;
bool_t updating=FALSE; bool_t updating=FALSE;
...@@ -333,11 +333,11 @@ void linphone_core_add_auth_info(LinphoneCore *lc, const LinphoneAuthInfo *info) ...@@ -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 */ /* 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); 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){ 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); linphone_auth_info_destroy(ai);
updating=TRUE; 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 */ /* retry pending authentication operations */
for(l=elem=sal_get_pending_auths(lc->sal);elem!=NULL;elem=elem->next){ 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) ...@@ -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); ai=(LinphoneAuthInfo*)_linphone_core_find_auth_info(lc,req_sai->realm,req_sai->username,req_sai->domain, FALSE);
if (ai){ if (ai){
SalAuthInfo sai; SalAuthInfo sai;
MSList* proxy; bctbx_list_t* proxy;
sai.username=ai->username; sai.username=ai->username;
sai.userid=ai->userid; sai.userid=ai->userid;
sai.realm=ai->realm; sai.realm=ai->realm;
sai.password=ai->passwd; sai.password=ai->passwd;
sai.ha1=ai->ha1; sai.ha1=ai->ha1;
/*proxy case*/ /*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)) { if (proxy->data == sal_op_get_user_pointer(op)) {
linphone_proxy_config_set_state((LinphoneProxyConfig*)(proxy->data),LinphoneRegistrationProgress,"Authentication..."); linphone_proxy_config_set_state((LinphoneProxyConfig*)(proxy->data),LinphoneRegistrationProgress,"Authentication...");
break; break;
...@@ -375,7 +375,7 @@ void linphone_core_add_auth_info(LinphoneCore *lc, const LinphoneAuthInfo *info) ...@@ -375,7 +375,7 @@ void linphone_core_add_auth_info(LinphoneCore *lc, const LinphoneAuthInfo *info)
info->realm ? info->realm : "", info->realm ? info->realm : "",
info->domain ? info->domain : ""); info->domain ? info->domain : "");
} }
ms_list_free(l); bctbx_list_free(l);
write_auth_infos(lc); write_auth_infos(lc);
} }
...@@ -394,7 +394,7 @@ void linphone_core_remove_auth_info(LinphoneCore *lc, const LinphoneAuthInfo *in ...@@ -394,7 +394,7 @@ void linphone_core_remove_auth_info(LinphoneCore *lc, const LinphoneAuthInfo *in
LinphoneAuthInfo *r; LinphoneAuthInfo *r;
r=(LinphoneAuthInfo*)linphone_core_find_auth_info(lc,info->realm,info->username,info->domain); r=(LinphoneAuthInfo*)linphone_core_find_auth_info(lc,info->realm,info->username,info->domain);
if (r){ 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); linphone_auth_info_destroy(r);
write_auth_infos(lc); write_auth_infos(lc);
} }
...@@ -405,7 +405,7 @@ void linphone_core_remove_auth_info(LinphoneCore *lc, const LinphoneAuthInfo *in ...@@ -405,7 +405,7 @@ void linphone_core_remove_auth_info(LinphoneCore *lc, const LinphoneAuthInfo *in
* @param[in] lc The LinphoneCore object * @param[in] lc The LinphoneCore object
* @return \mslist{LinphoneAuthInfo} * @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; return lc->auth_info;
} }
...@@ -413,14 +413,14 @@ const MSList *linphone_core_get_auth_info_list(const LinphoneCore *lc){ ...@@ -413,14 +413,14 @@ const MSList *linphone_core_get_auth_info_list(const LinphoneCore *lc){
* Clear all authentication information. * Clear all authentication information.
**/ **/
void linphone_core_clear_all_auth_info(LinphoneCore *lc){ void linphone_core_clear_all_auth_info(LinphoneCore *lc){
MSList *elem; bctbx_list_t *elem;
int i; 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; LinphoneAuthInfo *info=(LinphoneAuthInfo*)elem->data;
linphone_auth_info_destroy(info); linphone_auth_info_destroy(info);
linphone_auth_info_write_config(lc->config,NULL,i); 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; lc->auth_info=NULL;
} }
......
...@@ -115,8 +115,8 @@ void sal_set_log_level(OrtpLogLevel level) { ...@@ -115,8 +115,8 @@ void sal_set_log_level(OrtpLogLevel level) {
} }
void sal_add_pending_auth(Sal *sal, SalOp *op){ void sal_add_pending_auth(Sal *sal, SalOp *op){
if (ms_list_find(sal->pending_auths,op)==NULL){ if (bctbx_list_find(sal->pending_auths,op)==NULL){
sal->pending_auths=ms_list_append(sal->pending_auths,op); sal->pending_auths=bctbx_list_append(sal->pending_auths,op);
op->has_auth_pending=TRUE; op->has_auth_pending=TRUE;
} }
} }
...@@ -124,8 +124,8 @@ void sal_add_pending_auth(Sal *sal, SalOp *op){ ...@@ -124,8 +124,8 @@ void sal_add_pending_auth(Sal *sal, SalOp *op){
void sal_remove_pending_auth(Sal *sal, SalOp *op){ void sal_remove_pending_auth(Sal *sal, SalOp *op){
if (op->has_auth_pending){ if (op->has_auth_pending){
op->has_auth_pending=FALSE; op->has_auth_pending=FALSE;
if (ms_list_find(sal->pending_auths,op)){ if (bctbx_list_find(sal->pending_auths,op)){
sal->pending_auths=ms_list_remove(sal->pending_auths,op); sal->pending_auths=bctbx_list_remove(sal->pending_auths,op);
} }
} }
} }
...@@ -593,7 +593,7 @@ void sal_uninit(Sal* sal){ ...@@ -593,7 +593,7 @@ void sal_uninit(Sal* sal){
belle_sip_object_unref(sal->stack); belle_sip_object_unref(sal->stack);
belle_sip_object_unref(sal->listener); belle_sip_object_unref(sal->listener);
if (sal->supported) belle_sip_object_unref(sal->supported); 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->uuid) ms_free(sal->uuid);
if (sal->root_ca) ms_free(sal->root_ca); if (sal->root_ca) ms_free(sal->root_ca);
ms_free(sal); ms_free(sal);
...@@ -804,8 +804,8 @@ int sal_iterate(Sal *sal){ ...@@ -804,8 +804,8 @@ int sal_iterate(Sal *sal){
belle_sip_stack_sleep(sal->stack,0); belle_sip_stack_sleep(sal->stack,0);
return 0; return 0;
} }
MSList * sal_get_pending_auths(Sal *sal){ bctbx_list_t * sal_get_pending_auths(Sal *sal){
return ms_list_copy(sal->pending_auths); return bctbx_list_copy(sal->pending_auths);
} }
/*misc*/ /*misc*/
...@@ -858,10 +858,10 @@ int sal_get_transport_timeout(const Sal* sal) { ...@@ -858,10 +858,10 @@ int sal_get_transport_timeout(const Sal* sal) {
return belle_sip_stack_get_transport_timeout(sal->stack); 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; 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){ for (; servers != NULL; servers = servers->next){
l = belle_sip_list_append(l, servers->data); l = belle_sip_list_append(l, servers->data);
} }
...@@ -1055,7 +1055,7 @@ int sal_create_uuid(Sal*ctx, char *uuid, size_t len) { ...@@ -1055,7 +1055,7 @@ int sal_create_uuid(Sal*ctx, char *uuid, size_t len) {
} }
static void make_supported_header(Sal *sal){ static void make_supported_header(Sal *sal){
MSList *it; bctbx_list_t *it;
char *alltags=NULL; char *alltags=NULL;
size_t buflen=64; size_t buflen=64;
size_t written=0; size_t written=0;
...@@ -1080,7 +1080,7 @@ static void make_supported_header(Sal *sal){ ...@@ -1080,7 +1080,7 @@ static void make_supported_header(Sal *sal){
} }
void sal_set_supported_tags(Sal *ctx, const char* tags){ 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){ if (tags){
char *iter; char *iter;
char *buffer=ms_strdup(tags); char *buffer=ms_strdup(tags);
...@@ -1089,7 +1089,7 @@ void sal_set_supported_tags(Sal *ctx, const char* tags){ ...@@ -1089,7 +1089,7 @@ void sal_set_supported_tags(Sal *ctx, const char* tags){
iter=buffer; iter=buffer;
while((tag=strtok_r(iter,", ",&context))!=NULL){ while((tag=strtok_r(iter,", ",&context))!=NULL){
iter=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); ms_free(buffer);
} }
...@@ -1104,19 +1104,19 @@ const char *sal_get_supported_tags(Sal *ctx){ ...@@ -1104,19 +1104,19 @@ const char *sal_get_supported_tags(Sal *ctx){
} }
void sal_add_supported_tag(Sal *ctx, const char* tag){ 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){ 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); make_supported_header(ctx);
} }
} }
void sal_remove_supported_tag(Sal *ctx, const char* tag){ 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){ if (elem){
ms_free(elem->data); 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); make_supported_header(ctx);
} }
} }
......
...@@ -70,7 +70,7 @@ static void add_ice_remote_candidates(belle_sdp_media_description_t *md, const S ...@@ -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) { 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; bool_t first = TRUE;
for (pt_it = stream->payloads; pt_it != NULL; pt_it = pt_it->next) { for (pt_it = stream->payloads; pt_it != NULL; pt_it = pt_it->next) {
PayloadType *pt = (PayloadType *)pt_it->data; PayloadType *pt = (PayloadType *)pt_it->data;
...@@ -119,7 +119,7 @@ static void add_rtcp_fb_ccm_attribute(belle_sdp_media_description_t *media_desc, ...@@ -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) { 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; PayloadType *pt;
PayloadTypeAvpfParams avpf_params; PayloadTypeAvpfParams avpf_params;
bool_t general_trr_int; bool_t general_trr_int;
...@@ -191,7 +191,7 @@ static void stream_description_to_sdp ( belle_sdp_session_description_t *session ...@@ -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_mime_parameter_t* mime_param;
belle_sdp_media_description_t* media_desc; belle_sdp_media_description_t* media_desc;
int j; int j;
MSList* pt_it; bctbx_list_t* pt_it;
PayloadType* pt; PayloadType* pt;
char buffer[1024]; char buffer[1024];
char* dir=NULL; char* dir=NULL;
...@@ -470,7 +470,7 @@ static void sdp_parse_payload_types(belle_sdp_media_description_t *media_desc, S ...@@ -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 ); 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_send_fmtp ( pt,belle_sdp_mime_parameter_get_parameters ( mime_param ) );
payload_type_set_avpf_params(pt, avpf_params); 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 ); stream->ptime=belle_sdp_mime_parameter_get_ptime ( mime_param );
ms_message ( "Found payload %s/%i fmtp=%s",pt->mime_type,pt->clock_rate, ms_message ( "Found payload %s/%i fmtp=%s",pt->mime_type,pt->clock_rate,
pt->send_fmtp ? pt->send_fmtp : "" ); pt->send_fmtp ? pt->send_fmtp : "" );
...@@ -577,7 +577,7 @@ static void sdp_parse_media_ice_parameters(belle_sdp_media_description_t *media_ ...@@ -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) { 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) { for (pt_it = stream->payloads; pt_it != NULL; pt_it = pt_it->next) {
PayloadType *pt = (PayloadType *)pt_it->data; PayloadType *pt = (PayloadType *)pt_it->data;
payload_type_set_flag(pt, PAYLOAD_TYPE_RTCP_FEEDBACK_ENABLED); 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_ ...@@ -639,7 +639,7 @@ static bool_t sdp_parse_rtcp_fb_parameters(belle_sdp_media_description_t *media_
belle_sip_list_t *it; belle_sip_list_t *it;
belle_sdp_attribute_t *attribute; belle_sdp_attribute_t *attribute;
belle_sdp_rtcp_fb_attribute_t *fb_attribute; belle_sdp_rtcp_fb_attribute_t *fb_attribute;
MSList *pt_it; bctbx_list_t *pt_it;
PayloadType *pt; PayloadType *pt;
int8_t pt_num; int8_t pt_num;
bool_t retval = FALSE; bool_t retval = FALSE;
......
...@@ -74,7 +74,7 @@ static void set_call_log_date(LinphoneCallLog *cl, time_t start_time){ ...@@ -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){ void call_logs_write_to_config_file(LinphoneCore *lc){
MSList *elem; bctbx_list_t *elem;
char logsection[32]; char logsection[32];
unsigned int i; unsigned int i;
char *tmp; char *tmp;
...@@ -147,7 +147,7 @@ void call_logs_read_from_config_file(LinphoneCore *lc){ ...@@ -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); cl->video_enabled=lp_config_get_int(cfg,logsection,"video_enabled",0);
tmp=lp_config_get_string(cfg,logsection,"call_id",NULL); tmp=lp_config_get_string(cfg,logsection,"call_id",NULL);
if (tmp) cl->call_id=ms_strdup(tmp); 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; }else break;
} }
} }
...@@ -414,7 +414,7 @@ void linphone_core_call_log_storage_close(LinphoneCore *lc) { ...@@ -414,7 +414,7 @@ void linphone_core_call_log_storage_close(LinphoneCore *lc) {
* | 11 | refkey * | 11 | refkey
*/ */
static int create_call_log(void *data, int argc, char **argv, char **colName) { 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 *from;
LinphoneAddress *to; LinphoneAddress *to;
LinphoneCallDir dir; LinphoneCallDir dir;
...@@ -447,7 +447,7 @@ static int create_call_log(void *data, int argc, char **argv, char **colName) { ...@@ -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; return 0;
error: error:
...@@ -461,7 +461,7 @@ error: ...@@ -461,7 +461,7 @@ error:
return 0; 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; char* errmsg = NULL;
int ret; int ret;
ret = sqlite3_exec(db, stmt, create_call_log, list, &errmsg); ret = sqlite3_exec(db, stmt, create_call_log, list, &errmsg);
...@@ -511,33 +511,33 @@ void linphone_core_store_call_log(LinphoneCore *lc, LinphoneCallLog *log) { ...@@ -511,33 +511,33 @@ void linphone_core_store_call_log(LinphoneCore *lc, LinphoneCallLog *log) {
} }
if (lc) { 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) { while (existing_logs) {
LinphoneCallLog *existing_log = (LinphoneCallLog *)existing_logs->data; LinphoneCallLog *existing_log = (LinphoneCallLog *)existing_logs->data;
if (existing_log->storage_id == log->storage_id) { if (existing_log->storage_id == log->storage_id) {
log->user_data = existing_log->user_data; log->user_data = existing_log->user_data;
break; 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) { while (new_logs) {
LinphoneCallLog *new_log = (LinphoneCallLog *)new_logs->data; LinphoneCallLog *new_log = (LinphoneCallLog *)new_logs->data;
copy_user_data_from_existing_log(existing_logs, new_log); 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; char *buf;
uint64_t begin,end; uint64_t begin,end;
MSList *result = NULL; bctbx_list_t *result = NULL;
if (!lc || lc->logs_db == NULL) return NULL; if (!lc || lc->logs_db == NULL) return NULL;
...@@ -553,7 +553,7 @@ const MSList *linphone_core_get_call_history(LinphoneCore *lc) { ...@@ -553,7 +553,7 @@ const MSList *linphone_core_get_call_history(LinphoneCore *lc) {
copy_user_data_from_existing_logs(lc->call_logs, result); 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; lc->call_logs = result;
return lc->call_logs; return lc->call_logs;
...@@ -600,11 +600,11 @@ int linphone_core_get_call_history_size(LinphoneCore *lc) { ...@@ -600,11 +600,11 @@ int linphone_core_get_call_history_size(LinphoneCore *lc) {
return numrows; 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 *buf;
char *sipAddress; char *sipAddress;
uint64_t begin,end; uint64_t begin,end;
MSList *result = NULL; bctbx_list_t *result = NULL;
if (!lc || lc->logs_db == NULL || addr == NULL) return 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 ...@@ -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) { LinphoneCallLog * linphone_core_get_last_outgoing_call_log(LinphoneCore *lc) {
char *buf; char *buf;
uint64_t begin,end; uint64_t begin,end;
MSList *list = NULL; bctbx_list_t *list = NULL;
LinphoneCallLog* result = NULL; LinphoneCallLog* result = NULL;
if (!lc || lc->logs_db == NULL) return NULL; if (!lc || lc->logs_db == NULL) return NULL;
...@@ -657,7 +657,7 @@ LinphoneCallLog * linphone_core_get_last_outgoing_call_log(LinphoneCore *lc) { ...@@ -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) { LinphoneCallLog * linphone_core_find_call_log_from_call_id(LinphoneCore *lc, const char *call_id) {
char *buf; char *buf;
uint64_t begin,end; uint64_t begin,end;
MSList *list = NULL; bctbx_list_t *list = NULL;
LinphoneCallLog* result = NULL; LinphoneCallLog* result = NULL;