summaryrefslogtreecommitdiffstats
path: root/include
AgeCommit message (Collapse)AuthorFilesLines
23 hoursWindows: Don't use dllimport; only apply dllexport to DLL objectsGravatar Nikias Bassen1-7/+1
Public headers declared the API macro as __declspec(dllimport) on Windows unless *_STATIC was defined. That made consumers reference __imp_<symbol>, which only exists in the DLL import library, so linking against the static library failed unless the consumer also defined *_STATIC. All exported symbols are functions, so dllimport is not needed: calls to plain symbols link against both the static library and the import library (via its thunks). Drop it from the public headers. On the library side, apply __declspec(dllexport) only when libtool defines DLL_EXPORT, i.e. when compiling the objects for the DLL. This keeps export directives out of the objects that go into the static library when both are built.
11 daysUse (void) for prototypes with no parametersGravatar sealsrock121-1/+1
Make them real prototypes, so projects with -Werror=strict-prototypes will not longer fail
2026-04-27Add error handling to all modification functionsGravatar Nikias Bassen1-12/+69
Convert all array/dict modification functions from void to plist_err_t return type: - plist_array_set_item: replace at index n - plist_array_append_item: append to end - plist_array_insert_item: insert at position n - plist_array_remove_item: remove item at index n - plist_array_item_remove: remove item from its array parent - plist_dict_set_item: replace or insert key/value - plist_dict_remove_item: remove key/value pair - plist_dict_merge: merge source dict into target Returns: - PLIST_ERR_SUCCESS on success - PLIST_ERR_INVALID_ARG for invalid arguments (NULL, wrong type, out of range, etc.) - PLIST_ERR_NO_MEM on memory allocation failure - PLIST_ERR_UNKNOWN on unexpected internal errors Header documentation updated with full error code semantics for each function.
2026-03-22Add OpenStep coercion support for non-OpenStep plist typesGravatar Nikias Bassen1-0/+24
- Use PLIST_OPT_COERCE option to coerce PLIST_BOOLEAN, PLIST_DATE, PLIST_UID, and PLIST_NULL to OpenStep-compatible types (1 or 0, ISO 8601 strings, integers, and 'NULL' string) - Add plist_to_openstep_with_options() function to allow passing coercion option (and others) - Update plist_write_to_string() and plist_write_to_stream() accordingly
2026-03-20Add JSON coercion support for non-JSON plist typesGravatar Calil Khalil1-0/+28
- Add PLIST_OPT_COERCE option to coerce PLIST_DATE, PLIST_DATA, and PLIST_UID to JSON-compatible types (ISO 8601 strings, Base64 strings, and integers) - Add plist_to_json_with_options() function to allow passing coercion options (and others) - Update plist_write_to_string() and plist_write_to_stream() to support coercion option - Add --coerce flag to plistutil for JSON output - Create plist2json symlink that automatically enables coercion when invoked
2026-02-12plist: make array and dict iterators opaqueGravatar Nikias Bassen1-0/+13
Introduce private iterator structs for plist_array_iter and plist_dict_iter, and fix *_next_item() to properly advance iterator state and handle malformed containers safely.
2026-01-17Prevent deep nesting of plist structures in all input/output formatsGravatar Nikias Bassen1-0/+1
Thanks to @unbengable12 for reporting. Addresses #288, #289, #290, #291, and #292.
2026-01-14Add circular reference detection to all format writersGravatar Nikias Bassen1-0/+1
Thanks to @LkkkLxy for pointing out the issue.
2025-05-13Add plist_new_unix_date, plist_get_unix_date_val, plist_set_unix_date_val ↵Gravatar Nikias Bassen2-16/+74
functions These functions work with int64_t values representing a UNIX timestamp instead of using the 'MAC epoch'. They should be used instead of plist_new_date, plist_get_date_val, and plist_set_date_val, which are now marked deprecated and might be removed in a future version of libplist.
2025-04-06C++: Data: Add const char* constructorGravatar guyingzhao1-0/+1
2025-04-06C++: Add f/Front() and b/Back() to Array to access first/last elementGravatar guyingzhao1-0/+4
2025-04-06C++: Dictionary: Update template definition for better readabilityGravatar guyingzhao1-3/+1
2025-04-06C++: Array: Add const Node& variants to Append, InsertGravatar guyingzhao1-9/+8
2025-04-06C++: Add = operator to String classGravatar Nikias Bassen1-0/+1
2025-04-06C++: Add const char* constructor to String classGravatar guyingzhao1-0/+1
2025-04-06C++: Add new Structure::FromMemory()Gravatar Nikias Bassen1-0/+2
2025-03-01C++: Add more convenience functions to the interfaceGravatar guyingzhao3-2/+16
2025-03-01C++: Fix String::GetValue memory leaking and suport assignment of const char*Gravatar guyingzhao1-0/+1
2024-05-13Revert "Change API around #PLIST_DATA to use uint8_t instead of char arrays"Gravatar Nikias Bassen2-8/+8
This reverts commit a91f5740d100414a76959714b819422ee5b2d8a8.
2024-04-18Add PLIST_DICT convenience functions for different queries/operationsGravatar Nikias Bassen1-1/+161
2024-04-14Change API around #PLIST_DATA to use uint8_t instead of char arraysGravatar Nikias Bassen2-8/+8
This makes it more obvious that it is arbitrary data and not necessarily a string value.
2024-02-21docs: Use README.md to generate mainpage with doxygenGravatar Nikias Bassen1-1/+1
Actually we are using a slightly modified one that removes the `Table of Contents` section and replaces it with the doxygen-compatible `[TOC]` to auto-generate a TOC that has working links.
2024-02-05Add a libplist_version() function to the interfaceGravatar Nikias Bassen1-0/+7
2024-01-29Fix PLIST_API definitionsGravatar Nikias Bassen1-10/+4
2023-05-20Add an explicit PLIST_FORMAT_NONE valueGravatar Nikias Bassen1-0/+1
2023-05-13Windows: Use winsock2.h instead of sys/time.h when using MSVCGravatar Nikias Bassen1-0/+4
2023-05-13Move PLIST_API to the headersGravatar Nikias Bassen1-91/+107
2023-05-05Update doxygen config and document undocumented macrosGravatar Nikias Bassen1-2/+13
2023-04-24Add a PLIST_OPT_NONE value to plist_write_options_tGravatar Nikias Bassen1-0/+1
2023-04-21Remove unnecessary const to silence compiler warningGravatar Nikias Bassen2-2/+2
2023-04-21C++: Remove deprecated Insert()Gravatar Nikias Bassen1-1/+0
2023-04-21C++: Add dictionary and array size methodGravatar Nikias Bassen2-0/+2
Thanks @Cryptiiiic for the contribution.
2023-04-19Remove deprecated plist_dict_insert_item()Gravatar Nikias Bassen1-12/+0
2023-04-19Add plist_read_from_file() to interface, update plist_from_memory()Gravatar Nikias Bassen1-2/+21
plist_read_from_file() is a convenience function that will open a given file, checks its size, allocates a buffer large enough to hold the full contents, and reads from file to fill the buffer. Then, it calls plist_from_memory() to convert the data to plist format. A (breaking) change had to be made so that plist_from_memory() will also return the parsed format in its 4th argument (if non-NULL).
2023-04-16Add new output-only formats and Define constants for the different plist formatsGravatar Nikias Bassen1-8/+91
This commit introduces constants for the different plist formats, and adds 3 new human-readable output-only formats: - PLIST_FORMAT_PRINT: the default human-readable format - PLIST_FORMAT_LIMD: "libimobiledevice" format (used in ideviceinfo) - PLIST_FORMAT_PLUTIL: plutil-style format Also, a new set of write functions has been added: - plist_write_to_string - plist_write_to_stream - plist_write_to_file Plus a simple "dump" function: - plist_print See documentation for details.
2023-02-07Fix build without --enable-debugGravatar Nikias Bassen1-0/+1
2023-02-07Add function to interface to allow enabling/disabling error/debug output for ↵Gravatar Nikias Bassen1-0/+7
the format parses This makes the `-d` option work in plistutil that wasn't doing anything
2023-02-03Add new plist_sort() functionGravatar Nikias Bassen1-0/+8
2023-02-03Add lowercase begin/end iterator functionsGravatar Daniel2-0/+8
... for Dictionary and Array
2023-02-03Add PList::Array iterator member functionsGravatar Daniel1-0/+7
... returning both iterators and const_iterators: * PList::Array::Begin() * PList::Array::End()
2023-01-16Rename PLIST_UINT to PLIST_INT and add plist_new_int() and plist_get_int_val()Gravatar Nikias Bassen2-13/+74
This properly supports getting and setting signed or unsigned integer values. Also, a new helper function plist_int_val_is_negative() was added to determine if a given #PLIST_INT node has a negative value or not. The old type PLIST_UINT is defined as a macro with the value of PLIST_INT for backwards compatibility. This commit also adds int vs. uint support to the C++ interface, and the python bindings in a hopefully useful way.
2023-01-08Add support for OpenStep plist formatGravatar Nikias Bassen1-0/+24
2022-02-07docs: Fix parameter and type names for doxygenGravatar Nikias Bassen1-8/+11
2021-12-23Add support for JSON formatGravatar Nikias Bassen1-7/+36
2021-12-22Add a return value to plist_to_* and plist_from_* functionsGravatar Nikias Bassen1-5/+19
This way it can be easier determined why an import/export operation failed instead of just having a NULL result.
2021-12-19Add support for PLIST_NULL typeGravatar Nikias Bassen1-10/+20
2021-12-19Add new plist_mem_free() functionGravatar Nikias Bassen1-14/+20
Thanks to @azerg for bringing this to my attention. Instead of having multiple (internally identical) plist_*_free() functions, this commit introduces a single plist_mem_free() that can be used to free the memory allocated by plist_to_xml(), plist_to_bin(), plist_get_key_val(), plist_get_string_val(), and plist_get_data_val(). Note: This commit REMOVES plist_to_bin_free() and plist_to_xml_free().
2021-06-22[clang-tidy] cpp: Turn reference operators to constGravatar Rosen Penev10-10/+10
Found with cppcoreguidelines-c-copy-assignment-signature Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-06-09Unfold automake variables into multiple lines for maintainabilityGravatar Martin Szulecki1-14/+15
2020-06-03c++: Fix inconsistent declarationsGravatar Rosen Penev3-4/+4
Signed-off-by: Rosen Penev <rosenp@gmail.com>