Use prop_array_add() istead of prop_array_set()
[eleutheria.git] / proplib / prop1.c
blobf094883fac985546f37e0f4a1b768d004e6e7005
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include <prop/proplib.h>
5 int main(int argc, char *argv[])
7 prop_array_t pa;
8 int i;
10 /* Create array object */
11 pa = prop_array_create();
13 /* For every argument, create a reference to it
14 * and store it in the array
16 for (i = 0; i < argc; i++)
17 prop_array_add(pa, prop_string_create_cstring_nocopy(argv[i]));
19 /* Export array contents to file as XML */
20 prop_array_externalize_to_file(pa, "./data.xml");
22 /* Release array object */
23 prop_object_release(pa);
25 return EXIT_SUCCESS;