/* * (c) Copyright 2016 Olliver Schinagl * Author: Olliver Schinagl * * SPDX-License-Identifier: AGPL-3.0+ */ #ifdef HAVE_CONFIG_H # include "config.h" #endif #include #include #include "engagement.h" #include "engagement_private.h" static int _engagement_init = 0; int _engagement_lib_log_dom = -1; EAPI int engagement_init(void) { _engagement_init++; if (_engagement_init > 1) return _engagement_init; eina_init(); _engagement_lib_log_dom = eina_log_domain_register("engagement", EINA_COLOR_CYAN); if (_engagement_lib_log_dom < 0) { EINA_LOG_ERR("Engagement can not create its log domain."); goto shutdown_eina; } // Put here your initialization logic of your library eina_log_timing(_engagement_lib_log_dom, EINA_LOG_STATE_STOP, EINA_LOG_STATE_INIT); return _engagement_init; shutdown_eina: eina_shutdown(); _engagement_init--; return _engagement_init; } EAPI int engagement_shutdown(void) { _engagement_init--; if (_engagement_init != 0) return _engagement_init; eina_log_timing(_engagement_lib_log_dom, EINA_LOG_STATE_START, EINA_LOG_STATE_SHUTDOWN); // Put here your shutdown logic eina_log_domain_unregister(_engagement_lib_log_dom); _engagement_lib_log_dom = -1; eina_shutdown(); return _engagement_init; } EAPI void engagement_library_call(void) { struct plugin *plugin; INF("Not really doing anything useful."); /* XXX just added these functions to test the libray stuff */ plugin = plugin_load("src/plugins/.libs/libcalendar_ical.so"); if (!plugin) { fprintf(stderr, "Unable to load plugin\n"); return; } plugin_unload(plugin); }