4 #include <prop/proplib.h>
6 int main(int argc
, char *argv
[])
12 /* Create a dictionary capable of holding `argc - 1' objects */
13 pd
= prop_dictionary_create_with_capacity(argc
- 1);
15 errx(EXIT_FAILURE
, "prop_dictionary_create_with_capacity");
17 /* For every supplied argument, create a <key, symbol> pair
18 * and store it inside the dictionary
20 for (i
= 1; i
< argc
; i
++) {
21 ps
= prop_string_create_cstring_nocopy(argv
[i
]);
22 prop_dictionary_set(pd
, argv
[i
], ps
);
23 prop_object_release(ps
);
26 /* Output our property list as an XML file */
27 if (prop_dictionary_externalize_to_file(pd
, "./data.xml") == FALSE
) {
28 prop_object_release(pd
);
29 errx(EXIT_FAILURE
, "prop_dictionary_externalize_to_file");
32 prop_object_release(pd
);