X-Git-Url: https://git.saurik.com/apple/launchd.git/blobdiff_plain/ed34e3c3e5fb80e0702ac7fb92f189862089d820..5b0a4722f2ef1eac59c9650b37b29ac8b34a160e:/launchd/testing/vproc_swap_complex.c?ds=inline diff --git a/launchd/testing/vproc_swap_complex.c b/launchd/testing/vproc_swap_complex.c new file mode 100644 index 0000000..6ff8d53 --- /dev/null +++ b/launchd/testing/vproc_swap_complex.c @@ -0,0 +1,28 @@ +#include +#include +#include +#include +#include +#include +#include + +static void my_callback(const launch_data_t obj, const char *key, void *context); + +int main(void) +{ + launch_data_t output_obj = NULL; + + assert(vproc_swap_complex(NULL, VPROC_GSK_ENVIRONMENT, NULL, &output_obj) == 0); + + assert(launch_data_get_type(output_obj) == LAUNCH_DATA_DICTIONARY); + + launch_data_dict_iterate(output_obj, my_callback, stdout); + + return 0; +} + +void +my_callback(const launch_data_t obj, const char *key, void *context) +{ + fprintf(context, "%s == %s\n", key, launch_data_get_string(obj)); +}