From 33d7a384afecf9a52b9c06bdf16f2a11fdb45dab Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 2 Oct 2017 12:31:36 +0200 Subject: [PATCH] feat(General): remove LINPHONE_NAMESPACE --- coreapi/authentication.c | 2 +- coreapi/bellesip_sal/sal_op_impl.c | 2 +- coreapi/callbacks.c | 4 +- coreapi/carddav.c | 2 +- coreapi/chat.c | 2 +- coreapi/error_info.c | 2 +- coreapi/event.c | 4 +- coreapi/friend.c | 2 +- coreapi/friendlist.c | 2 +- coreapi/info.c | 2 +- coreapi/linphonecore.c | 2 +- coreapi/presence.c | 2 +- coreapi/private.h | 62 ++++++++++++++-------------- coreapi/proxy.c | 2 +- coreapi/sal/sal.cpp | 2 +- coreapi/vcard.cc | 2 +- include/linphone/utils/general.h | 6 +-- src/c-wrapper/api/c-address.cpp | 4 +- src/c-wrapper/api/c-call.cpp | 10 ++--- src/c-wrapper/api/c-chat-message.cpp | 2 +- src/c-wrapper/api/c-event-log.cpp | 8 ++-- src/c-wrapper/internal/c-tools.h | 42 +++++++++---------- src/chat/cpim/parser/cpim-parser.cpp | 16 +++---- src/logger/logger.h | 10 ++--- tester/cpim-tester.cpp | 2 +- 25 files changed, 97 insertions(+), 99 deletions(-) diff --git a/coreapi/authentication.c b/coreapi/authentication.c index c79769527..e884faf5a 100644 --- a/coreapi/authentication.c +++ b/coreapi/authentication.c @@ -28,7 +28,7 @@ #include "c-wrapper/c-wrapper.h" -using namespace LINPHONE_NAMESPACE; +using namespace LinphonePrivate; static void _linphone_auth_info_uninit(LinphoneAuthInfo *obj); static void _linphone_auth_info_copy(LinphoneAuthInfo *dst, const LinphoneAuthInfo *src); diff --git a/coreapi/bellesip_sal/sal_op_impl.c b/coreapi/bellesip_sal/sal_op_impl.c index 7880fa4c6..5040f6d01 100644 --- a/coreapi/bellesip_sal/sal_op_impl.c +++ b/coreapi/bellesip_sal/sal_op_impl.c @@ -19,7 +19,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "sal_impl.h" #include "sal/sal.hpp" -using namespace LINPHONE_NAMESPACE; +using namespace LinphonePrivate; SalReason _sal_reason_from_sip_code(int code) { if (code>=100 && code<300) return SalReasonNone; diff --git a/coreapi/callbacks.c b/coreapi/callbacks.c index 45a0e1d87..a19d9924f 100644 --- a/coreapi/callbacks.c +++ b/coreapi/callbacks.c @@ -42,7 +42,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "conference/session/media-session.h" #include "conference/session/media-session-p.h" -using namespace LINPHONE_NAMESPACE; +using namespace LinphonePrivate; static void register_failure(SalOp *op); @@ -62,7 +62,7 @@ static bool_t already_a_call_with_remote_address(const LinphoneCore *lc, const L } -static LinphoneCall * look_for_broken_call_to_replace(LINPHONE_NAMESPACE::SalOp *h, LinphoneCore *lc) { +static LinphoneCall * look_for_broken_call_to_replace(LinphonePrivate::SalOp *h, LinphoneCore *lc) { const bctbx_list_t *calls = linphone_core_get_calls(lc); const bctbx_list_t *it = calls; while (it != NULL) { diff --git a/coreapi/carddav.c b/coreapi/carddav.c index f874b325e..91a742a4a 100644 --- a/coreapi/carddav.c +++ b/coreapi/carddav.c @@ -20,7 +20,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "linphone/core.h" #include "private.h" -using namespace LINPHONE_NAMESPACE; +using namespace LinphonePrivate; LinphoneCardDavContext* linphone_carddav_context_new(LinphoneFriendList *lfl) { LinphoneCardDavContext *carddav_context = NULL; diff --git a/coreapi/chat.c b/coreapi/chat.c index 3797ce69a..d17b6cef7 100644 --- a/coreapi/chat.c +++ b/coreapi/chat.c @@ -43,7 +43,7 @@ #include "content/content-type.h" using namespace std; -using namespace LINPHONE_NAMESPACE; +using namespace LinphonePrivate; void linphone_core_disable_chat(LinphoneCore *lc, LinphoneReason deny_reason) { lc->chat_deny_code = deny_reason; diff --git a/coreapi/error_info.c b/coreapi/error_info.c index cbbaab7b0..556cb35f1 100644 --- a/coreapi/error_info.c +++ b/coreapi/error_info.c @@ -197,7 +197,7 @@ void linphone_error_info_from_sal_reason_ei(LinphoneErrorInfo *ei, const SalErro } } -void linphone_error_info_from_sal_op(LinphoneErrorInfo *ei, const LINPHONE_NAMESPACE::SalOp *op){ +void linphone_error_info_from_sal_op(LinphoneErrorInfo *ei, const LinphonePrivate::SalOp *op){ if (op==NULL) { /*leave previous values in LinphoneErrorInfo, the op may have been released already.*/ return; diff --git a/coreapi/event.c b/coreapi/event.c index 1f7ebe2c5..5b9b0a989 100644 --- a/coreapi/event.c +++ b/coreapi/event.c @@ -23,7 +23,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "c-wrapper/c-wrapper.h" -using namespace LINPHONE_NAMESPACE; +using namespace LinphonePrivate; const char * linphone_subscription_dir_to_string(LinphoneSubscriptionDir dir){ switch(dir){ @@ -81,7 +81,7 @@ static void linphone_event_release(LinphoneEvent *lev){ linphone_event_unref(lev); } -static LinphoneEvent * linphone_event_new_base(LinphoneCore *lc, LinphoneSubscriptionDir dir, const char *name, LINPHONE_NAMESPACE::SalEventOp *op){ +static LinphoneEvent * linphone_event_new_base(LinphoneCore *lc, LinphoneSubscriptionDir dir, const char *name, LinphonePrivate::SalEventOp *op){ LinphoneEvent *lev=belle_sip_object_new(LinphoneEvent); lev->lc=lc; lev->dir=dir; diff --git a/coreapi/friend.c b/coreapi/friend.c index 20e7a1f8e..15df1680c 100644 --- a/coreapi/friend.c +++ b/coreapi/friend.c @@ -43,7 +43,7 @@ #include "c-wrapper/c-wrapper.h" using namespace std; -using namespace LINPHONE_NAMESPACE; +using namespace LinphonePrivate; const char *linphone_online_status_to_string(LinphoneOnlineStatus ss){ const char *str=NULL; diff --git a/coreapi/friendlist.c b/coreapi/friendlist.c index 113ca9ff4..2589c4f1d 100644 --- a/coreapi/friendlist.c +++ b/coreapi/friendlist.c @@ -23,7 +23,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "c-wrapper/c-wrapper.h" -using namespace LINPHONE_NAMESPACE; +using namespace LinphonePrivate; BELLE_SIP_DECLARE_NO_IMPLEMENTED_INTERFACES(LinphoneFriendListCbs); diff --git a/coreapi/info.c b/coreapi/info.c index d4bd92623..3259c94ca 100644 --- a/coreapi/info.c +++ b/coreapi/info.c @@ -28,7 +28,7 @@ #include "c-wrapper/c-wrapper.h" -using namespace LINPHONE_NAMESPACE; +using namespace LinphonePrivate; struct _LinphoneInfoMessage{ belle_sip_object_t base; diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 069ec68fd..4948d1d5f 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -130,7 +130,7 @@ void linphone_core_zrtp_cache_db_init(LinphoneCore *lc, const char *fileName); #include "contact_providers_priv.h" -using namespace LINPHONE_NAMESPACE; +using namespace LinphonePrivate; const char *linphone_core_get_nat_address_resolved(LinphoneCore *lc); diff --git a/coreapi/presence.c b/coreapi/presence.c index 7546b756d..071981d59 100644 --- a/coreapi/presence.c +++ b/coreapi/presence.c @@ -23,7 +23,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "c-wrapper/c-wrapper.h" -using namespace LINPHONE_NAMESPACE; +using namespace LinphonePrivate; extern const char *__policy_enum_to_str(LinphoneSubscribePolicy pol); diff --git a/coreapi/private.h b/coreapi/private.h index ce5b184a4..fe4ae5c48 100644 --- a/coreapi/private.h +++ b/coreapi/private.h @@ -221,7 +221,7 @@ void linphone_call_notify_info_message_received(LinphoneCall *call, const Linpho void linphone_call_notify_ack_processing(LinphoneCall *call, LinphoneHeaders *msg, bool_t is_received); LinphoneCall * linphone_call_new_outgoing(struct _LinphoneCore *lc, const LinphoneAddress *from, const LinphoneAddress *to, const LinphoneCallParams *params, LinphoneProxyConfig *cfg); -LinphoneCall * linphone_call_new_incoming(struct _LinphoneCore *lc, const LinphoneAddress *from, const LinphoneAddress *to, LINPHONE_NAMESPACE::SalCallOp *op); +LinphoneCall * linphone_call_new_incoming(struct _LinphoneCore *lc, const LinphoneAddress *from, const LinphoneAddress *to, LinphonePrivate::SalCallOp *op); void _linphone_call_set_new_params(LinphoneCall *call, const LinphoneCallParams *params); void linphone_call_set_state(LinphoneCall *call, LinphoneCallState cstate, const char *message); /* private: */ @@ -229,10 +229,10 @@ LinphoneCallLog * linphone_call_log_new(LinphoneCallDir dir, LinphoneAddress *fr void linphone_call_set_transfer_state(LinphoneCall* call, LinphoneCallState state); LinphonePlayer *linphone_call_build_player(LinphoneCall*call); void linphone_call_refresh_sockets(LinphoneCall *call); -void linphone_call_replace_op(LinphoneCall *call, LINPHONE_NAMESPACE::SalOp *op); +void linphone_call_replace_op(LinphoneCall *call, LinphonePrivate::SalOp *op); void linphone_call_reinvite_to_recover_from_connection_loss(LinphoneCall *call); -LINPHONE_NAMESPACE::SalCallOp *linphone_call_get_op(const LinphoneCall *call); +LinphonePrivate::SalCallOp *linphone_call_get_op(const LinphoneCall *call); LinphoneProxyConfig * linphone_call_get_dest_proxy(const LinphoneCall *call); LINPHONE_PUBLIC MediaStream * linphone_call_get_stream(LinphoneCall *call, LinphoneStreamType type); LinphoneCallLog * linphone_call_get_log(const LinphoneCall *call); @@ -318,15 +318,15 @@ void _linphone_friend_release(LinphoneFriend *lf); LINPHONE_PUBLIC void linphone_friend_update_subscribes(LinphoneFriend *fr, bool_t only_when_registered); void linphone_friend_notify(LinphoneFriend *lf, LinphonePresenceModel *presence); void linphone_friend_apply(LinphoneFriend *fr, LinphoneCore *lc); -void linphone_friend_add_incoming_subscription(LinphoneFriend *lf, LINPHONE_NAMESPACE::SalOp *op); -void linphone_friend_remove_incoming_subscription(LinphoneFriend *lf, LINPHONE_NAMESPACE::SalOp *op); +void linphone_friend_add_incoming_subscription(LinphoneFriend *lf, LinphonePrivate::SalOp *op); +void linphone_friend_remove_incoming_subscription(LinphoneFriend *lf, LinphonePrivate::SalOp *op); const char * linphone_friend_phone_number_to_sip_uri(LinphoneFriend *lf, const char *phone_number); const char * linphone_friend_sip_uri_to_phone_number(LinphoneFriend *lf, const char *uri); void linphone_friend_clear_presence_models(LinphoneFriend *lf); -LinphoneFriend *linphone_friend_list_find_friend_by_inc_subscribe(const LinphoneFriendList *list, LINPHONE_NAMESPACE::SalOp *op); -LinphoneFriend *linphone_friend_list_find_friend_by_out_subscribe(const LinphoneFriendList *list, LINPHONE_NAMESPACE::SalOp *op); -LinphoneFriend *linphone_core_find_friend_by_out_subscribe(const LinphoneCore *lc, LINPHONE_NAMESPACE::SalOp *op); -LinphoneFriend *linphone_core_find_friend_by_inc_subscribe(const LinphoneCore *lc, LINPHONE_NAMESPACE::SalOp *op); +LinphoneFriend *linphone_friend_list_find_friend_by_inc_subscribe(const LinphoneFriendList *list, LinphonePrivate::SalOp *op); +LinphoneFriend *linphone_friend_list_find_friend_by_out_subscribe(const LinphoneFriendList *list, LinphonePrivate::SalOp *op); +LinphoneFriend *linphone_core_find_friend_by_out_subscribe(const LinphoneCore *lc, LinphonePrivate::SalOp *op); +LinphoneFriend *linphone_core_find_friend_by_inc_subscribe(const LinphoneCore *lc, LinphonePrivate::SalOp *op); MSList *linphone_find_friend_by_address(MSList *fl, const LinphoneAddress *addr, LinphoneFriend **lf); bool_t linphone_core_should_subscribe_friends_only_when_registered(const LinphoneCore *lc); void linphone_core_update_friends_subscriptions(LinphoneCore *lc); @@ -361,19 +361,19 @@ static MS2_INLINE void set_string(char **dest, const char *src, bool_t lowercase } } -void linphone_process_authentication(LinphoneCore* lc, LINPHONE_NAMESPACE::SalOp *op); -void linphone_authentication_ok(LinphoneCore *lc, LINPHONE_NAMESPACE::SalOp *op); -void linphone_subscription_new(LinphoneCore *lc, LINPHONE_NAMESPACE::SalSubscribeOp *op, const char *from); +void linphone_process_authentication(LinphoneCore* lc, LinphonePrivate::SalOp *op); +void linphone_authentication_ok(LinphoneCore *lc, LinphonePrivate::SalOp *op); +void linphone_subscription_new(LinphoneCore *lc, LinphonePrivate::SalSubscribeOp *op, const char *from); void linphone_core_send_presence(LinphoneCore *lc, LinphonePresenceModel *presence); void linphone_notify_parse_presence(const char *content_type, const char *content_subtype, const char *body, SalPresenceModel **result); -void linphone_notify_convert_presence_to_xml(LINPHONE_NAMESPACE::SalOp *op, SalPresenceModel *presence, const char *contact, char **content); -void linphone_notify_recv(LinphoneCore *lc, LINPHONE_NAMESPACE::SalOp *op, SalSubscribeStatus ss, SalPresenceModel *model); -void linphone_proxy_config_process_authentication_failure(LinphoneCore *lc, LINPHONE_NAMESPACE::SalOp *op); +void linphone_notify_convert_presence_to_xml(LinphonePrivate::SalOp *op, SalPresenceModel *presence, const char *contact, char **content); +void linphone_notify_recv(LinphoneCore *lc, LinphonePrivate::SalOp *op, SalSubscribeStatus ss, SalPresenceModel *model); +void linphone_proxy_config_process_authentication_failure(LinphoneCore *lc, LinphonePrivate::SalOp *op); void linphone_core_soundcard_hint_check(LinphoneCore* lc); -void linphone_subscription_answered(LinphoneCore *lc, LINPHONE_NAMESPACE::SalOp *op); -void linphone_subscription_closed(LinphoneCore *lc, LINPHONE_NAMESPACE::SalOp *op); +void linphone_subscription_answered(LinphoneCore *lc, LinphonePrivate::SalOp *op); +void linphone_subscription_closed(LinphoneCore *lc, LinphonePrivate::SalOp *op); void linphone_core_update_allocated_audio_bandwidth(LinphoneCore *lc); @@ -422,7 +422,7 @@ LINPHONE_PUBLIC void linphone_core_get_local_ip(LinphoneCore *lc, int af, const LinphoneProxyConfig *linphone_proxy_config_new_from_config_file(LinphoneCore *lc, int index); void linphone_proxy_config_write_to_config_file(LinphoneConfig* config,LinphoneProxyConfig *obj, int index); -int linphone_core_message_received(LinphoneCore *lc, LINPHONE_NAMESPACE::SalOp *op, const SalMessage *msg); +int linphone_core_message_received(LinphoneCore *lc, LinphonePrivate::SalOp *op, const SalMessage *msg); void linphone_core_real_time_text_received(LinphoneCore *lc, LinphoneChatRoom *cr, uint32_t character, LinphoneCall *call); void linphone_call_init_media_streams(LinphoneCall *call); @@ -446,7 +446,7 @@ int linphone_call_start_update(LinphoneCall *call); int linphone_call_start_accept_update(LinphoneCall *call, LinphoneCallState next_state, const char *state_info); void linphone_core_notify_incoming_call(LinphoneCore *lc, LinphoneCall *call); bool_t linphone_core_incompatible_security(LinphoneCore *lc, SalMediaDescription *md); -extern LINPHONE_NAMESPACE::Sal::Callbacks linphone_sal_callbacks; +extern LinphonePrivate::Sal::Callbacks linphone_sal_callbacks; LINPHONE_PUBLIC bool_t linphone_core_rtcp_enabled(const LinphoneCore *lc); LINPHONE_PUBLIC bool_t linphone_core_symmetric_rtp_enabled(LinphoneCore*lc); @@ -488,7 +488,7 @@ struct _LinphoneProxyConfig char *contact_uri_params; int expires; int publish_expires; - LINPHONE_NAMESPACE::SalRegisterOp *op; + LinphonePrivate::SalRegisterOp *op; SalCustomHeader *sent_headers; char *type; struct _SipSetupContext *ssctx; @@ -567,7 +567,7 @@ struct _LinphoneFriend{ void *user_data; LinphoneAddress *uri; MSList *insubs; /*list of SalOp. There can be multiple instances of a same Friend that subscribe to our presence*/ - LINPHONE_NAMESPACE::SalPresenceOp *outsub; + LinphonePrivate::SalPresenceOp *outsub; LinphoneSubscribePolicy pol; MSList *presence_models; /* list of LinphoneFriendPresence. It associates SIP URIs and phone numbers with their respective presence models. */ MSList *phone_number_sip_uri_map; /* list of LinphoneFriendPhoneNumberSipUri. It associates phone numbers with their corresponding SIP URIs. */ @@ -805,7 +805,7 @@ struct _LinphoneCore MSFactory* factory; MSList* vtable_refs; int vtable_notify_recursion; - LINPHONE_NAMESPACE::Sal *sal; + LinphonePrivate::Sal *sal; LinphoneGlobalState state; struct _LpConfig *config; MSList *default_audio_codecs; @@ -941,7 +941,7 @@ struct _LinphoneEvent{ LinphoneErrorInfo *ei; LinphoneSubscriptionDir dir; LinphoneCore *lc; - LINPHONE_NAMESPACE::SalEventOp *op; + LinphonePrivate::SalEventOp *op; SalCustomHeader *send_custom_headers; LinphoneSubscriptionState subscription_state; LinphonePublishState publish_state; @@ -1099,8 +1099,8 @@ belle_http_request_t * linphone_chat_message_get_http_request(const LinphoneChat void linphone_chat_message_set_http_request(LinphoneChatMessage *msg, belle_http_request_t *request); void linphone_chat_message_set_file_transfer_information(LinphoneChatMessage *msg, LinphoneContent *content); LinphoneChatMessageDir linphone_chat_message_get_direction(const LinphoneChatMessage *msg); -LINPHONE_NAMESPACE::SalOp * linphone_chat_message_get_sal_op(const LinphoneChatMessage *msg); -void linphone_chat_message_set_sal_op(LinphoneChatMessage *msg, LINPHONE_NAMESPACE::SalOp *op); +LinphonePrivate::SalOp * linphone_chat_message_get_sal_op(const LinphoneChatMessage *msg); +void linphone_chat_message_set_sal_op(LinphoneChatMessage *msg, LinphonePrivate::SalOp *op); void linphone_chat_message_destroy(LinphoneChatMessage* msg); void linphone_chat_message_update_state(LinphoneChatMessage *msg, LinphoneChatMessageState new_state); void linphone_chat_message_set_is_secured(LinphoneChatMessage *msg, bool_t secured); @@ -1119,10 +1119,10 @@ void linphone_chat_message_send_imdn(LinphoneChatMessage *cm, ImdnType imdn_type void linphone_core_play_named_tone(LinphoneCore *lc, LinphoneToneID id); bool_t linphone_core_tone_indications_enabled(LinphoneCore*lc); const char *linphone_core_create_uuid(LinphoneCore *lc); -void linphone_configure_op(LinphoneCore *lc, LINPHONE_NAMESPACE::SalOp *op, const LinphoneAddress *dest, SalCustomHeader *headers, bool_t with_contact); -void linphone_configure_op_with_proxy(LinphoneCore *lc, LINPHONE_NAMESPACE::SalOp *op, const LinphoneAddress *dest, SalCustomHeader *headers, bool_t with_contact, LinphoneProxyConfig *proxy); +void linphone_configure_op(LinphoneCore *lc, LinphonePrivate::SalOp *op, const LinphoneAddress *dest, SalCustomHeader *headers, bool_t with_contact); +void linphone_configure_op_with_proxy(LinphoneCore *lc, LinphonePrivate::SalOp *op, const LinphoneAddress *dest, SalCustomHeader *headers, bool_t with_contact, LinphoneProxyConfig *proxy); void linphone_call_create_op(LinphoneCall *call); -void linphone_core_notify_info_message(LinphoneCore* lc,LINPHONE_NAMESPACE::SalOp *op, SalBodyHandler *body); +void linphone_core_notify_info_message(LinphoneCore* lc,LinphonePrivate::SalOp *op, SalBodyHandler *body); LinphoneContent * linphone_content_new(void); LinphoneContent * linphone_content_copy(const LinphoneContent *ref); SalBodyHandler *sal_body_handler_from_content(const LinphoneContent *content); @@ -1130,12 +1130,12 @@ SalReason linphone_reason_to_sal(LinphoneReason reason); LinphoneReason linphone_reason_from_sal(SalReason reason); void linphone_error_info_to_sal(const LinphoneErrorInfo* ei, SalErrorInfo* sei); LinphoneEvent *linphone_event_new(LinphoneCore *lc, LinphoneSubscriptionDir dir, const char *name, int expires); -LinphoneEvent *linphone_event_new_with_op(LinphoneCore *lc, LINPHONE_NAMESPACE::SalEventOp *op, LinphoneSubscriptionDir dir, const char *name); +LinphoneEvent *linphone_event_new_with_op(LinphoneCore *lc, LinphonePrivate::SalEventOp *op, LinphoneSubscriptionDir dir, const char *name); void linphone_event_unpublish(LinphoneEvent *lev); /** * Useful for out of dialog notify * */ -LinphoneEvent *linphone_event_new_with_out_of_dialog_op(LinphoneCore *lc, LINPHONE_NAMESPACE::SalEventOp *op, LinphoneSubscriptionDir dir, const char *name); +LinphoneEvent *linphone_event_new_with_out_of_dialog_op(LinphoneCore *lc, LinphonePrivate::SalEventOp *op, LinphoneSubscriptionDir dir, const char *name); void linphone_event_set_internal(LinphoneEvent *lev, bool_t internal); bool_t linphone_event_is_internal(LinphoneEvent *lev); void linphone_event_set_state(LinphoneEvent *lev, LinphoneSubscriptionState state); @@ -1358,7 +1358,7 @@ void linphone_xml_xpath_context_init_carddav_ns(xmlparsing_context_t *xml_ctx); char * linphone_timestamp_to_rfc3339_string(time_t timestamp); -void linphone_error_info_from_sal_op(LinphoneErrorInfo *ei, const LINPHONE_NAMESPACE::SalOp *op); +void linphone_error_info_from_sal_op(LinphoneErrorInfo *ei, const LinphonePrivate::SalOp *op); void payload_type_set_enable(OrtpPayloadType *pt, bool_t value); bool_t payload_type_enabled(const OrtpPayloadType *pt); diff --git a/coreapi/proxy.c b/coreapi/proxy.c index 590b144e5..da1d83afd 100644 --- a/coreapi/proxy.c +++ b/coreapi/proxy.c @@ -33,7 +33,7 @@ Copyright (C) 2000 Simon MORLAT (simon.morlat@linphone.org) #include "address/address-p.h" #include "c-wrapper/c-wrapper.h" -using namespace LINPHONE_NAMESPACE; +using namespace LinphonePrivate; /*store current config related to server location*/ static void linphone_proxy_config_store_server_config(LinphoneProxyConfig* cfg) { diff --git a/coreapi/sal/sal.cpp b/coreapi/sal/sal.cpp index 1222c757c..fb5d91dd0 100644 --- a/coreapi/sal/sal.cpp +++ b/coreapi/sal/sal.cpp @@ -870,7 +870,7 @@ LINPHONE_END_NAMESPACE /* C++ to C wrapping functions */ /*******************************/ -using namespace LINPHONE_NAMESPACE; +using namespace LinphonePrivate; extern "C" { diff --git a/coreapi/vcard.cc b/coreapi/vcard.cc index 0bd71534d..62d907082 100644 --- a/coreapi/vcard.cc +++ b/coreapi/vcard.cc @@ -32,7 +32,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #define VCARD_MD5_HASH_SIZE 16 using namespace std; -using namespace LINPHONE_NAMESPACE; +using namespace LinphonePrivate; struct _LinphoneVcardContext { shared_ptr parser; diff --git a/include/linphone/utils/general.h b/include/linphone/utils/general.h index 060c85df1..515767649 100644 --- a/include/linphone/utils/general.h +++ b/include/linphone/utils/general.h @@ -21,10 +21,8 @@ // ============================================================================= -#define LINPHONE_NAMESPACE LinphonePrivate - #ifdef __cplusplus - #define LINPHONE_BEGIN_NAMESPACE namespace LINPHONE_NAMESPACE { + #define LINPHONE_BEGIN_NAMESPACE namespace LinphonePrivate { #define LINPHONE_END_NAMESPACE } #else #define LINPHONE_BEGIN_NAMESPACE @@ -68,7 +66,7 @@ void l_assert (const char *condition, const char *file, int line); #ifndef DEBUG #define L_ASSERT(CONDITION) static_cast(false && (CONDITION)) #else - #define L_ASSERT(CONDITION) ((CONDITION) ? static_cast(0) : LINPHONE_NAMESPACE::l_assert(#CONDITION, __FILE__, __LINE__)) + #define L_ASSERT(CONDITION) ((CONDITION) ? static_cast(0) : LinphonePrivate::l_assert(#CONDITION, __FILE__, __LINE__)) #endif #ifndef _MSC_VER diff --git a/src/c-wrapper/api/c-address.cpp b/src/c-wrapper/api/c-address.cpp index c144d0da8..b1f603a65 100644 --- a/src/c-wrapper/api/c-address.cpp +++ b/src/c-wrapper/api/c-address.cpp @@ -28,7 +28,7 @@ using namespace std; // ============================================================================= LinphoneAddress *linphone_address_new (const char *address) { - LINPHONE_NAMESPACE::Address *cppPtr = new LINPHONE_NAMESPACE::Address(L_C_TO_STRING(address)); + LinphonePrivate::Address *cppPtr = new LinphonePrivate::Address(L_C_TO_STRING(address)); if (!cppPtr->isValid()) { delete cppPtr; return nullptr; @@ -94,7 +94,7 @@ LinphoneTransportType linphone_address_get_transport (const LinphoneAddress *add } LinphoneStatus linphone_address_set_transport (LinphoneAddress *address, LinphoneTransportType transport) { - return !L_GET_CPP_PTR_FROM_C_OBJECT(address)->setTransport(static_cast(transport)); + return !L_GET_CPP_PTR_FROM_C_OBJECT(address)->setTransport(static_cast(transport)); } bool_t linphone_address_get_secure (const LinphoneAddress *address) { diff --git a/src/c-wrapper/api/c-call.cpp b/src/c-wrapper/api/c-call.cpp index 0a83d27b9..4d0278ed4 100644 --- a/src/c-wrapper/api/c-call.cpp +++ b/src/c-wrapper/api/c-call.cpp @@ -48,8 +48,8 @@ L_DECLARE_C_OBJECT_IMPL_WITH_XTORS(Call, SalMediaDescription *localdesc; SalMediaDescription *resultdesc; struct _LinphoneCallLog *log; - LINPHONE_NAMESPACE::SalOp *op; - LINPHONE_NAMESPACE::SalOp *ping_op; + LinphonePrivate::SalOp *op; + LinphonePrivate::SalOp *ping_op; LinphoneCallState transfer_state; /*idle if no transfer*/ struct _AudioStream *audiostream; /**/ struct _VideoStream *videostream; @@ -325,7 +325,7 @@ int linphone_call_start_invite (LinphoneCall *call, const LinphoneAddress *desti return 0; } -void linphone_call_replace_op (LinphoneCall *call, LINPHONE_NAMESPACE::SalOp *op) { +void linphone_call_replace_op (LinphoneCall *call, LinphonePrivate::SalOp *op) { #if 0 SalOp *oldop = call->op; LinphoneCallState oldstate = linphone_call_get_state(call); @@ -507,7 +507,7 @@ void linphone_call_refresh_sockets (LinphoneCall *call) { #endif } -LINPHONE_NAMESPACE::SalCallOp * linphone_call_get_op (const LinphoneCall *call) { +LinphonePrivate::SalCallOp * linphone_call_get_op (const LinphoneCall *call) { return L_GET_PRIVATE_FROM_C_OBJECT(call)->getOp(); } @@ -1193,7 +1193,7 @@ LinphoneCall *linphone_call_new_outgoing (LinphoneCore *lc, const LinphoneAddres return call; } -LinphoneCall *linphone_call_new_incoming (LinphoneCore *lc, const LinphoneAddress *from, const LinphoneAddress *to, LINPHONE_NAMESPACE::SalCallOp *op) { +LinphoneCall *linphone_call_new_incoming (LinphoneCore *lc, const LinphoneAddress *from, const LinphoneAddress *to, LinphonePrivate::SalCallOp *op) { LinphoneCall *call = L_INIT(Call); L_SET_CPP_PTR_FROM_C_OBJECT(call, make_shared(call, lc, LinphoneCallIncoming, *L_GET_CPP_PTR_FROM_C_OBJECT(from), *L_GET_CPP_PTR_FROM_C_OBJECT(to), diff --git a/src/c-wrapper/api/c-chat-message.cpp b/src/c-wrapper/api/c-chat-message.cpp index 4206aefee..b4d9009ae 100644 --- a/src/c-wrapper/api/c-chat-message.cpp +++ b/src/c-wrapper/api/c-chat-message.cpp @@ -34,7 +34,7 @@ // ============================================================================= using namespace std; -using namespace LINPHONE_NAMESPACE; +using namespace LinphonePrivate; static void _linphone_chat_message_constructor (LinphoneChatMessage *msg); static void _linphone_chat_message_destructor (LinphoneChatMessage *msg); diff --git a/src/c-wrapper/api/c-event-log.cpp b/src/c-wrapper/api/c-event-log.cpp index 873988e0a..c1f54e3d0 100644 --- a/src/c-wrapper/api/c-event-log.cpp +++ b/src/c-wrapper/api/c-event-log.cpp @@ -42,7 +42,7 @@ using namespace std; LinphoneEventLog *linphone_event_log_new () { LinphoneEventLog *event_log = _linphone_EventLog_init(); - L_SET_CPP_PTR_FROM_C_OBJECT(event_log, new LINPHONE_NAMESPACE::EventLog()); + L_SET_CPP_PTR_FROM_C_OBJECT(event_log, new LinphonePrivate::EventLog()); return event_log; } @@ -65,8 +65,8 @@ LinphoneCallEvent *linphone_call_event_new (LinphoneEventLogType type, LinphoneC LinphoneCallEvent *call_event = _linphone_CallEvent_init(); L_SET_CPP_PTR_FROM_C_OBJECT( call_event, - new LINPHONE_NAMESPACE::CallEvent( - static_cast(type), + new LinphonePrivate::CallEvent( + static_cast(type), L_GET_CPP_PTR_FROM_C_OBJECT(call) ) ); @@ -124,7 +124,7 @@ LinphoneChatMessageEvent *linphone_chat_message_event_new (LinphoneChatMessage * LinphoneChatMessageEvent *chat_message_event = _linphone_ChatMessageEvent_init(); L_SET_CPP_PTR_FROM_C_OBJECT( chat_message_event, - new LINPHONE_NAMESPACE::ChatMessageEvent( + new LinphonePrivate::ChatMessageEvent( L_GET_CPP_PTR_FROM_C_OBJECT(chat_message) ) ); diff --git a/src/c-wrapper/internal/c-tools.h b/src/c-wrapper/internal/c-tools.h index 2aeb69ac4..8bdb93998 100644 --- a/src/c-wrapper/internal/c-tools.h +++ b/src/c-wrapper/internal/c-tools.h @@ -489,10 +489,10 @@ LINPHONE_END_NAMESPACE LINPHONE_END_NAMESPACE #define L_CPP_TYPE_OF_C_TYPE(C_TYPE) \ - LINPHONE_NAMESPACE::CTypeMetaInfo::cppType + LinphonePrivate::CTypeMetaInfo::cppType #define L_CPP_TYPE_OF_C_OBJECT(C_OBJECT) \ - LINPHONE_NAMESPACE::CTypeMetaInfo::type>::type>::cppType + LinphonePrivate::CTypeMetaInfo::type>::type>::cppType // ----------------------------------------------------------------------------- // C object declaration. @@ -518,7 +518,7 @@ LINPHONE_END_NAMESPACE // Declare clonable wrapped C object. #define L_DECLARE_C_CLONABLE_STRUCT_IMPL(C_TYPE, ...) \ - static_assert(LINPHONE_NAMESPACE::CTypeMetaInfo::defined, "Type is not defined."); \ + static_assert(LinphonePrivate::CTypeMetaInfo::defined, "Type is not defined."); \ struct _Linphone ## C_TYPE { \ belle_sip_object_t base; \ L_CPP_TYPE_OF_C_TYPE(C_TYPE) *cppPtr; \ @@ -547,7 +547,7 @@ LINPHONE_END_NAMESPACE #define L_DECLARE_C_OBJECT_NEW_DEFAULT(C_TYPE, C_NAME) \ Linphone ## C_TYPE * linphone_ ## C_NAME ## _new() { \ Linphone ## C_TYPE *object = _linphone_ ## C_TYPE ## _init(); \ - object->cppPtr = std::make_shared(); \ + object->cppPtr = std::make_shared(); \ return object; \ } @@ -564,11 +564,11 @@ LINPHONE_END_NAMESPACE // Get/set the cpp-ptr of a wrapped C object. #define L_GET_CPP_PTR_FROM_C_OBJECT_1_ARGS(C_OBJECT) \ - LINPHONE_NAMESPACE::Wrapper::getCppPtrFromC(C_OBJECT) + LinphonePrivate::Wrapper::getCppPtrFromC(C_OBJECT) #define L_GET_CPP_PTR_FROM_C_OBJECT_2_ARGS(C_OBJECT, CPP_TYPE) \ - LINPHONE_NAMESPACE::Wrapper::getCppPtrFromC< \ + LinphonePrivate::Wrapper::getCppPtrFromC< \ std::remove_pointer::type, \ - LINPHONE_NAMESPACE::CPP_TYPE \ + LinphonePrivate::CPP_TYPE \ >(C_OBJECT) #define L_GET_CPP_PTR_FROM_C_OBJECT_MACRO_CHOOSER(...) \ @@ -579,13 +579,13 @@ LINPHONE_END_NAMESPACE // Set the cpp-ptr of a wrapped C object. #define L_SET_CPP_PTR_FROM_C_OBJECT(C_OBJECT, CPP_OBJECT) \ - LINPHONE_NAMESPACE::Wrapper::setCppPtrFromC(C_OBJECT, CPP_OBJECT) + LinphonePrivate::Wrapper::setCppPtrFromC(C_OBJECT, CPP_OBJECT) // Get the private data of a shared or simple cpp-ptr. #define L_GET_PRIVATE_1_ARGS(CPP_OBJECT) \ - LINPHONE_NAMESPACE::Wrapper::getPrivate(LINPHONE_NAMESPACE::Utils::getPtr(CPP_OBJECT)) + LinphonePrivate::Wrapper::getPrivate(LinphonePrivate::Utils::getPtr(CPP_OBJECT)) #define L_GET_PRIVATE_2_ARGS(CPP_OBJECT, CPP_TYPE) \ - LINPHONE_NAMESPACE::Wrapper::cast(L_GET_PRIVATE_1_ARGS(CPP_OBJECT)) + LinphonePrivate::Wrapper::cast(L_GET_PRIVATE_1_ARGS(CPP_OBJECT)) #define L_GET_PRIVATE_MACRO_CHOOSER(...) \ L_EXPAND(L_GET_ARG_3(__VA_ARGS__, L_GET_PRIVATE_2_ARGS, L_GET_PRIVATE_1_ARGS)) @@ -595,9 +595,9 @@ LINPHONE_END_NAMESPACE // Get the private data of a shared or simple cpp-ptr of a wrapped C object. #define L_GET_PRIVATE_FROM_C_OBJECT_1_ARGS(C_OBJECT) \ - L_GET_PRIVATE_1_ARGS(LINPHONE_NAMESPACE::Utils::getPtr(L_GET_CPP_PTR_FROM_C_OBJECT_1_ARGS(C_OBJECT))) + L_GET_PRIVATE_1_ARGS(LinphonePrivate::Utils::getPtr(L_GET_CPP_PTR_FROM_C_OBJECT_1_ARGS(C_OBJECT))) #define L_GET_PRIVATE_FROM_C_OBJECT_2_ARGS(C_OBJECT, CPP_TYPE) \ - L_GET_PRIVATE_1_ARGS(LINPHONE_NAMESPACE::Utils::getPtr(L_GET_CPP_PTR_FROM_C_OBJECT_2_ARGS(C_OBJECT, CPP_TYPE))) + L_GET_PRIVATE_1_ARGS(LinphonePrivate::Utils::getPtr(L_GET_CPP_PTR_FROM_C_OBJECT_2_ARGS(C_OBJECT, CPP_TYPE))) #define L_GET_PRIVATE_FROM_C_OBJECT_MACRO_CHOOSER(...) \ L_EXPAND(L_GET_ARG_3(__VA_ARGS__, L_GET_PRIVATE_FROM_C_OBJECT_2_ARGS, L_GET_PRIVATE_FROM_C_OBJECT_1_ARGS)) @@ -607,29 +607,29 @@ LINPHONE_END_NAMESPACE // Get the wrapped C object of a C++ object. #define L_GET_C_BACK_PTR(CPP_OBJECT) \ - LINPHONE_NAMESPACE::Wrapper::getCBackPtr(CPP_OBJECT) + LinphonePrivate::Wrapper::getCBackPtr(CPP_OBJECT) // Get/set user data on a wrapped C object. #define L_GET_USER_DATA_FROM_C_OBJECT(C_OBJECT) \ - LINPHONE_NAMESPACE::Wrapper::getUserData( \ - LINPHONE_NAMESPACE::Utils::getPtr(L_GET_CPP_PTR_FROM_C_OBJECT(C_OBJECT)) \ + LinphonePrivate::Wrapper::getUserData( \ + LinphonePrivate::Utils::getPtr(L_GET_CPP_PTR_FROM_C_OBJECT(C_OBJECT)) \ ) #define L_SET_USER_DATA_FROM_C_OBJECT(C_OBJECT, VALUE) \ - LINPHONE_NAMESPACE::Wrapper::setUserData( \ - LINPHONE_NAMESPACE::Utils::getPtr(L_GET_CPP_PTR_FROM_C_OBJECT(C_OBJECT)), \ + LinphonePrivate::Wrapper::setUserData( \ + LinphonePrivate::Utils::getPtr(L_GET_CPP_PTR_FROM_C_OBJECT(C_OBJECT)), \ VALUE \ ) // Transforms cpp list and c list. #define L_GET_C_LIST_FROM_CPP_LIST(CPP_LIST) \ - LINPHONE_NAMESPACE::Wrapper::getCListFromCppList(CPP_LIST) + LinphonePrivate::Wrapper::getCListFromCppList(CPP_LIST) #define L_GET_CPP_LIST_FROM_C_LIST(C_LIST, TYPE) \ - LINPHONE_NAMESPACE::Wrapper::getCppListFromCList(C_LIST) + LinphonePrivate::Wrapper::getCppListFromCList(C_LIST) // Transforms cpp list and c list and convert cpp object to c object. #define L_GET_RESOLVED_C_LIST_FROM_CPP_LIST(CPP_LIST) \ - LINPHONE_NAMESPACE::Wrapper::getResolvedCListFromCppList(CPP_LIST) + LinphonePrivate::Wrapper::getResolvedCListFromCppList(CPP_LIST) #define L_GET_RESOLVED_CPP_LIST_FROM_C_LIST(C_LIST, C_TYPE) \ - LINPHONE_NAMESPACE::Wrapper::getResolvedCppListFromCList(C_LIST) + LinphonePrivate::Wrapper::getResolvedCppListFromCList(C_LIST) #endif // ifndef _C_TOOLS_H_ diff --git a/src/chat/cpim/parser/cpim-parser.cpp b/src/chat/cpim/parser/cpim-parser.cpp index 48f6b7524..19b6018ae 100644 --- a/src/chat/cpim/parser/cpim-parser.cpp +++ b/src/chat/cpim/parser/cpim-parser.cpp @@ -339,19 +339,19 @@ static bool coreHeaderIsValid ( template<> bool Cpim::Parser::coreHeaderIsValid(const string &headerValue) const { L_D(); - return LINPHONE_NAMESPACE::coreHeaderIsValid(d->grammar, "From", headerValue); + return LinphonePrivate::coreHeaderIsValid(d->grammar, "From", headerValue); } template<> bool Cpim::Parser::coreHeaderIsValid(const string &headerValue) const { L_D(); - return LINPHONE_NAMESPACE::coreHeaderIsValid(d->grammar, "To", headerValue); + return LinphonePrivate::coreHeaderIsValid(d->grammar, "To", headerValue); } template<> bool Cpim::Parser::coreHeaderIsValid(const string &headerValue) const { L_D(); - return LINPHONE_NAMESPACE::coreHeaderIsValid(d->grammar, "cc", headerValue); + return LinphonePrivate::coreHeaderIsValid(d->grammar, "cc", headerValue); } template<> @@ -359,7 +359,7 @@ bool Cpim::Parser::coreHeaderIsValid(const string &headerV static const int daysInMonth[12] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; L_D(); - if (!LINPHONE_NAMESPACE::coreHeaderIsValid(d->grammar, "DateTime", headerValue)) + if (!LinphonePrivate::coreHeaderIsValid(d->grammar, "DateTime", headerValue)) return false; // Check date. @@ -398,26 +398,26 @@ bool Cpim::Parser::coreHeaderIsValid(const string &headerV template<> bool Cpim::Parser::coreHeaderIsValid(const string &headerValue) const { L_D(); - return LINPHONE_NAMESPACE::coreHeaderIsValid(d->grammar, "Subject", headerValue); + return LinphonePrivate::coreHeaderIsValid(d->grammar, "Subject", headerValue); } template<> bool Cpim::Parser::coreHeaderIsValid(const string &headerValue) const { L_D(); - return LINPHONE_NAMESPACE::coreHeaderIsValid(d->grammar, "NS", headerValue); + return LinphonePrivate::coreHeaderIsValid(d->grammar, "NS", headerValue); } template<> bool Cpim::Parser::coreHeaderIsValid(const string &headerValue) const { L_D(); - return LINPHONE_NAMESPACE::coreHeaderIsValid(d->grammar, "Require", headerValue); + return LinphonePrivate::coreHeaderIsValid(d->grammar, "Require", headerValue); } // ----------------------------------------------------------------------------- bool Cpim::Parser::subjectHeaderLanguageIsValid (const string &language) const { L_D(); - return LINPHONE_NAMESPACE::coreHeaderIsValid(d->grammar, "Subject", "SubjectValue", ";lang=" + language); + return LinphonePrivate::coreHeaderIsValid(d->grammar, "Subject", "SubjectValue", ";lang=" + language); } LINPHONE_END_NAMESPACE diff --git a/src/logger/logger.h b/src/logger/logger.h index daaa0b6a9..785dfc4ab 100644 --- a/src/logger/logger.h +++ b/src/logger/logger.h @@ -51,11 +51,11 @@ private: LINPHONE_END_NAMESPACE -#define lDebug() LINPHONE_NAMESPACE::Logger(LINPHONE_NAMESPACE::Logger::Debug).getOutput() -#define lInfo() LINPHONE_NAMESPACE::Logger(LINPHONE_NAMESPACE::Logger::Info).getOutput() -#define lWarning() LINPHONE_NAMESPACE::Logger(LINPHONE_NAMESPACE::Logger::Warning).getOutput() -#define lError() LINPHONE_NAMESPACE::Logger(LINPHONE_NAMESPACE::Logger::Error).getOutput() -#define lFatal() LINPHONE_NAMESPACE::Logger(LINPHONE_NAMESPACE::Logger::Fatal).getOutput() +#define lDebug() LinphonePrivate::Logger(LinphonePrivate::Logger::Debug).getOutput() +#define lInfo() LinphonePrivate::Logger(LinphonePrivate::Logger::Info).getOutput() +#define lWarning() LinphonePrivate::Logger(LinphonePrivate::Logger::Warning).getOutput() +#define lError() LinphonePrivate::Logger(LinphonePrivate::Logger::Error).getOutput() +#define lFatal() LinphonePrivate::Logger(LinphonePrivate::Logger::Fatal).getOutput() #define L_BEGIN_LOG_EXCEPTION try { #define L_END_LOG_EXCEPTION \ diff --git a/tester/cpim-tester.cpp b/tester/cpim-tester.cpp index ea83c2f65..09e8bb4d9 100644 --- a/tester/cpim-tester.cpp +++ b/tester/cpim-tester.cpp @@ -24,7 +24,7 @@ using namespace std; -using namespace LINPHONE_NAMESPACE; +using namespace LinphonePrivate; static void parse_minimal_message () { const string str = "Content-type: Message/CPIM\r\n"