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 /src/grecs.h | |
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 'src/grecs.h')
-rw-r--r-- | src/grecs.h | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/grecs.h b/src/grecs.h index ca98329..ff8671c 100644 --- a/src/grecs.h +++ b/src/grecs.h @@ -93,13 +93,11 @@ enum grecs_data_type { grecs_type_section }; -#define GRECS_AGGR 0x1000 -#define GRECS_MULT 0x2000 -#define GRECS_INAC 0x4000 -#define GRECS_LIST 0x8000 -#define GRECS_TYPE_MASK 0x00ff -#define GRECS_TYPE(c) ((c) & GRECS_TYPE_MASK) -#define GRECS_IS_LIST(c) ((c) & GRECS_LIST) +#define GRECS_DFLT 0x00 +#define GRECS_AGGR 0x01 +#define GRECS_MULT 0x02 +#define GRECS_INAC 0x04 +#define GRECS_LIST 0x08 enum grecs_callback_command { grecs_callback_section_begin, @@ -174,6 +172,7 @@ struct grecs_keyword { const char *argname; const char *docstring; enum grecs_data_type type; + int flags; void *varptr; size_t offset; grecs_callback_fn callback; |