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