/* * types.cpp * 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 . */ #include #include // From coreapi. #include "private.h" // Must be included before cpp headers. #include "c-types.h" #include "event-log/event-log.h" // ================================================================²============= using namespace std; extern "C" { #define L_DECLARE_C_STRUCT_IMPL(STRUCT) \ struct _Linphone ## STRUCT { \ belle_sip_object_t base; \ shared_ptr cppPtr; \ }; \ static void _linphone_ ## STRUCT ## _uninit(Linphone ## STRUCT * object) { \ object->cppPtr.reset(); \ object->cppPtr->~STRUCT (); \ } \ static void _linphone_ ## STRUCT ## _clone(Linphone ## STRUCT * dest, const Linphone ## STRUCT * src) { \ new(&dest->cppPtr) shared_ptr(); \ dest->cppPtr = make_shared(*src->cppPtr.get()); \ } \ BELLE_SIP_DECLARE_VPTR_NO_EXPORT(Linphone ## STRUCT); \ BELLE_SIP_DECLARE_NO_IMPLEMENTED_INTERFACES(Linphone ## STRUCT); \ BELLE_SIP_INSTANCIATE_VPTR(Linphone ## STRUCT, belle_sip_object_t, \ _linphone_ ## STRUCT ## _uninit, \ _linphone_ ## STRUCT ## _clone, \ NULL, \ FALSE \ ); // ----------------------------------------------------------------------------- L_DECLARE_C_STRUCT_IMPL(EventLog); LinphoneEventLog *event_log_new () { return nullptr; } LinphoneEventLogType event_log_get_type (const LinphoneEventLog *eventLog) { return LinphoneEventLogType::NoneEvent; } }