Commit 41545fad authored by François Grisez's avatar François Grisez
Browse files

Fixes conflicts between François and Ghislain's "internal" parameter of vtables

parent 38dfb9ab
...@@ -1686,7 +1686,6 @@ static void linphone_core_init(LinphoneCore * lc, const LinphoneCoreVTable *vtab ...@@ -1686,7 +1686,6 @@ static void linphone_core_init(LinphoneCore * lc, const LinphoneCoreVTable *vtab
LinphoneCoreVTable* local_vtable= linphone_core_v_table_new(); LinphoneCoreVTable* local_vtable= linphone_core_v_table_new();
LinphoneCoreVTable *internal_vtable = linphone_core_v_table_new(); LinphoneCoreVTable *internal_vtable = linphone_core_v_table_new();
linphone_core_v_table_set_internal(internal_vtable, TRUE);
ms_message("Initializing LinphoneCore %s", linphone_core_get_version()); ms_message("Initializing LinphoneCore %s", linphone_core_get_version());
lc->config=lp_config_ref(config); lc->config=lp_config_ref(config);
...@@ -1696,9 +1695,9 @@ static void linphone_core_init(LinphoneCore * lc, const LinphoneCoreVTable *vtab ...@@ -1696,9 +1695,9 @@ static void linphone_core_init(LinphoneCore * lc, const LinphoneCoreVTable *vtab
linphone_task_list_init(&lc->hooks); linphone_task_list_init(&lc->hooks);
internal_vtable->notify_received = linphone_core_internal_notify_received; internal_vtable->notify_received = linphone_core_internal_notify_received;
_linphone_core_add_listener(lc, internal_vtable, TRUE); _linphone_core_add_listener(lc, internal_vtable, TRUE, TRUE);
memcpy(local_vtable,vtable,sizeof(LinphoneCoreVTable)); memcpy(local_vtable,vtable,sizeof(LinphoneCoreVTable));
_linphone_core_add_listener(lc, local_vtable, TRUE, TRUE); _linphone_core_add_listener(lc, local_vtable, TRUE, FALSE);
linphone_core_set_state(lc,LinphoneGlobalStartup,"Starting up"); linphone_core_set_state(lc,LinphoneGlobalStartup,"Starting up");
ortp_init(); ortp_init();
......
...@@ -2108,7 +2108,6 @@ typedef struct _LinphoneCoreVTable{ ...@@ -2108,7 +2108,6 @@ typedef struct _LinphoneCoreVTable{
LinphoneCoreLogCollectionUploadStateChangedCb log_collection_upload_state_changed; /**< Callback to upload collected logs */ LinphoneCoreLogCollectionUploadStateChangedCb log_collection_upload_state_changed; /**< Callback to upload collected logs */
LinphoneCoreLogCollectionUploadProgressIndicationCb log_collection_upload_progress_indication; /**< Callback to indicate log collection upload progress */ LinphoneCoreLogCollectionUploadProgressIndicationCb log_collection_upload_progress_indication; /**< Callback to indicate log collection upload progress */
void *user_data; /**<User data associated with the above callbacks */ void *user_data; /**<User data associated with the above callbacks */
bool_t internal;
} LinphoneCoreVTable; } LinphoneCoreVTable;
/** /**
......
...@@ -1412,9 +1412,6 @@ typedef struct _VTableReference VTableReference; ...@@ -1412,9 +1412,6 @@ typedef struct _VTableReference VTableReference;
void v_table_reference_destroy(VTableReference *ref); void v_table_reference_destroy(VTableReference *ref);
LINPHONE_PUBLIC void linphone_core_v_table_set_internal(LinphoneCoreVTable *table, bool_t internal);
bool_t linphone_core_v_table_is_internal(LinphoneCoreVTable *table);
void _linphone_core_add_listener(LinphoneCore *lc, LinphoneCoreVTable *vtable, bool_t autorelease, bool_t internal); void _linphone_core_add_listener(LinphoneCore *lc, LinphoneCoreVTable *vtable, bool_t autorelease, bool_t internal);
#ifdef VIDEO_ENABLED #ifdef VIDEO_ENABLED
......
...@@ -33,14 +33,6 @@ void* linphone_core_v_table_get_user_data(LinphoneCoreVTable *table) { ...@@ -33,14 +33,6 @@ void* linphone_core_v_table_get_user_data(LinphoneCoreVTable *table) {
return table->user_data; return table->user_data;
} }
void linphone_core_v_table_set_internal(LinphoneCoreVTable *table, bool_t internal) {
table->internal = internal;
}
bool_t linphone_core_v_table_is_internal(LinphoneCoreVTable *table) {
return table->internal;
}
void linphone_core_v_table_destroy(LinphoneCoreVTable* table) { void linphone_core_v_table_destroy(LinphoneCoreVTable* table) {
ms_free(table); ms_free(table);
} }
...@@ -74,12 +66,12 @@ static void cleanup_dead_vtable_refs(LinphoneCore *lc){ ...@@ -74,12 +66,12 @@ static void cleanup_dead_vtable_refs(LinphoneCore *lc){
}\ }\
if (has_cb) ms_message("Linphone core [%p] notifying [%s]",lc,#function_name) if (has_cb) ms_message("Linphone core [%p] notifying [%s]",lc,#function_name)
#define NOTIFY_IF_EXIST_INTERNAL(function_name, internal, ...) \ #define NOTIFY_IF_EXIST_INTERNAL(function_name, internal_val, ...) \
MSList* iterator; \ MSList* iterator; \
VTableReference *ref; \ VTableReference *ref; \
bool_t has_cb = FALSE; \ bool_t has_cb = FALSE; \
for (iterator=lc->vtable_refs; iterator!=NULL; iterator=iterator->next)\ for (iterator=lc->vtable_refs; iterator!=NULL; iterator=iterator->next)\
if ((ref=(VTableReference*)iterator->data)->valid && (lc->current_vtable=ref->vtable)->function_name && (linphone_core_v_table_is_internal(lc->current_vtable) == internal)) {\ if ((ref=(VTableReference*)iterator->data)->valid && (lc->current_vtable=ref->vtable)->function_name && (ref->internal == internal_val)) {\
lc->current_vtable->function_name(__VA_ARGS__);\ lc->current_vtable->function_name(__VA_ARGS__);\
has_cb = TRUE;\ has_cb = TRUE;\
}\ }\
......
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