libimobiledevice / libplist

A library to handle Apple Property List format in binary or XML
https://libimobiledevice.org
GNU Lesser General Public License v2.1
528 stars 304 forks source link

please dont change the API as you again did in latest release. #260

Closed fduncanh closed 2 months ago

fduncanh commented 2 months ago

Thanks for your great work, but....

Changes Change API around PLIST_DATA to use uint8_t instead of char

Changing the API is disruptive, and should not be done on a whim to make things "cleaner"

Better to introduce a new function, and replace the previous one with a wrapper to the new version. We have to support all versions of libplist later than some quite old one (v.2.0)

I suggest:

PLIST_API void plist_get_data_val_u8(plist_t node, uint8_t **val, uint64_t * length);

// deprecated: do not use in new code:
PLIST_API void plist_get_data_val(plist_t node, char **val, uint64_t * length) 
{
    void plist_get_data_val_u8(node, (uint8_t ** ) val, * length);
}

(+ similar changes for plist_set_data_val, plist_get_data_ptr, plist_new_data )

e.g.:

https://github.com/FDH2/UxPlay/issues/294

fduncanh commented 2 months ago

is there any substitute method for plist_get_data_val compatible with both plist 2.5.0 and earlier versions?

EDIT: I switched from plist_get_data_ptr to plist_get_data_val after the API for that was changed some time ago in v 2.2.0, to maintain backward compatibility, so I guess not.

fduncanh commented 2 months ago

@nikias in case you are willing to restore compatibility with the older API, I have provided a pull request #261 to do this. Its tested.

fduncanh commented 2 months ago

I've now worked around this in the code I maintain with cmake to identify the libplist version, and then #define appropriate casts when the version >= 2.5, but it would still be a good idea to you to provide the old API functions as wrappers around renamed uint8_t functions as in PR #261. Sorry if I was grumpy.

nikias commented 2 months ago

Sorry guys I reverted the changed and released a 2.6.0

fduncanh commented 2 months ago

THANK YOU!!!