summaryrefslogtreecommitdiffstats
path: root/tools/plistutil.c
AgeCommit message (Collapse)AuthorFilesLines
2023-04-19Add plist_read_from_file() to interface, update plist_from_memory()Gravatar Nikias Bassen1-1/+1
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/+8
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-07Add function to interface to allow enabling/disabling error/debug output for ↵Gravatar Nikias Bassen1-0/+5
the format parses This makes the `-d` option work in plistutil that wasn't doing anything
2023-02-06plistutil: Add command line switch to allow sorting of the output plistGravatar Nikias Bassen1-6/+23
2023-01-08Add support for OpenStep plist formatGravatar Nikias Bassen1-22/+32
2022-01-31plistutil: Make sure the input buffer is 0-terminated in all code pathsGravatar Nikias Bassen1-0/+1
2021-12-23plistutil: Check return values from plist API to print proper error messagesGravatar Nikias Bassen1-14/+35
and return a meaningful exit code.
2021-12-23Add support for JSON formatGravatar Nikias Bassen1-42/+36
2021-02-06plistutil: Fix stdin input buffer reallocationGravatar Nikias Bassen1-5/+16
2021-01-25Replace malloc + memset with calloc where appropriateGravatar Rosen Penev1-2/+1
calloc is faster for big allocations. It's also simpler. Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-11-24Improve code readability by using explicit != 0 compare when using strncmpGravatar Rosen Penev1-1/+1
[clang-tidy] Found with bugprone-suspicious-string-compare Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-06-05plistutil: Update copyright headerGravatar Nikias Bassen1-2/+3
2020-06-05plistutil: Add new "--version" option to output version informationGravatar Nikias Bassen1-0/+6
2020-06-05plistutil: Fix option parsingGravatar Nikias Bassen1-8/+10
2020-06-04Unify plistutil usage output with other tools and add project URLsGravatar Martin Szulecki1-5/+10
2020-06-04Add config.h include to plistutil.cGravatar Martin Szulecki1-0/+3
2020-06-04Replace tabs with correct space indentation in plistutil.cGravatar Martin Szulecki1-10/+10
2020-05-24plistutil: Improve usage text alignmentGravatar Nikias Bassen1-4/+4
2020-05-24plistutil: Added ability to specify output formatGravatar Jaywalker1-8/+59
2020-05-24plistutil: Added ability for files to be read from stdinGravatar Jaywalker1-25/+71
2017-02-07plistutil: Print error message when opening input/output file fails and plug ↵Gravatar Nikias Bassen1-1/+7
memory leaks on error
2017-01-18plistutil: Use plist_is_binary() to check for binary plist dataGravatar Nikias Bassen1-1/+1
2017-01-18plistutil: Prevent OOB heap buffer read by checking input sizeGravatar Nikias Bassen1-0/+6
As pointed out in #87 plistutil would do a memcmp with a heap buffer without checking the size. If the size is less than 8 it would read beyond the bounds of this heap buffer. This commit prevents that.
2015-01-29plistutil: Plug some memory leaksGravatar Nikias Bassen1-2/+6
2015-01-29plistutil: Use static buffer for stat()Gravatar Nikias Bassen1-6/+4
2015-01-23plistutil: Improve error message for a human if input file reading failedGravatar Martin Szulecki1-1/+1
2015-01-23plistutil: Cleanup code style a bit and remove obsolete extra headerGravatar Martin Szulecki1-72/+78
2015-01-23Update and correct some copyright header commentsGravatar Martin Szulecki1-1/+2
2013-12-13change build system to autotoolsGravatar Nikias Bassen1-0/+164