 |
Kodi Development
19.0
for Binary and Script based Add-Ons
|
|
11 #ifndef C_API_ADDON_BASE_H
12 #define C_API_ADDON_BASE_H
17 #ifndef TARGET_WINDOWS
26 #undef ATTRIBUTE_PACKED
27 #undef PRAGMA_PACK_BEGIN
28 #undef PRAGMA_PACK_END
31 #define ATTRIBUTE_PACKED __attribute__((packed))
33 #define ATTRIBUTE_HIDDEN __attribute__((visibility("hidden")))
36 #if !defined(ATTRIBUTE_PACKED)
37 #define ATTRIBUTE_PACKED
41 #if !defined(ATTRIBUTE_HIDDEN)
42 #define ATTRIBUTE_HIDDEN
46 #define ATTRIBUTE_FORCEINLINE __forceinline
47 #elif defined(__GNUC__)
48 #define ATTRIBUTE_FORCEINLINE inline __attribute__((__always_inline__))
49 #elif defined(__CLANG__)
50 #if __has_attribute(__always_inline__)
51 #define ATTRIBUTE_FORCEINLINE inline __attribute__((__always_inline__))
53 #define ATTRIBUTE_FORCEINLINE inline
56 #define ATTRIBUTE_FORCEINLINE inline
60 #define ADDON_HARDWARE_CONTEXT void*
65 #define ADDON_STANDARD_STRING_LENGTH 1024
66 #define ADDON_STANDARD_STRING_LENGTH_SMALL 256
101 ADDON_STATUS_NOT_IMPLEMENTED
145 typedef void* KODI_HANDLE;
171 KODI_HANDLE kodiBase;
174 char* (*get_type_version)(
void* kodiBase,
int type);
176 void (*free_string)(
void* kodiBase,
char* str);
177 void (*free_string_array)(
void* kodiBase,
char** arr,
int numElements);
178 char* (*get_addon_path)(
void* kodiBase);
179 char* (*get_base_user_path)(
void* kodiBase);
180 void (*addon_log_msg)(
void* kodiBase,
const int loglevel,
const char* msg);
182 bool (*get_setting_bool)(
void* kodiBase,
const char* id,
bool* value);
183 bool (*get_setting_int)(
void* kodiBase,
const char* id,
int* value);
184 bool (*get_setting_float)(
void* kodiBase,
const char* id,
float* value);
185 bool (*get_setting_string)(
void* kodiBase,
const char* id,
char** value);
187 bool (*set_setting_bool)(
void* kodiBase,
const char* id,
bool value);
188 bool (*set_setting_int)(
void* kodiBase,
const char* id,
int value);
189 bool (*set_setting_float)(
void* kodiBase,
const char* id,
float value);
190 bool (*set_setting_string)(
void* kodiBase,
const char* id,
const char* value);
192 void* (*get_interface)(
void* kodiBase,
const char* name,
const char* version);
201 bool (*is_setting_using_default)(
void* kodiBase,
const char* id);
213 const char* instanceID,
214 KODI_HANDLE instance,
216 KODI_HANDLE* addonInstance,
218 void (*destroy_instance)(
int instanceType, KODI_HANDLE instance);
219 ADDON_STATUS (*set_setting)(
const char* settingName,
const void* settingValue);
230 const char* libBasePath;
233 const char* kodi_base_api_version;
237 KODI_HANDLE firstKodiInstance;
241 KODI_HANDLE addonBase;
245 KODI_HANDLE globalSingleInstance;
@ ADDON_LOG_INFO
1 : To include information messages in the log file.
Definition: addon_base.h:129
Main structure passed from kodi to addon with basic information needed to create add-on.
Definition: addon_base.h:227
@ ADDON_LOG_DEBUG
0 : To include debug information in the log file.
Definition: addon_base.h:126
Definition: addon_base.h:168
@ ADDON_LOG_WARNING
2 : To write warnings in the log file.
Definition: addon_base.h:132
@ ADDON_LOG_FATAL
4 : To notify fatal unrecoverable errors, which can may also indicate upcoming crashes.
Definition: addon_base.h:139
Function tables from Kodi to addon.
Definition: addon_base.h:208
@ ADDON_STATUS_LOST_CONNECTION
A needed connection was lost.
Definition: addon_base.h:85
@ ADDON_STATUS_PERMANENT_FAILURE
Permanent failure, like failing to resolve methods.
Definition: addon_base.h:97
Handle used to return data from the PVR add-on to CPVRClient.
Definition: addon_base.h:151
Definition: filesystem.h:249
void * dataAddress
Definition: addon_base.h:153
void * callerAddress
Definition: addon_base.h:152
@ ADDON_LOG_ERROR
3 : To report error messages in the log file.
Definition: addon_base.h:135
ADDON_STATUS
Return value of functions in kodi::addon::CAddonBase and associated classes.
Definition: addon_base.h:80
@ ADDON_STATUS_NEED_RESTART
Addon needs a restart inside Kodi.
Definition: addon_base.h:88
AddonLog
Definition: addon_base.h:124
@ ADDON_STATUS_NEED_SETTINGS
Necessary settings are not yet set.
Definition: addon_base.h:91
@ ADDON_STATUS_OK
For everything OK and no error.
Definition: addon_base.h:82
Definition: audio_engine.h:269
int dataIdentifier
Definition: addon_base.h:154
Definition: definitions.h:54
@ ADDON_STATUS_UNKNOWN
Unknown and incomprehensible error.
Definition: addon_base.h:94