-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[addons][filesystem][base] add some new functions, improvement, cleanups and doc rework #17813
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just missing GetCookies() ;)
*numValues = values.size(); | ||
char **ret = static_cast<char**>(malloc(sizeof(char*)*values.size())); | ||
char** ret = static_cast<char**>(malloc(sizeof(char*) * values.size())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another opportunity for new
? I saw you made such a change above, just wondering
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense to use new
, place there was come by clang cleanup and overseen it.
Must only learn how is on **
memory :-).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is then char** ret = new char*[size];
for there, but can't used as his counterpart use free()
Here: https://github.com/xbmc/xbmc/blob/master/xbmc/addons/interfaces/AddonBase.cpp#L455-L465
|
||
static bool file_exists(void* kodiBase, const char* filename, bool useCache); | ||
static int stat_file(void* kodiBase, const char* filename, struct __stat64* buffer); | ||
static bool stat_file(void* kodiBase, const char* filename, struct STAT_STRUCTURE* buffer); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there another opportunity to change a stat's int
return type to bool
? I saw a comparison of a Stat()
function against 0
above. Just wondering.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
About them I change it complete, as void*
is bad for other languages 😄.
Make it now with them:
bool (*io_control_seek_possible)(void* kodiBase, void* file);
bool (*io_control_get_cache_status)(void* kodiBase, void* file, struct VFS_IOCTRL_CACHE_STATUS_DATA* status);
bool (*io_control_set_cache_rate)(void* kodiBase, void* file, unsigned int rate);
bool (*io_control_set_retry)(void* kodiBase, void* file, bool retry);
No problems jump out at me |
a7d1f18
to
8c5e819
Compare
Is updated and also now include some base addon parts with cleanups. As with the first parts must every addon updated, makes it sense to include also the other where need the same. |
9ffe597
to
77a619d
Compare
…nst C_STRUCT*() const" This added to allow in another class where use CStructHdl to get this from his values.
This thought to inform related addon that a instance becomes destroyed.
68ba708
to
0427163
Compare
Addon builds was all correct https://jenkins.kodi.tv/job/BuildMultiWithAddons-PR/64/, test patch becomes now removed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please follow the current code guidelines.
This add a new interface function where the addon can ask about version in Kodi. Thought to hold easier for checks in other places of headers. Further as by this request, an increase of all versions needed, are the exported "C" functions updated and no more needed removed.
0427163
to
e07ffb5
Compare
This thought for cases as another addon (e.g. PVR) need a special inputstream addon.
There was wrongly the "!" missing and always has broken the open.
As this changes related to all places here increase of all. Thats also why request heavier to make addon updates for all only one time.
e07ffb5
to
87999a1
Compare
Jenkins build this please |
Jenkins build this please There need jenkins a fix 😒 😺, a lot of times fails WIN32 or WIN64 with
Lets try again 😏 |
Jenkins build this please |
1 similar comment
Jenkins build this please |
The addon update round can begin. |
[addons][filesystem][base] add some new functions, improvement, cleanups and doc rework
@ksooo unmerged DigitalDevices/pvr.octonet#42 breaks the pipeline ;) |
[addons][filesystem][base] add some new functions, improvement, cleanups and doc rework
[addons][filesystem][base] add some new functions, improvement, cleanups and doc rework
[addons][filesystem][base] add some new functions, improvement, cleanups and doc rework
[addons][filesystem][base] add some new functions, improvement, cleanups and doc rework
[addons][filesystem][base] add some new functions, improvement, cleanups and doc rework
[addons][filesystem][base] add some new functions, improvement, cleanups and doc rework
[addons][filesystem][base] add some new functions, improvement, cleanups and doc rework
[addons][filesystem][base] add some new functions, improvement, cleanups and doc rework
[addons][filesystem][base] add some new functions, improvement, cleanups and doc rework
[addons][filesystem][base] add some new functions, improvement, cleanups and doc rework
Description
This request was primary thought to update the filesystem parts, but as mostly all addons use them, need also all a update.
For this reason is the request a bit extended to add also other parts, where also related to all addons and to reduce the extreme big update rounds on all 100 addons.
This additional added parts are mostly minor things where not breaks the operation (related to working ways on addon itself).
Also some things why it looks bigger are clang cleanups on the headers and separation to extra "C" files.
Some parts added related to inpustream addons, then fixes about #17514, make the doxygen a bit cleaner.
Docs visible here:
Commit 1:
[addons][filesystem] add function IsOpen to CFile
This thought to allow other place a check that related file
was really opened.
Commit 2:
[addons][filesystem] replace __stat64 with STAT_STRUCTURE
This done to have it more OS independent, before was about time in
not complete compatible between.
Commit 3:
[addons][filesystem] make interface "C" conform
Before was it not in correct "C" ABI between Kodi and Addon.
This add #ifdef about and change some parts on "C" side to allow
compile there.
Commit 4:
[addons][filesystem] cleanup namespace kodi::addon use
before was on every place this where makes the lines very long,
this change it to "using namespace kodi::addon" everywhere, where
reduce the size.
Commit 5:
[addons][filesystem] clang code cleanup
this cleanup the parts to match his style
Commit 6:
[addons][filesystem] cleanup documentation
This makes it cleaner and easier on review. Further are the parts
placed in groups.
Commit 7:
[addons][filesystem] add IoControl functions
Following are added:
Commit 8:
[addons][filesystem] add some functions to check file path relate to web
Following functions are added:
Commit 9:
[addons][filesystem] separate "C" and "C++" parts of headers
By them becomes the "C" part placed in own header to see better what language
is where and to make easier for other languages.
Commit 10:
[addons][filesystem] add more functions to get web content
Following are added:
Commit 11:
[addons[filesystem] add translator for file read bits
This also add ADDON_ on begin on addon flags.
There three reasons about them:
Commit 12:
[addons][filesystem] add #undef for CreateDirectory and DeleteFile
There about is on Windows macros where bring in this header conflict.
This undefine it and allow the use within kodi::vfs system.
Commit 13:
[addons][network] remove use of KODI_HANDLE on <kodi/c-api/network.h>
This allow then also remove use of #include "AddonBase.h" there and
make "C" API checks more easy and prevent not needed compile parts.
Commit 14:
[addons][base] fix possible memory overrun on kodi::Log(...) call
There was before "vsprintf" used, this now changed to "vsnprintf", where
his available array size is given to him.
Commit 15:
[addons][base] rename ADDON_LOG_... to LOG_... and combine with PVR
This remove the old and rename the new with remove of ADDON_ at begin.
Commit 16:
[addons][base] add documentation about "kodi::Log(...)" function
Commit 17:
[addons][base] move all "C" define's from AddonBase.h to addon_base.h
This moves it from C++ header to new added right "C" header.
Commit 18:
[addons][base] move ADDON_STATUS from AddonBase.h to addon_base.h
Also here it is to see as a "C" part, where better on this header.
Commit 19:
[addons] use "clang format off" on dependency check place in versions.h
The main reason, because cmake uses this area in this form to perform its
addon dependency check.
Commit 20:
[addons][base] don't pass C++ part inside AddonGlobalInterface
This change the class inserted there to KODI_HANDLE where mean void*.
Before with C++ class inside them it was not usable on "C" alone and
also not match a ABI guideline where only be "C" between two independent
parts.
Commit 21:
[addons][base] separate now all C parts complete to addon_base.h
Commit 22:
[addons][base] clang and sort cleanups on AddonBase.h
This change his code to match complete the clang design.
Commit 23:
[addons] add
const C_STRUCT* GetCStructure() const
andoperator const C_STRUCT*() const
This added to allow in another class where use CStructHdl to get this from his values.
Commit 24:
[addons] add DestroyInstance function to addon base class
This thought to inform related addon that a instance becomes
destroyed.
Commit 25:
[addons][general] add function to check another addon is available
This thought for cases as another addon (e.g. PVR) need a special
inputstream addon.
Commit 26:
[addons] allow ask about Kodi's used addon type version and cleanup Dll
This add a new interface function where the addon can ask about version
in Kodi. Thought to hold easier for checks in other places of headers.
Further as by this request, an increase of all versions needed, are the exported
"C" functions updated and no more needed removed.
Commit 27:
[addons] fix open of addon settings dialog via addon
There was wrongly the "!" missing and always has broken the open.
Commit 28:
[addons] increase binary API versions
Motivation and Context
How Has This Been Tested?
All available addons created and nearly all runtime tested, where was OK on run.
Further one screensaver extended to call mostly all interface functions for tests.
Screenshots (if appropriate):
Types of change
Checklist: