Commit | Line | Data |
---|---|---|
19e2247d MV |
1 | /* This file contains definitions for deprecated features. When you |
2 | deprecate something, move it here when that is feasible. | |
3 | */ | |
4 | ||
5 | #ifndef SCM_DEPRECATED_H | |
6 | #define SCM_DEPRECATED_H | |
7 | ||
434f2f7a | 8 | /* Copyright (C) 2003,2004 Free Software Foundation, Inc. |
19e2247d | 9 | * |
73be1d9e MV |
10 | * This library is free software; you can redistribute it and/or |
11 | * modify it under the terms of the GNU Lesser General Public | |
12 | * License as published by the Free Software Foundation; either | |
13 | * version 2.1 of the License, or (at your option) any later version. | |
19e2247d | 14 | * |
73be1d9e | 15 | * This library is distributed in the hope that it will be useful, |
19e2247d | 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
73be1d9e MV |
17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
18 | * Lesser General Public License for more details. | |
19e2247d | 19 | * |
73be1d9e MV |
20 | * You should have received a copy of the GNU Lesser General Public |
21 | * License along with this library; if not, write to the Free Software | |
22 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
23 | */ | |
19e2247d MV |
24 | |
25 | #include "libguile/__scm.h" | |
55d30fac | 26 | #include "libguile/strings.h" |
19e2247d MV |
27 | |
28 | #if (SCM_ENABLE_DEPRECATED == 1) | |
29 | ||
f03314f9 DH |
30 | /* From tags.h: Macro checking for two tc16 types that are allocated to differ |
31 | * only in the 's'-bit. Deprecated in guile 1.7.0 on 2003-09-21. */ | |
32 | #define SCM_TYP16S(x) (0xfeff & SCM_CELL_TYPE (x)) | |
33 | ||
34 | ||
0d5e3480 DH |
35 | /* From numbers.h: Macros checking for types, but avoiding a redundant check |
36 | * for !SCM_IMP. These were deprecated in guile 1.7.0 on 2003-09-06. */ | |
37 | #define SCM_SLOPPY_INEXACTP(x) (SCM_TYP16S (x) == scm_tc16_real) | |
38 | #define SCM_SLOPPY_REALP(x) (SCM_TYP16 (x) == scm_tc16_real) | |
39 | #define SCM_SLOPPY_COMPLEXP(x) (SCM_TYP16 (x) == scm_tc16_complex) | |
40 | ||
41 | ||
d0624e39 DH |
42 | /* From eval.h: Macros for handling ilocs. These were deprecated in guile |
43 | * 1.7.0 on 2003-06-04. */ | |
44 | #define SCM_ILOC00 SCM_MAKE_ITAG8(0L, scm_tc8_iloc) | |
45 | #define SCM_IDINC (0x00100000L) | |
46 | #define SCM_IDSTMSK (-SCM_IDINC) | |
47 | ||
48 | ||
e90c3a89 DH |
49 | /* From eval.h: Error messages of the evaluator. These were deprecated in |
50 | * guile 1.7.0 on 2003-06-02. */ | |
51 | SCM_API const char scm_s_expression[]; | |
52 | SCM_API const char scm_s_test[]; | |
53 | SCM_API const char scm_s_body[]; | |
54 | SCM_API const char scm_s_bindings[]; | |
55 | SCM_API const char scm_s_variable[]; | |
56 | SCM_API const char scm_s_clauses[]; | |
57 | SCM_API const char scm_s_formals[]; | |
58 | ||
59 | ||
60 | /* From eval.h: Helper macros for evaluation and application. These were | |
61 | * deprecated in guile 1.7.0 on 2003-06-02. */ | |
62 | #define SCM_EVALIM2(x) \ | |
63 | ((SCM_EQ_P ((x), SCM_EOL) \ | |
64 | ? scm_misc_error (NULL, scm_s_expression, SCM_EOL), 0 \ | |
65 | : 0), \ | |
66 | (x)) | |
67 | #define SCM_EVALIM(x, env) (SCM_ILOCP (x) \ | |
68 | ? *scm_ilookup ((x), env) \ | |
69 | : SCM_EVALIM2(x)) | |
434f2f7a DH |
70 | #define SCM_XEVAL(x, env) (scm_i_eval_x ((x), (env))) |
71 | #define SCM_XEVALCAR(x, env) (SCM_SYMBOLP (SCM_CAR (x)) \ | |
72 | ? *scm_lookupcar (x, env, 1) \ | |
73 | : scm_i_eval_x (SCM_CAR (x), (env))) | |
e90c3a89 DH |
74 | |
75 | ||
19e2247d MV |
76 | #define scm_substring_move_left_x scm_substring_move_x |
77 | #define scm_substring_move_right_x scm_substring_move_x | |
78 | ||
55d30fac | 79 | #define scm_sizet size_t |
19e2247d | 80 | |
55d30fac | 81 | SCM_API SCM scm_wta (SCM arg, const char *pos, const char *s_subr); |
19e2247d | 82 | |
55d30fac MV |
83 | #define SCM_WNA 8 |
84 | #define SCM_OUTOFRANGE 10 | |
85 | #define SCM_NALLOC 11 | |
19e2247d | 86 | |
55d30fac MV |
87 | SCM_API void scm_register_module_xxx (char *module_name, void *init_func); |
88 | SCM_API SCM scm_registered_modules (void); | |
89 | SCM_API SCM scm_clear_registered_modules (void); | |
19e2247d | 90 | |
a0454d72 MV |
91 | SCM_API SCM scm_protect_object (SCM obj); |
92 | SCM_API SCM scm_unprotect_object (SCM obj); | |
93 | ||
94 | #define SCM_SETAND_CAR(x, y) \ | |
95 | (SCM_SETCAR ((x), SCM_PACK (SCM_UNPACK (SCM_CAR (x)) & (y)))) | |
96 | #define SCM_SETOR_CAR(x, y)\ | |
97 | (SCM_SETCAR ((x), SCM_PACK (SCM_UNPACK (SCM_CAR (x)) | (y)))) | |
98 | #define SCM_SETAND_CDR(x, y)\ | |
99 | (SCM_SETCDR ((x), SCM_PACK (SCM_UNPACK (SCM_CDR (x)) & (y)))) | |
100 | #define SCM_SETOR_CDR(x, y)\ | |
101 | (SCM_SETCDR ((x), SCM_PACK (SCM_UNPACK (SCM_CDR (x)) | (y)))) | |
102 | #define SCM_FREEP(x) (SCM_FREE_CELL_P (x)) | |
103 | #define SCM_NFREEP(x) (!SCM_FREE_CELL_P (x)) | |
7aaf8dc9 MD |
104 | #define SCM_GC8MARKP(x) SCM_GC_MARK_P (x) |
105 | #define SCM_SETGC8MARK(x) SCM_SET_GC_MARK (x) | |
106 | #define SCM_CLRGC8MARK(x) SCM_CLEAR_GC_MARK (x) | |
a0454d72 MV |
107 | #define SCM_GCTYP16(x) SCM_TYP16 (x) |
108 | #define SCM_GCCDR(x) SCM_CDR (x) | |
109 | SCM_API void scm_remember (SCM * ptr); | |
110 | ||
111 | SCM_API SCM scm_the_root_module (void); | |
112 | SCM_API SCM scm_make_module (SCM name); | |
113 | SCM_API SCM scm_ensure_user_module (SCM name); | |
114 | SCM_API SCM scm_load_scheme_module (SCM name); | |
115 | ||
116 | #define scm_port scm_t_port | |
117 | #define scm_ptob_descriptor scm_t_ptob_descriptor | |
118 | #define scm_port_rw_active scm_t_port_rw_active | |
119 | ||
120 | SCM_API SCM scm_close_all_ports_except (SCM ports); | |
121 | ||
97f28fa4 MV |
122 | #define scm_rstate scm_t_rstate |
123 | #define scm_rng scm_t_rng | |
124 | ||
125 | #define SCM_SLOPPY_CONSP(x) ((1 & SCM_CELL_TYPE (x)) == 0) | |
126 | #define SCM_SLOPPY_NCONSP(x) (!SCM_SLOPPY_CONSP(x)) | |
127 | ||
128 | #define scm_tc7_ssymbol scm_tc7_symbol | |
129 | #define scm_tc7_msymbol scm_tc7_symbol | |
130 | #define scm_tcs_symbols scm_tc7_symbol | |
131 | ||
965445d4 MV |
132 | SCM_API SCM scm_makstr (size_t len, int); |
133 | SCM_API SCM scm_makfromstr (const char *src, size_t len, int); | |
134 | ||
135 | SCM_API SCM scm_variable_set_name_hint (SCM var, SCM hint); | |
136 | SCM_API SCM scm_builtin_variable (SCM name); | |
137 | ||
138 | SCM_API SCM scm_internal_with_fluids (SCM fluids, SCM vals, | |
139 | SCM (*cproc)(void *), void *cdata); | |
140 | ||
141 | SCM_API SCM scm_make_gsubr (const char *name, int req, int opt, int rst, | |
142 | SCM (*fcn)()); | |
143 | SCM_API SCM scm_make_gsubr_with_generic (const char *name, | |
144 | int req, | |
145 | int opt, | |
146 | int rst, | |
147 | SCM (*fcn)(), | |
148 | SCM *gf); | |
149 | ||
150 | extern SCM scm_create_hook (const char* name, int n_args); | |
151 | ||
152 | #define SCM_LIST0 SCM_EOL | |
153 | #define SCM_LIST1(e0) scm_cons ((e0), SCM_EOL) | |
154 | #define SCM_LIST2(e0, e1) scm_cons2 ((e0), (e1), SCM_EOL) | |
155 | #define SCM_LIST3(e0, e1, e2) scm_cons ((e0), SCM_LIST2 ((e1), (e2))) | |
156 | #define SCM_LIST4(e0, e1, e2, e3)\ | |
157 | scm_cons2 ((e0), (e1), SCM_LIST2 ((e2), (e3))) | |
158 | #define SCM_LIST5(e0, e1, e2, e3, e4)\ | |
159 | scm_cons ((e0), SCM_LIST4 ((e1), (e2), (e3), (e4))) | |
160 | #define SCM_LIST6(e0, e1, e2, e3, e4, e5)\ | |
161 | scm_cons2 ((e0), (e1), SCM_LIST4 ((e2), (e3), (e4), (e5))) | |
162 | #define SCM_LIST7(e0, e1, e2, e3, e4, e5, e6)\ | |
163 | scm_cons ((e0), SCM_LIST6 ((e1), (e2), (e3), (e4), (e5), (e6))) | |
164 | #define SCM_LIST8(e0, e1, e2, e3, e4, e5, e6, e7)\ | |
165 | scm_cons2 ((e0), (e1), SCM_LIST6 ((e2), (e3), (e4), (e5), (e6), (e7))) | |
166 | #define SCM_LIST9(e0, e1, e2, e3, e4, e5, e6, e7, e8)\ | |
167 | scm_cons ((e0),\ | |
168 | SCM_LIST8 ((e1), (e2), (e3), (e4), (e5), (e6), (e7), (e8))) | |
169 | ||
170 | #define scm_listify scm_list_n | |
171 | ||
172 | SCM_API SCM scm_sloppy_memq (SCM x, SCM lst); | |
173 | SCM_API SCM scm_sloppy_memv (SCM x, SCM lst); | |
174 | SCM_API SCM scm_sloppy_member (SCM x, SCM lst); | |
175 | ||
176 | SCM_API SCM scm_read_and_eval_x (SCM port); | |
177 | ||
4abecea8 MV |
178 | #define scm_subr_entry scm_t_subr_entry |
179 | ||
180 | #define SCM_SUBR_DOC(x) SCM_BOOL_F | |
181 | ||
182 | SCM_API SCM scm_make_subr (const char *name, int type, SCM (*fcn) ()); | |
183 | SCM_API SCM scm_make_subr_with_generic (const char *name, | |
184 | int type, | |
185 | SCM (*fcn) (), | |
186 | SCM *gf); | |
187 | SCM_API SCM scm_make_subr_opt (const char *name, | |
188 | int type, | |
189 | SCM (*fcn) (), | |
190 | int set); | |
191 | ||
192 | SCM_API SCM scm_call_catching_errors (SCM (*thunk)(), SCM (*err_filter)(), | |
193 | void * closure); | |
194 | ||
195 | SCM_API long scm_make_smob_type_mfpe (char *name, size_t size, | |
196 | SCM (*mark) (SCM), | |
197 | size_t (*free) (SCM), | |
198 | int (*print) (SCM, SCM, | |
199 | scm_print_state*), | |
200 | SCM (*equalp) (SCM, SCM)); | |
201 | ||
202 | SCM_API void scm_set_smob_mfpe (long tc, | |
203 | SCM (*mark) (SCM), | |
204 | size_t (*free) (SCM), | |
205 | int (*print) (SCM, SCM, scm_print_state*), | |
206 | SCM (*equalp) (SCM, SCM)); | |
207 | ||
208 | SCM_API SCM scm_strprint_obj (SCM obj); | |
209 | SCM_API SCM scm_read_0str (char *expr); | |
210 | SCM_API SCM scm_eval_0str (const char *expr); | |
211 | ||
212 | SCM_API char *scm_i_object_chars (SCM); | |
213 | ||
214 | #define SCM_CHARS(x) scm_i_object_chars(x) | |
215 | #define SCM_UCHARS(x) ((unsigned char *)SCM_CHARS(x)) | |
216 | ||
217 | SCM_API long scm_i_object_length (SCM); | |
218 | ||
219 | #define SCM_LENGTH(x) scm_i_object_length(x) | |
220 | ||
cc5c1b66 MV |
221 | #define scm_strhash(str, len, n) (scm_string_hash ((str), (len)) % (n)) |
222 | ||
223 | SCM_API SCM scm_sym2ovcell_soft (SCM sym, SCM obarray); | |
224 | SCM_API SCM scm_sym2ovcell (SCM sym, SCM obarray); | |
225 | SCM_API SCM scm_intern_obarray_soft (const char *name, size_t len, | |
226 | SCM obarray, unsigned int softness); | |
227 | SCM_API SCM scm_intern_obarray (const char *name, size_t len, SCM obarray); | |
228 | SCM_API SCM scm_symbol_value0 (const char *name); | |
229 | ||
230 | SCM_API SCM scm_string_to_obarray_symbol (SCM o, SCM s, SCM softp); | |
231 | SCM_API SCM scm_intern_symbol (SCM o, SCM s); | |
232 | SCM_API SCM scm_unintern_symbol (SCM o, SCM s); | |
233 | SCM_API SCM scm_symbol_binding (SCM o, SCM s); | |
234 | #if 0 | |
235 | /* This name has been reused for real uninterned symbols. */ | |
236 | SCM_API SCM scm_symbol_interned_p (SCM o, SCM s); | |
237 | #endif | |
238 | SCM_API SCM scm_symbol_bound_p (SCM o, SCM s); | |
239 | SCM_API SCM scm_symbol_set_x (SCM o, SCM s, SCM v); | |
240 | ||
241 | SCM_API SCM scm_gentemp (SCM prefix, SCM obarray); | |
242 | ||
8de7acbd MV |
243 | #define SCM_OPDIRP(x) (SCM_DIRP (x) && (SCM_DIR_OPEN_P (x))) |
244 | #define scm_fport scm_t_fport | |
245 | #define scm_option scm_t_option | |
246 | #define scm_srcprops scm_t_srcprops | |
247 | #define scm_srcprops_chunk scm_t_srcprops_chunk | |
248 | #define scm_info_frame scm_t_info_frame | |
249 | #define scm_stack scm_t_stack | |
250 | #define scm_array scm_t_array | |
251 | #define scm_array_dim scm_t_array_dim | |
252 | #define SCM_ARRAY_CONTIGUOUS SCM_ARRAY_FLAG_CONTIGUOUS | |
253 | #define SCM_FUNC_NAME (scm_makfrom0str (FUNC_NAME)) | |
254 | ||
255 | #define SCM_WTA(pos, scm) \ | |
256 | do { scm_wta (scm, (char *) pos, FUNC_NAME); } while (0) | |
257 | ||
258 | #define RETURN_SCM_WTA(pos, scm) \ | |
259 | do { return scm_wta (scm, (char *) pos, FUNC_NAME); } while (0) | |
260 | ||
261 | #define SCM_VALIDATE_NUMBER_COPY(pos, z, cvar) \ | |
262 | do { \ | |
263 | if (SCM_INUMP (z)) \ | |
264 | cvar = (double) SCM_INUM (z); \ | |
265 | else if (SCM_REALP (z)) \ | |
266 | cvar = SCM_REAL_VALUE (z); \ | |
267 | else if (SCM_BIGP (z)) \ | |
268 | cvar = scm_i_big2dbl (z); \ | |
269 | else \ | |
270 | { \ | |
271 | cvar = 0.0; \ | |
272 | SCM_WRONG_TYPE_ARG (pos, z); \ | |
273 | } \ | |
274 | } while (0) | |
275 | ||
276 | #define SCM_VALIDATE_NUMBER_DEF_COPY(pos, number, def, cvar) \ | |
277 | do { \ | |
278 | if (SCM_UNBNDP (number)) \ | |
279 | cvar = def; \ | |
280 | else \ | |
281 | SCM_VALIDATE_NUMBER_COPY(pos, number, cvar); \ | |
282 | } while (0) | |
283 | ||
284 | #define SCM_VALIDATE_OPDIR(pos, port) SCM_MAKE_VALIDATE (pos, port, OPDIRP) | |
285 | ||
55d30fac | 286 | void scm_i_init_deprecated (void); |
19e2247d | 287 | |
55d30fac | 288 | #endif |
19e2247d | 289 | |
55d30fac | 290 | #endif /* SCM_DEPRECATED_H */ |