summaryrefslogtreecommitdiffstats
path: root/xbmc/addons/kodi-addon-dev-kit/include/kodi/AddonBase.h
diff options
context:
space:
mode:
authormanuel <manuel@mausz.at>2018-04-17 00:15:38 +0200
committermanuel <manuel@mausz.at>2018-04-17 00:15:38 +0200
commitb3d195f0188758a14875a5a2f270e4fd190a679f (patch)
treecbe6a2d51afd7be095e29fd612107044cf1f391e /xbmc/addons/kodi-addon-dev-kit/include/kodi/AddonBase.h
parenta51f51db67e3eab80ac2ed28d403a6d77f7acc45 (diff)
downloadkodi-pvr-build-b3d195f0188758a14875a5a2f270e4fd190a679f.tar.gz
kodi-pvr-build-b3d195f0188758a14875a5a2f270e4fd190a679f.tar.bz2
kodi-pvr-build-b3d195f0188758a14875a5a2f270e4fd190a679f.zip
sync with upstream
Diffstat (limited to 'xbmc/addons/kodi-addon-dev-kit/include/kodi/AddonBase.h')
-rw-r--r--xbmc/addons/kodi-addon-dev-kit/include/kodi/AddonBase.h39
1 files changed, 32 insertions, 7 deletions
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/AddonBase.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/AddonBase.h
index 432a1c3..7abd8e1 100644
--- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/AddonBase.h
+++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/AddonBase.h
@@ -40,13 +40,9 @@
40#undef PRAGMA_PACK_END 40#undef PRAGMA_PACK_END
41 41
42#if defined(__GNUC__) 42#if defined(__GNUC__)
43 #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95) 43 #define ATTRIBUTE_PACKED __attribute__ ((packed))
44 #define ATTRIBUTE_PACKED __attribute__ ((packed)) 44 #define PRAGMA_PACK 0
45 #define PRAGMA_PACK 0 45 #define ATTRIBUTE_HIDDEN __attribute__ ((visibility ("hidden")))
46 #if __GNUC__ >= 4
47 #define ATTRIBUTE_HIDDEN __attribute__ ((visibility ("hidden")))
48 #endif
49 #endif
50#endif 46#endif
51 47
52#if !defined(ATTRIBUTE_PACKED) 48#if !defined(ATTRIBUTE_PACKED)
@@ -180,6 +176,8 @@ typedef struct AddonToKodiFuncTable_Addon
180 AddonToKodiFuncTable_kodi_filesystem* kodi_filesystem; 176 AddonToKodiFuncTable_kodi_filesystem* kodi_filesystem;
181 AddonToKodiFuncTable_kodi_gui* kodi_gui; 177 AddonToKodiFuncTable_kodi_gui* kodi_gui;
182 AddonToKodiFuncTable_kodi_network *kodi_network; 178 AddonToKodiFuncTable_kodi_network *kodi_network;
179
180 void* (*get_interface)(void* kodiBase, const char *name, const char *version);
183} AddonToKodiFuncTable_Addon; 181} AddonToKodiFuncTable_Addon;
184 182
185/* 183/*
@@ -605,6 +603,33 @@ inline std::string TranslateAddonStatus(ADDON_STATUS status)
605} /* namespace kodi */ 603} /* namespace kodi */
606//---------------------------------------------------------------------------- 604//----------------------------------------------------------------------------
607 605
606//==============================================================================
607namespace kodi {
608///
609/// \ingroup cpp_kodi
610/// @brief Returns a function table to a named interface
611///
612/// @return pointer to struct containing interface functions
613///
614///
615/// ------------------------------------------------------------------------
616///
617/// **Example:**
618/// ~~~~~~~~~~~~~{.cpp}
619/// #include <kodi/General.h>
620/// #include <kodi/platform/foo.h>
621/// ...
622/// FuncTable_foo *table = kodi::GetPlatformInfo(foo_name, foo_version);
623/// ...
624/// ~~~~~~~~~~~~~
625///
626inline void* GetInterface(const std::string &name, const std::string &version)
627{
628 AddonToKodiFuncTable_Addon* toKodi = ::kodi::addon::CAddonBase::m_interface->toKodi;
629
630 return toKodi->get_interface(toKodi->kodiBase, name.c_str(), version.c_str());
631}
632} /* namespace kodi */
608 633
609/*! addon creation macro 634/*! addon creation macro
610 * @todo cleanup this stupid big macro 635 * @todo cleanup this stupid big macro