From ce9ce43efd707a85cc792ff2cc417603a53d4d1d Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Wed, 19 Apr 2023 17:49:07 +0200 Subject: Add plist_read_from_file() to interface, update plist_from_memory() 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). --- tools/plistutil.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tools') diff --git a/tools/plistutil.c b/tools/plistutil.c index e339b8b..6da53e4 100644 --- a/tools/plistutil.c +++ b/tools/plistutil.c @@ -284,7 +284,7 @@ int main(int argc, char *argv[]) } else { - input_res = plist_from_memory(plist_entire, read_size, &root_node); + input_res = plist_from_memory(plist_entire, read_size, &root_node, NULL); if (input_res == PLIST_ERR_SUCCESS) { if (options->flags & OPT_SORT) { plist_sort(root_node); -- cgit v1.1-32-gdbae