44 present_option = example_option_from(
45 (
struct example_data){.value = 42, .description = strdup(
"A present option")});
47 DC_SCOPED(example_option) empty_option = example_option_empty();
50 fprintf(stdout,
"\n");
52 fprintf(stdout,
"\n");
54 DC_ASSERT(example_option_is_present(&present_option));
55 DC_ASSERT(!example_option_is_present(&empty_option));
57 struct example_data const* present_data = example_option_get_const(&present_option);
62 struct example_data const* empty_data = example_option_get_const(&empty_option);
65 bool was_present = example_option_replace(
67 (
struct example_data){.value = 100, .description = strdup(
"Replaced value")});
69 DC_ASSERT(example_option_is_present(&empty_option));
71 struct example_data const* replaced_data = example_option_get_const(&empty_option);