From bfe19b466fbad8a434d68078cecc36dad9b53679 Mon Sep 17 00:00:00 2001 From: Mikael Djurfeldt Date: Fri, 7 Jan 2000 00:29:28 +0000 Subject: * snarf.h (SCM_INSITU, SCM_INIT): New snarf macros for use in user snarf macro definitions. --- libguile/snarf.h | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'libguile/snarf.h') diff --git a/libguile/snarf.h b/libguile/snarf.h index 6bbaa49d9..87bb9f45e 100644 --- a/libguile/snarf.h +++ b/libguile/snarf.h @@ -5,7 +5,7 @@ #ifndef LIBGUILE_SNARF_H #define LIBGUILE_SNARF_H -/* Copyright (C) 1995,1996,1997,1998, 1999 Free Software Foundation, Inc. +/* Copyright (C) 1995-2000 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -51,6 +51,24 @@ +/* Generic macros to be used in user macro definitions. + * + * For example, the SCM_PROC macro could have been defined by the user: + * + * #define SCM_PROC(RANAME, STR, REQ, OPT, VAR, CFN) \ + * SCM_INSITU (static const char RANAME[]=STR) \ + * SCM_INIT (scm_make_gsubr (RANAME, REQ, OPT, VAR, (SCM (*)(...)) CFN)) + */ + +#ifndef SCM_MAGIC_SNARFER +# define SCM_INSITU(X) X +# define SCM_INIT(X) +#else +# define SCM_INSITU(X) +# define SCM_INIT(X) \ +%%% X +#endif + #ifndef SCM_MAGIC_SNARFER #define SCM_DEFINE(FNAME, PRIMNAME, REQ, OPT, VAR, ARGLIST, DOCSTRING) \ -- cgit v1.2.1