| 1 | /* classes: h_files */ |
| 2 | |
| 3 | /* Macros for snarfing initialization actions from C source. */ |
| 4 | |
| 5 | #ifndef LIBGUILE_SNARF_H |
| 6 | #define LIBGUILE_SNARF_H |
| 7 | |
| 8 | /* Copyright (C) 1995,1996 Free Software Foundation, Inc. |
| 9 | * |
| 10 | * This program is free software; you can redistribute it and/or modify |
| 11 | * it under the terms of the GNU General Public License as published by |
| 12 | * the Free Software Foundation; either version 2, or (at your option) |
| 13 | * any later version. |
| 14 | * |
| 15 | * This program is distributed in the hope that it will be useful, |
| 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 18 | * GNU General Public License for more details. |
| 19 | * |
| 20 | * You should have received a copy of the GNU General Public License |
| 21 | * along with this software; see the file COPYING. If not, write to |
| 22 | * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. |
| 23 | * |
| 24 | * As a special exception, the Free Software Foundation gives permission |
| 25 | * for additional uses of the text contained in its release of GUILE. |
| 26 | * |
| 27 | * The exception is that, if you link the GUILE library with other files |
| 28 | * to produce an executable, this does not by itself cause the |
| 29 | * resulting executable to be covered by the GNU General Public License. |
| 30 | * Your use of that executable is in no way restricted on account of |
| 31 | * linking the GUILE library code into it. |
| 32 | * |
| 33 | * This exception does not however invalidate any other reasons why |
| 34 | * the executable file might be covered by the GNU General Public License. |
| 35 | * |
| 36 | * This exception applies only to the code released by the |
| 37 | * Free Software Foundation under the name GUILE. If you copy |
| 38 | * code from other Free Software Foundation releases into a copy of |
| 39 | * GUILE, as the General Public License permits, the exception does |
| 40 | * not apply to the code that you add in this way. To avoid misleading |
| 41 | * anyone as to the status of such modified files, you must delete |
| 42 | * this exception notice from them. |
| 43 | * |
| 44 | * If you write modifications of your own for GUILE, it is your choice |
| 45 | * whether to permit this exception to apply to your modifications. |
| 46 | * If you do not wish that, delete this exception notice. */ |
| 47 | \f |
| 48 | |
| 49 | #ifndef SCM_MAGIC_SNARFER |
| 50 | #define SCM_PROC(RANAME, STR, REQ, OPT, VAR, CFN) \ |
| 51 | static char RANAME[]=STR |
| 52 | #define SCM_PROC1(RANAME, STR, TYPE, CFN) \ |
| 53 | static char RANAME[]=STR |
| 54 | #else |
| 55 | #ifdef __cplusplus |
| 56 | #define SCM_PROC(RANAME, STR, REQ, OPT, VAR, CFN) \ |
| 57 | %%% scm_make_gsubr (RANAME, REQ, OPT, VAR, (SCM (*) (...)) CFN) |
| 58 | #define SCM_PROC1(RANAME, STR, TYPE, CFN) \ |
| 59 | %%% scm_make_subr(RANAME, TYPE, (SCM (*)(...)) CFN) |
| 60 | #else /* not __cplusplus */ |
| 61 | #define SCM_PROC(RANAME, STR, REQ, OPT, VAR, CFN) \ |
| 62 | %%% scm_make_gsubr (RANAME, REQ, OPT, VAR, CFN) |
| 63 | #define SCM_PROC1(RANAME, STR, TYPE, CFN) \ |
| 64 | %%% scm_make_subr(RANAME, TYPE, CFN) |
| 65 | #endif /* not __cplusplus */ |
| 66 | #endif |
| 67 | |
| 68 | #ifndef SCM_MAGIC_SNARFER |
| 69 | #define SCM_SYMBOL(c_name, scheme_name) \ |
| 70 | static SCM c_name = SCM_BOOL_F |
| 71 | #else |
| 72 | #define SCM_SYMBOL(C_NAME, SCHEME_NAME) \ |
| 73 | %%% C_NAME = scm_permanent_object (SCM_CAR (scm_intern0 (SCHEME_NAME))) |
| 74 | #endif |
| 75 | |
| 76 | |
| 77 | #ifndef SCM_MAGIC_SNARFER |
| 78 | #define SCM_GLOBAL(c_name, scheme_name) \ |
| 79 | static SCM c_name = SCM_BOOL_F |
| 80 | #else |
| 81 | #define SCM_GLOBAL(C_NAME, SCHEME_NAME) \ |
| 82 | %%% C_NAME = scm_permanent_object (scm_intern0 (SCHEME_NAME)); SCM_SETCDR (C_NAME, SCM_BOOL_F) |
| 83 | #endif |
| 84 | |
| 85 | |
| 86 | #ifndef SCM_MAGIC_SNARFER |
| 87 | #define SCM_CONST_LONG(C_NAME, SCHEME_NAME,VALUE) \ |
| 88 | static SCM C_NAME = SCM_BOOL_F |
| 89 | #else |
| 90 | #define SCM_CONST_LONG(C_NAME, SCHEME_NAME,VALUE) \ |
| 91 | %%% C_NAME = scm_permanent_object (scm_intern0 (SCHEME_NAME)); SCM_SETCDR (C_NAME, scm_long2num (VALUE)) |
| 92 | #endif |
| 93 | |
| 94 | #endif /* LIBGUILE_SNARF_H */ |