diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2013-02-26 16:14:37 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2013-02-26 16:35:53 +0200 |
commit | 487e2cfa988d6c3a5232011ab83897ef23bdb88a (patch) | |
tree | 2db411004be434327162149356d9e04e84c786d8 /am | |
parent | 5596f7cdcdc1983021185c5e0900d5fcba7f3282 (diff) | |
download | grecs-487e2cfa988d6c3a5232011ab83897ef23bdb88a.tar.gz grecs-487e2cfa988d6c3a5232011ab83897ef23bdb88a.tar.bz2 |
Introduce an alternative callback function calling convention.
Depending on the tree-api option to the GRECS_SETUP macro,
the signature of callback functions changes. If the option
is supplied, a pointer to grecs_node_t is passwd to callback
functions as an argument instead of pointers to the value and
locus.
* am/grecs.m4 (GRECS_SETUP): New option tree-api.
* src/.gitignore: Add grecs.h
* src/Make.am: Build grecs.h
* src/grecs.h: Rename to src/grecs.hin
(GRECS_TREE_API): New define
(grecs_callback_fn): Provide two alternative
signatures depending on the value of GRECS_TREE_API.
All uses updated.
* src/tree.c (fake_callback): Update signature.
(grecs_process_ident)
(stmt_begin,stmt_end): Update calls to callback.
* tests/gcfset.c: Likewise.
Diffstat (limited to 'am')
-rw-r--r-- | am/grecs.m4 | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/am/grecs.m4 b/am/grecs.m4 index 36ecf8f..2787563 100644 --- a/am/grecs.m4 +++ b/am/grecs.m4 @@ -65,6 +65,9 @@ AC_DEFUN([_GRECS_SET_OPTIONS], # shared Build shared (convenience) library. # install-headers [with "shared"] Install Grecs headers to # GRECS_INCLUDE_DIR. +# tree-api Use alternative signature of callback functions, +# passing a pointer to grecs_node_t as an argument, +# instead of pointers to the value and locus. # # The pp-setup-file argument supplies the pathname of the preprocessor # setup file in the source tree. It is ignored if std-pp-setup option is @@ -171,7 +174,10 @@ AC_DEFUN([GRECS_SETUP],[ [false])) AM_CONDITIONAL([GRECS_COND_INSTALLHEADERS], _GRECS_IF_OPTION_SET([install-headers],[true],[false])) - + + AC_SUBST([GRECS_TREE_API]) + _GRECS_IF_OPTION_SET([tree-api],[GRECS_TREE_API=1],[GRECS_TREE_API=0]) + AC_SUBST([GRECS_SRCDIR],$1) AC_SUBST([GRECS_BUILD_AUX]) AC_SUBST([GRECS_INCLUDES]) |