diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2012-01-04 12:01:50 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2012-01-04 12:01:50 +0200 |
commit | 007b5a854a9ffbb2a5bc0b01fb50dbd54a33df42 (patch) | |
tree | b0d7aaa4ba40fde056169d1dddfd10d4fa1db264 /tests | |
parent | b74252278ec81bea7b4a295d1cd49134ef03ee7c (diff) | |
download | grecs-007b5a854a9ffbb2a5bc0b01fb50dbd54a33df42.tar.gz grecs-007b5a854a9ffbb2a5bc0b01fb50dbd54a33df42.tar.bz2 |
Separate statement type and flags.
This change is incompatible with prior versions. Grecs users will have
to add a new field to their keyword definitions. See tests/gcfset.c
for an example.
* src/grecs.h (GRECS_DFLT): New flag.
(grecs_keyword) <flags>: New member.
* src/format.c: Use flags where appropriate.
* src/tree.c: Likewise.
* tests/gcfset.c: Likewise.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/gcfset.c | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/tests/gcfset.c b/tests/gcfset.c index 484a479..9ad3a94 100644 --- a/tests/gcfset.c +++ b/tests/gcfset.c @@ -67,34 +67,36 @@ cb_logging_facility(enum grecs_callback_command cmd, static struct grecs_keyword logging_kwtab[] = { { "syslog", NULL, "Send to syslog", - grecs_type_bool, NULL, + grecs_type_bool, GRECS_DFLT, NULL, offsetof(struct logging_setup, use_syslog) }, { "facility", "name", "Set logging facility", - grecs_type_string|GRECS_AGGR, NULL, + grecs_type_string, GRECS_AGGR, NULL, offsetof(struct logging_setup, facility), cb_logging_facility }, { "tag", "label", "Tag logging messages with this string", - grecs_type_string, NULL, + grecs_type_string, GRECS_DFLT, NULL, offsetof(struct logging_setup, tag) }, { "print-priority", NULL, "Prefix each message with its priority", - grecs_type_bool, NULL, + grecs_type_bool, GRECS_DFLT, NULL, offsetof(struct logging_setup, print_priority) }, { NULL }, }; static struct grecs_keyword mailbox_kwtab[] = { { "mailbox-pattern", NULL, "Default mailbox pattern", - grecs_type_string, &mailbox_pattern }, + grecs_type_string, GRECS_DFLT, &mailbox_pattern }, { "mailbox-type", NULL, "Default mailbox type", - grecs_type_string, &mailbox_type }, + grecs_type_string, GRECS_DFLT, &mailbox_type }, { NULL }, }; static struct grecs_keyword program_kwtab[] = { { "scalar", "label", "Scalar string", - grecs_type_string, NULL, offsetof(struct program,scalar_string) }, + grecs_type_string, GRECS_DFLT, + NULL, offsetof(struct program,scalar_string) }, { "logging", NULL, N_("Configure logging logging"), - grecs_type_section, NULL, offsetof(struct program,logging_setup), + grecs_type_section, GRECS_DFLT, + NULL, offsetof(struct program,logging_setup), NULL, NULL, logging_kwtab }, { NULL } }; @@ -136,16 +138,17 @@ cb_program(enum grecs_callback_command cmd, static struct grecs_keyword main_kwtab[] = { { "scalar", "label", "Scalar string", - grecs_type_string, &scalar_string }, + grecs_type_string, GRECS_DFLT, &scalar_string }, { "logging", NULL, N_("Configure logging logging"), - grecs_type_section, &logging_setup, 0, NULL, + grecs_type_section, GRECS_DFLT, &logging_setup, 0, NULL, NULL, logging_kwtab }, { "mailbox", NULL, N_("Mailbox configuration"), - grecs_type_section, NULL, 0, NULL, NULL, mailbox_kwtab }, + grecs_type_section, GRECS_DFLT, NULL, 0, NULL, NULL, mailbox_kwtab }, { "program", "name: string", "Subprogram configuration", - grecs_type_section, NULL, 0, cb_program, NULL, program_kwtab }, + grecs_type_section, GRECS_DFLT, + NULL, 0, cb_program, NULL, program_kwtab }, { "listvar", NULL, "list variable", - grecs_type_string|GRECS_LIST, &listvar }, + grecs_type_string, GRECS_LIST, &listvar }, { NULL } }; |