feat(c-wrapper): avoid usage of extern init...

This commit is contained in:
Ronan Abhamon 2017-09-21 14:12:08 +02:00
parent 1dae5d1742
commit 48487d518f
24 changed files with 75 additions and 67 deletions

View file

@ -33,7 +33,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include <unistd.h>
#endif
#include "c-wrapper/c-tools.h"
#include "c-wrapper/c-wrapper.h"
#include "call/call-p.h"
#include "conference/session/call-session.h"
#include "conference/session/call-session-p.h"

View file

@ -35,7 +35,7 @@
#include "ortp/b64.h"
#include "linphone/wrapper_utils.h"
#include "c-wrapper/c-tools.h"
#include "c-wrapper/c-wrapper.h"
#include "chat/basic-chat-room.h"
#include "chat/client-group-chat-room.h"
#include "chat/real-time-text-chat-room.h"

View file

@ -25,7 +25,7 @@
#include "linphone/core.h"
#include "private.h"
#include "c-wrapper/c-tools.h"
#include "c-wrapper/c-wrapper.h"
#include "chat/chat-room.h"
LinphoneChatMessage *linphone_chat_room_create_file_transfer_message(LinphoneChatRoom *cr, const LinphoneContent *initial_content) {

View file

@ -45,7 +45,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
// For migration purpose.
#include "address/address-p.h"
#include "c-wrapper/c-tools.h"
#include "c-wrapper/c-wrapper.h"
#include "call/call.h"
#include "call/call-p.h"
#include "conference/params/media-session-params-p.h"

View file

@ -49,7 +49,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
// For migration purpose.
#include "address/address-p.h"
#include "c-wrapper/c-tools.h"
#include "c-wrapper/c-wrapper.h"
#ifdef INET6
#ifndef _WIN32
@ -66,7 +66,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "TargetConditionals.h"
#endif
#include "c-wrapper/c-tools.h"
#include "c-wrapper/c-wrapper.h"
#include "call/call-p.h"
#include "conference/params/media-session-params-p.h"

View file

@ -31,7 +31,7 @@ Copyright (C) 2000 Simon MORLAT (simon.morlat@linphone.org)
// For migration purpose.
#include "address/address-p.h"
#include "c-wrapper/c-tools.h"
#include "c-wrapper/c-wrapper.h"
/*store current config related to server location*/
static void linphone_proxy_config_store_server_config(LinphoneProxyConfig* cfg) {

View file

@ -34,7 +34,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
// For migration purpose.
#include "address/address-p.h"
#include "c-wrapper/c-tools.h"
#include "c-wrapper/c-wrapper.h"
#define STR_REASSIGN(dest, src) {\
if (dest != NULL) \

View file

@ -23,7 +23,8 @@
set(LINPHONE_CXX_OBJECTS_PRIVATE_HEADER_FILES
address/address-p.h
address/address.h
c-wrapper/c-tools.h
c-wrapper/c-wrapper.h
c-wrapper/internal/c-tools.h
call/call-listener.h
call/call-p.h
call/call.h

View file

@ -20,7 +20,7 @@
#include "sal/sal.h"
#include "address-p.h"
#include "c-wrapper/c-tools.h"
#include "c-wrapper/c-wrapper.h"
#include "logger/logger.h"
#include "address.h"

View file

@ -16,10 +16,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "linphone/api/c-address.h"
#include "address/address.h"
#include "c-wrapper/c-tools.h"
#include "c-wrapper/c-wrapper.h"
// =============================================================================

View file

@ -16,15 +16,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "linphone/call_params.h"
// TODO: Remove me later.
#include "private.h"
#include "c-wrapper/c-tools.h"
#include "c-wrapper/c-wrapper.h"
#include "conference/params/call-session-params-p.h"
#include "conference/params/media-session-params-p.h"
#include "conference/params/media-session-params.h"
// =============================================================================

View file

@ -18,8 +18,7 @@
#include "linphone/api/c-chat-message-cbs.h"
// TODO: Remove me later.
#include "private.h"
#include "c-wrapper/c-wrapper.h"
// =============================================================================
@ -66,7 +65,7 @@ void linphone_chat_message_cbs_set_user_data (LinphoneChatMessageCbs *cbs, void
cbs->userData = ud;
}
LinphoneChatMessageCbsMsgStateChangedCb
LinphoneChatMessageCbsMsgStateChangedCb
linphone_chat_message_cbs_get_msg_state_changed(const LinphoneChatMessageCbs *cbs) {
return cbs->msg_state_changed;
}

View file

@ -16,21 +16,17 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "linphone/chat.h"
#include "linphone/wrapper_utils.h"
#include "linphone/api/c-chat-message.h"
#include "linphone/utils/utils.h"
#include "linphone/wrapper_utils.h"
#include "ortp/b64.h"
// TODO: Remove me later.
#include "private.h"
#include "chat/chat-room.h"
#include "c-wrapper/c-wrapper.h"
#include "chat/chat-message-p.h"
#include "chat/chat-room-p.h"
#include "chat/real-time-text-chat-room-p.h"
#include "content/content-type.h"
#include "c-wrapper/c-tools.h"
#include "chat/chat-message.h"
#include "chat/chat-message-p.h"
// =============================================================================
@ -626,9 +622,9 @@ LinphoneChatMessageCbs *linphone_chat_message_get_callbacks(const LinphoneChatMe
}
static bool_t file_transfer_in_progress_and_valid(LinphoneChatMessage* msg) {
return (linphone_chat_message_get_chat_room(msg) &&
linphone_chat_room_get_core(linphone_chat_message_get_chat_room(msg)) &&
linphone_chat_message_get_http_request(msg) &&
return (linphone_chat_message_get_chat_room(msg) &&
linphone_chat_room_get_core(linphone_chat_message_get_chat_room(msg)) &&
linphone_chat_message_get_http_request(msg) &&
!belle_http_request_is_cancelled(linphone_chat_message_get_http_request(msg)));
}

View file

@ -18,8 +18,7 @@
#include "linphone/api/c-chat-room-cbs.h"
// TODO: Remove me later.
#include "private.h"
#include "c-wrapper/c-wrapper.h"
// =============================================================================

View file

@ -16,19 +16,15 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "linphone/chat.h"
#include "linphone/wrapper_utils.h"
// TODO: Remove me later.
#include "private.h"
#include "linphone/chat.h"
#include "c-wrapper/c-tools.h"
#include "linphone/api/c-chat-room.h"
#include "c-wrapper/c-wrapper.h"
#include "chat/basic-chat-room.h"
#include "chat/chat-room-p.h"
#include "chat/chat-room.h"
#include "chat/client-group-chat-room.h"
#include "chat/real-time-text-chat-room-p.h"
#include "chat/real-time-text-chat-room.h"
// =============================================================================
@ -37,8 +33,6 @@
using namespace std;
extern LinphoneParticipant *_linphone_Participant_init ();
static void _linphone_chat_room_constructor (LinphoneChatRoom *cr);
static void _linphone_chat_room_destructor (LinphoneChatRoom *cr);

View file

@ -19,7 +19,7 @@
#include "linphone/api/c-chat-message.h"
#include "linphone/api/c-event-log.h"
#include "c-wrapper/c-tools.h"
#include "c-wrapper/c-wrapper.h"
#include "call/call.h"
#include "chat/chat-message.h"
#include "event-log/call-event.h"
@ -73,9 +73,6 @@ LinphoneCallEvent *linphone_call_event_new (LinphoneEventLogType type, LinphoneC
return call_event;
}
// TODO: REMOVE ME.
extern LinphoneCall *_linphone_Call_init ();
LinphoneCall *linphone_call_event_get_call (const LinphoneCallEvent *call_event) {
return L_GET_C_BACK_PTR(
L_GET_CPP_PTR_FROM_C_STRUCT(
@ -137,9 +134,6 @@ LinphoneChatMessageEvent *linphone_chat_message_event_new (LinphoneChatMessage *
return chat_message_event;
}
// TODO: REMOVE ME.
extern LinphoneChatMessage *_linphone_ChatMessage_init ();
LinphoneChatMessage *linphone_chat_message_event_get_chat_message (const LinphoneChatMessageEvent *chat_message_event) {
return L_GET_C_BACK_PTR(
L_GET_CPP_PTR_FROM_C_STRUCT(

View file

@ -18,7 +18,7 @@
#include "linphone/api/c-participant.h"
#include "c-wrapper/c-tools.h"
#include "c-wrapper/c-wrapper.h"
#include "conference/participant.h"
// =============================================================================

38
src/c-wrapper/c-wrapper.h Normal file
View file

@ -0,0 +1,38 @@
/*
* c-wrapper.h
* Copyright (C) 2017 Belledonne Communications SARL
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _C_WRAPPER_H_
#define _C_WRAPPER_H_
#include "linphone/api/c-types.h"
#include "internal/c-tools.h"
// =============================================================================
#define L_REGISTER_TYPE(C_TYPE) \
extern Linphone ## C_TYPE *_linphone_ ## C_TYPE ## _init ();
// =============================================================================
L_REGISTER_TYPE(Call);
L_REGISTER_TYPE(ChatMessage);
L_REGISTER_TYPE(ChatRoom);
L_REGISTER_TYPE(Participant);
#endif // ifndef _C_WRAPPER_H_

View file

@ -1,5 +1,5 @@
/*
* c-tools.h
* c-wrapper.h
* Copyright (C) 2017 Belledonne Communications SARL
*
* This program is free software: you can redistribute it and/or modify

View file

@ -18,10 +18,10 @@
#include <algorithm>
#include "linphone/api/c-chat-message.h"
#include "linphone/utils/utils.h"
#include "linphone/api/c-chat-message.h"
#include "c-wrapper/c-tools.h"
#include "c-wrapper/c-wrapper.h"
#include "chat-room-p.h"
#include "content/content-type.h"
#include "imdn.h"
@ -29,7 +29,6 @@
#include "chat-room.h"
extern LinphoneChatRoom * _linphone_ChatRoom_init();
#define GET_BACK_PTR(object) L_GET_C_BACK_PTR(object->shared_from_this(), ChatRoom)
// =============================================================================

View file

@ -17,15 +17,12 @@
*/
#include "client-group-chat-room-p.h"
#include "c-wrapper/c-tools.h"
#include "c-wrapper/c-wrapper.h"
#include "conference/participant-p.h"
#include "logger/logger.h"
// =============================================================================
extern LinphoneChatRoom * _linphone_ChatRoom_init();
extern LinphoneParticipant * _linphone_Participant_init();
using namespace std;
LINPHONE_BEGIN_NAMESPACE

View file

@ -21,10 +21,9 @@
#include "linphone/utils/utils.h"
#include "real-time-text-chat-room-p.h"
#include "c-wrapper/c-tools.h"
#include "c-wrapper/c-wrapper.h"
#include "logger/logger.h"
extern LinphoneChatRoom * _linphone_ChatRoom_init();
#define GET_BACK_PTR(object) L_GET_C_BACK_PTR(object->shared_from_this(), ChatRoom)
// =============================================================================

View file

@ -18,7 +18,7 @@
#include <bctoolbox/defs.h>
#include "c-wrapper/c-tools.h"
#include "c-wrapper/c-wrapper.h"
#include "address/address-p.h"
#include "conference/session/call-session-p.h"

View file

@ -20,7 +20,7 @@
#include <math.h>
#include "address/address-p.h"
#include "c-wrapper/c-tools.h"
#include "c-wrapper/c-wrapper.h"
#include "conference/session/media-session-p.h"
#include "call/call-p.h"
#include "conference/participant-p.h"