9#ifndef C_API_ADDON_BASE_H
10#define C_API_ADDON_BASE_H
30#undef ATTRIBUTE_PACKED
31#undef PRAGMA_PACK_BEGIN
35#define ATTRIBUTE_PACKED __attribute__((packed))
39#if !defined(ATTRIBUTE_PACKED)
40#define ATTRIBUTE_PACKED
48#define ATTRIBUTE_FORCEINLINE __forceinline
49#elif defined(__GNUC__)
50#define ATTRIBUTE_FORCEINLINE inline __attribute__((__always_inline__))
51#elif defined(__CLANG__)
52#if __has_attribute(__always_inline__)
53#define ATTRIBUTE_FORCEINLINE inline __attribute__((__always_inline__))
55#define ATTRIBUTE_FORCEINLINE inline
58#define ATTRIBUTE_FORCEINLINE inline
64#if defined _WIN32 || defined __CYGWIN__
65#define ATTRIBUTE_DLL_IMPORT __declspec(dllimport)
66#define ATTRIBUTE_DLL_EXPORT __declspec(dllexport)
67#define ATTRIBUTE_DLL_LOCAL
70#define ATTRIBUTE_DLL_IMPORT __attribute__ ((visibility ("default")))
71#define ATTRIBUTE_DLL_EXPORT __attribute__ ((visibility ("default")))
72#define ATTRIBUTE_DLL_LOCAL __attribute__ ((visibility ("hidden")))
74#define ATTRIBUTE_DLL_IMPORT
75#define ATTRIBUTE_DLL_EXPORT
76#define ATTRIBUTE_DLL_LOCAL
79#define ATTRIBUTE_HIDDEN ATTRIBUTE_DLL_LOCAL
83#define ADDON_HARDWARE_CONTEXT void*
88#define ADDON_STANDARD_STRING_LENGTH 1024
89#define ADDON_STANDARD_STRING_LENGTH_SMALL 256
126 ADDON_STATUS_NOT_IMPLEMENTED
170 typedef void* KODI_HANDLE;
196 KODI_HANDLE kodiBase;
199 char* (*get_type_version)(
void* kodiBase,
int type);
201 void (*free_string)(
void* kodiBase,
char* str);
202 void (*free_string_array)(
void* kodiBase,
char** arr,
int numElements);
203 char* (*get_addon_path)(
void* kodiBase);
204 char* (*get_base_user_path)(
void* kodiBase);
205 void (*addon_log_msg)(
void* kodiBase,
const int loglevel,
const char* msg);
207 bool (*get_setting_bool)(
void* kodiBase,
const char* id,
bool* value);
208 bool (*get_setting_int)(
void* kodiBase,
const char* id,
int* value);
209 bool (*get_setting_float)(
void* kodiBase,
const char* id,
float* value);
210 bool (*get_setting_string)(
void* kodiBase,
const char* id,
char** value);
212 bool (*set_setting_bool)(
void* kodiBase,
const char* id,
bool value);
213 bool (*set_setting_int)(
void* kodiBase,
const char* id,
int value);
214 bool (*set_setting_float)(
void* kodiBase,
const char* id,
float value);
215 bool (*set_setting_string)(
void* kodiBase,
const char* id,
const char* value);
217 void* (*get_interface)(
void* kodiBase,
const char* name,
const char* version);
226 bool (*is_setting_using_default)(
void* kodiBase,
const char* id);
238 const char* instanceID,
239 KODI_HANDLE instance,
241 KODI_HANDLE* addonInstance,
243 void (*destroy_instance)(
int instanceType, KODI_HANDLE instance);
244 ADDON_STATUS (*set_setting)(
const char* settingName,
const void* settingValue);
255 const char* libBasePath;
258 const char* kodi_base_api_version;
262 KODI_HANDLE firstKodiInstance;
266 KODI_HANDLE addonBase;
270 KODI_HANDLE globalSingleInstance;
AddonLog
Definition: addon_base.h:149
@ ADDON_LOG_FATAL
4 : To notify fatal unrecoverable errors, which can may also indicate upcoming crashes.
Definition: addon_base.h:164
@ ADDON_LOG_WARNING
2 : To write warnings in the log file.
Definition: addon_base.h:157
@ ADDON_LOG_INFO
1 : To include information messages in the log file.
Definition: addon_base.h:154
@ ADDON_LOG_DEBUG
0 : To include debug information in the log file.
Definition: addon_base.h:151
@ ADDON_LOG_ERROR
3 : To report error messages in the log file.
Definition: addon_base.h:160
ADDON_STATUS
Definition: addon_base.h:105
@ ADDON_STATUS_NEED_SETTINGS
Necessary settings are not yet set.
Definition: addon_base.h:116
@ ADDON_STATUS_LOST_CONNECTION
A needed connection was lost.
Definition: addon_base.h:110
@ ADDON_STATUS_OK
For everything OK and no error.
Definition: addon_base.h:107
@ ADDON_STATUS_NEED_RESTART
Addon needs a restart inside Kodi.
Definition: addon_base.h:113
@ ADDON_STATUS_UNKNOWN
Unknown and incomprehensible error.
Definition: addon_base.h:119
@ ADDON_STATUS_PERMANENT_FAILURE
Permanent failure, like failing to resolve methods.
Definition: addon_base.h:122
Handle used to return data from the PVR add-on to CPVRClient.
Definition: addon_base.h:176
int dataIdentifier
Definition: addon_base.h:179
void * dataAddress
Definition: addon_base.h:178
void * callerAddress
Definition: addon_base.h:177
Main structure passed from kodi to addon with basic information needed to create add-on.
Definition: addon_base.h:252
Definition: addon_base.h:193
Definition: audio_engine.h:267
Definition: filesystem.h:246
Definition: definitions.h:52
Function tables from Kodi to addon.
Definition: addon_base.h:233