1 /* This file contains definitions for deprecated features. When you
2 deprecate something, move it here when that is feasible.
5 #ifndef SCM_DEPRECATED_H
6 #define SCM_DEPRECATED_H
8 /* Copyright (C) 2003,2004 Free Software Foundation, Inc.
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.
15 * This library 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 GNU
18 * Lesser General Public License for more details.
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
25 #include "libguile/__scm.h"
26 #include "libguile/strings.h"
28 #if (SCM_ENABLE_DEPRECATED == 1)
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))
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)
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)
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
[];
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 \
67 #define SCM_EVALIM(x, env) (SCM_ILOCP (x) \
68 ? *scm_ilookup ((x), env) \
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)))
76 #define scm_substring_move_left_x scm_substring_move_x
77 #define scm_substring_move_right_x scm_substring_move_x
79 #define scm_sizet size_t
81 SCM_API SCM
scm_wta (SCM arg
, const char *pos
, const char *s_subr
);
84 #define SCM_OUTOFRANGE 10
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);
91 SCM_API SCM
scm_protect_object (SCM obj
);
92 SCM_API SCM
scm_unprotect_object (SCM obj
);
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))
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)
107 #define SCM_GCTYP16(x) SCM_TYP16 (x)
108 #define SCM_GCCDR(x) SCM_CDR (x)
109 SCM_API
void scm_remember (SCM
* ptr
);
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
);
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
120 SCM_API SCM
scm_close_all_ports_except (SCM ports
);
122 #define scm_rstate scm_t_rstate
123 #define scm_rng scm_t_rng
125 #define SCM_SLOPPY_CONSP(x) ((1 & SCM_CELL_TYPE (x)) == 0)
126 #define SCM_SLOPPY_NCONSP(x) (!SCM_SLOPPY_CONSP(x))
128 #define scm_tc7_ssymbol scm_tc7_symbol
129 #define scm_tc7_msymbol scm_tc7_symbol
130 #define scm_tcs_symbols scm_tc7_symbol
132 SCM_API SCM
scm_makstr (size_t len
, int);
133 SCM_API SCM
scm_makfromstr (const char *src
, size_t len
, int);
135 SCM_API SCM
scm_variable_set_name_hint (SCM var
, SCM hint
);
136 SCM_API SCM
scm_builtin_variable (SCM name
);
138 SCM_API SCM
scm_internal_with_fluids (SCM fluids
, SCM vals
,
139 SCM (*cproc
)(void *), void *cdata
);
141 SCM_API SCM
scm_make_gsubr (const char *name
, int req
, int opt
, int rst
,
143 SCM_API SCM
scm_make_gsubr_with_generic (const char *name
,
150 extern SCM
scm_create_hook (const char* name
, int n_args
);
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)\
168 SCM_LIST8 ((e1), (e2), (e3), (e4), (e5), (e6), (e7), (e8)))
170 #define scm_listify scm_list_n
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
);
176 SCM_API SCM
scm_read_and_eval_x (SCM port
);
178 #define scm_subr_entry scm_t_subr_entry
180 #define SCM_SUBR_DOC(x) SCM_BOOL_F
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
,
187 SCM_API SCM
scm_make_subr_opt (const char *name
,
192 SCM_API SCM
scm_call_catching_errors (SCM (*thunk
)(), SCM (*err_filter
)(),
195 SCM_API
long scm_make_smob_type_mfpe (char *name
, size_t size
,
197 size_t (*free
) (SCM
),
198 int (*print
) (SCM
, SCM
,
200 SCM (*equalp
) (SCM
, SCM
));
202 SCM_API
void scm_set_smob_mfpe (long tc
,
204 size_t (*free
) (SCM
),
205 int (*print
) (SCM
, SCM
, scm_print_state
*),
206 SCM (*equalp
) (SCM
, SCM
));
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
);
212 SCM_API
char *scm_i_object_chars (SCM
);
214 #define SCM_CHARS(x) scm_i_object_chars(x)
215 #define SCM_UCHARS(x) ((unsigned char *)SCM_CHARS(x))
217 SCM_API
long scm_i_object_length (SCM
);
219 #define SCM_LENGTH(x) scm_i_object_length(x)
221 #define scm_strhash(str, len, n) (scm_string_hash ((str), (len)) % (n))
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
);
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
);
235 /* This name has been reused for real uninterned symbols. */
236 SCM_API SCM
scm_symbol_interned_p (SCM o
, SCM s
);
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
);
241 SCM_API SCM
scm_gentemp (SCM prefix
, SCM obarray
);
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))
255 #define SCM_WTA(pos, scm) \
256 do { scm_wta (scm, (char *) pos, FUNC_NAME); } while (0)
258 #define RETURN_SCM_WTA(pos, scm) \
259 do { return scm_wta (scm, (char *) pos, FUNC_NAME); } while (0)
261 #define SCM_VALIDATE_NUMBER_COPY(pos, z, cvar) \
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); \
272 SCM_WRONG_TYPE_ARG (pos, z); \
276 #define SCM_VALIDATE_NUMBER_DEF_COPY(pos, number, def, cvar) \
278 if (SCM_UNBNDP (number)) \
281 SCM_VALIDATE_NUMBER_COPY(pos, number, cvar); \
284 #define SCM_VALIDATE_OPDIR(pos, port) SCM_MAKE_VALIDATE (pos, port, OPDIRP)
286 void scm_i_init_deprecated (void);
290 #endif /* SCM_DEPRECATED_H */