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 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_IMP (x) \
72 : (*scm_ceval_ptr) ((x), (env)))
73 #define SCM_XEVALCAR(x, env) (SCM_IMP (SCM_CAR (x)) \
74 ? SCM_EVALIM (SCM_CAR (x), env) \
75 : (SCM_SYMBOLP (SCM_CAR (x)) \
76 ? *scm_lookupcar (x, env, 1) \
77 : (*scm_ceval_ptr) (SCM_CAR (x), env)))
80 #define scm_substring_move_left_x scm_substring_move_x
81 #define scm_substring_move_right_x scm_substring_move_x
83 #define scm_sizet size_t
85 SCM_API SCM
scm_wta (SCM arg
, const char *pos
, const char *s_subr
);
88 #define SCM_OUTOFRANGE 10
91 SCM_API
void scm_register_module_xxx (char *module_name
, void *init_func
);
92 SCM_API SCM
scm_registered_modules (void);
93 SCM_API SCM
scm_clear_registered_modules (void);
95 SCM_API SCM
scm_protect_object (SCM obj
);
96 SCM_API SCM
scm_unprotect_object (SCM obj
);
98 #define SCM_SETAND_CAR(x, y) \
99 (SCM_SETCAR ((x), SCM_PACK (SCM_UNPACK (SCM_CAR (x)) & (y))))
100 #define SCM_SETOR_CAR(x, y)\
101 (SCM_SETCAR ((x), SCM_PACK (SCM_UNPACK (SCM_CAR (x)) | (y))))
102 #define SCM_SETAND_CDR(x, y)\
103 (SCM_SETCDR ((x), SCM_PACK (SCM_UNPACK (SCM_CDR (x)) & (y))))
104 #define SCM_SETOR_CDR(x, y)\
105 (SCM_SETCDR ((x), SCM_PACK (SCM_UNPACK (SCM_CDR (x)) | (y))))
106 #define SCM_FREEP(x) (SCM_FREE_CELL_P (x))
107 #define SCM_NFREEP(x) (!SCM_FREE_CELL_P (x))
108 #define SCM_GC8MARKP(x) SCM_GC_MARK_P (x)
109 #define SCM_SETGC8MARK(x) SCM_SET_GC_MARK (x)
110 #define SCM_CLRGC8MARK(x) SCM_CLEAR_GC_MARK (x)
111 #define SCM_GCTYP16(x) SCM_TYP16 (x)
112 #define SCM_GCCDR(x) SCM_CDR (x)
113 SCM_API
void scm_remember (SCM
* ptr
);
115 SCM_API SCM
scm_the_root_module (void);
116 SCM_API SCM
scm_make_module (SCM name
);
117 SCM_API SCM
scm_ensure_user_module (SCM name
);
118 SCM_API SCM
scm_load_scheme_module (SCM name
);
120 #define scm_port scm_t_port
121 #define scm_ptob_descriptor scm_t_ptob_descriptor
122 #define scm_port_rw_active scm_t_port_rw_active
124 SCM_API SCM
scm_close_all_ports_except (SCM ports
);
126 #define scm_rstate scm_t_rstate
127 #define scm_rng scm_t_rng
129 #define SCM_SLOPPY_CONSP(x) ((1 & SCM_CELL_TYPE (x)) == 0)
130 #define SCM_SLOPPY_NCONSP(x) (!SCM_SLOPPY_CONSP(x))
132 #define scm_tc7_ssymbol scm_tc7_symbol
133 #define scm_tc7_msymbol scm_tc7_symbol
134 #define scm_tcs_symbols scm_tc7_symbol
136 SCM_API SCM
scm_makstr (size_t len
, int);
137 SCM_API SCM
scm_makfromstr (const char *src
, size_t len
, int);
139 SCM_API SCM
scm_variable_set_name_hint (SCM var
, SCM hint
);
140 SCM_API SCM
scm_builtin_variable (SCM name
);
142 SCM_API SCM
scm_internal_with_fluids (SCM fluids
, SCM vals
,
143 SCM (*cproc
)(void *), void *cdata
);
145 SCM_API SCM
scm_make_gsubr (const char *name
, int req
, int opt
, int rst
,
147 SCM_API SCM
scm_make_gsubr_with_generic (const char *name
,
154 extern SCM
scm_create_hook (const char* name
, int n_args
);
156 #define SCM_LIST0 SCM_EOL
157 #define SCM_LIST1(e0) scm_cons ((e0), SCM_EOL)
158 #define SCM_LIST2(e0, e1) scm_cons2 ((e0), (e1), SCM_EOL)
159 #define SCM_LIST3(e0, e1, e2) scm_cons ((e0), SCM_LIST2 ((e1), (e2)))
160 #define SCM_LIST4(e0, e1, e2, e3)\
161 scm_cons2 ((e0), (e1), SCM_LIST2 ((e2), (e3)))
162 #define SCM_LIST5(e0, e1, e2, e3, e4)\
163 scm_cons ((e0), SCM_LIST4 ((e1), (e2), (e3), (e4)))
164 #define SCM_LIST6(e0, e1, e2, e3, e4, e5)\
165 scm_cons2 ((e0), (e1), SCM_LIST4 ((e2), (e3), (e4), (e5)))
166 #define SCM_LIST7(e0, e1, e2, e3, e4, e5, e6)\
167 scm_cons ((e0), SCM_LIST6 ((e1), (e2), (e3), (e4), (e5), (e6)))
168 #define SCM_LIST8(e0, e1, e2, e3, e4, e5, e6, e7)\
169 scm_cons2 ((e0), (e1), SCM_LIST6 ((e2), (e3), (e4), (e5), (e6), (e7)))
170 #define SCM_LIST9(e0, e1, e2, e3, e4, e5, e6, e7, e8)\
172 SCM_LIST8 ((e1), (e2), (e3), (e4), (e5), (e6), (e7), (e8)))
174 #define scm_listify scm_list_n
176 SCM_API SCM
scm_sloppy_memq (SCM x
, SCM lst
);
177 SCM_API SCM
scm_sloppy_memv (SCM x
, SCM lst
);
178 SCM_API SCM
scm_sloppy_member (SCM x
, SCM lst
);
180 SCM_API SCM
scm_read_and_eval_x (SCM port
);
182 #define scm_subr_entry scm_t_subr_entry
184 #define SCM_SUBR_DOC(x) SCM_BOOL_F
186 SCM_API SCM
scm_make_subr (const char *name
, int type
, SCM (*fcn
) ());
187 SCM_API SCM
scm_make_subr_with_generic (const char *name
,
191 SCM_API SCM
scm_make_subr_opt (const char *name
,
196 SCM_API SCM
scm_call_catching_errors (SCM (*thunk
)(), SCM (*err_filter
)(),
199 SCM_API
long scm_make_smob_type_mfpe (char *name
, size_t size
,
201 size_t (*free
) (SCM
),
202 int (*print
) (SCM
, SCM
,
204 SCM (*equalp
) (SCM
, SCM
));
206 SCM_API
void scm_set_smob_mfpe (long tc
,
208 size_t (*free
) (SCM
),
209 int (*print
) (SCM
, SCM
, scm_print_state
*),
210 SCM (*equalp
) (SCM
, SCM
));
212 SCM_API SCM
scm_strprint_obj (SCM obj
);
213 SCM_API SCM
scm_read_0str (char *expr
);
214 SCM_API SCM
scm_eval_0str (const char *expr
);
216 SCM_API
char *scm_i_object_chars (SCM
);
218 #define SCM_CHARS(x) scm_i_object_chars(x)
219 #define SCM_UCHARS(x) ((unsigned char *)SCM_CHARS(x))
221 SCM_API
long scm_i_object_length (SCM
);
223 #define SCM_LENGTH(x) scm_i_object_length(x)
225 #define scm_strhash(str, len, n) (scm_string_hash ((str), (len)) % (n))
227 SCM_API SCM
scm_sym2ovcell_soft (SCM sym
, SCM obarray
);
228 SCM_API SCM
scm_sym2ovcell (SCM sym
, SCM obarray
);
229 SCM_API SCM
scm_intern_obarray_soft (const char *name
, size_t len
,
230 SCM obarray
, unsigned int softness
);
231 SCM_API SCM
scm_intern_obarray (const char *name
, size_t len
, SCM obarray
);
232 SCM_API SCM
scm_symbol_value0 (const char *name
);
234 SCM_API SCM
scm_string_to_obarray_symbol (SCM o
, SCM s
, SCM softp
);
235 SCM_API SCM
scm_intern_symbol (SCM o
, SCM s
);
236 SCM_API SCM
scm_unintern_symbol (SCM o
, SCM s
);
237 SCM_API SCM
scm_symbol_binding (SCM o
, SCM s
);
239 /* This name has been reused for real uninterned symbols. */
240 SCM_API SCM
scm_symbol_interned_p (SCM o
, SCM s
);
242 SCM_API SCM
scm_symbol_bound_p (SCM o
, SCM s
);
243 SCM_API SCM
scm_symbol_set_x (SCM o
, SCM s
, SCM v
);
245 SCM_API SCM
scm_gentemp (SCM prefix
, SCM obarray
);
247 #define SCM_OPDIRP(x) (SCM_DIRP (x) && (SCM_DIR_OPEN_P (x)))
248 #define scm_fport scm_t_fport
249 #define scm_option scm_t_option
250 #define scm_srcprops scm_t_srcprops
251 #define scm_srcprops_chunk scm_t_srcprops_chunk
252 #define scm_info_frame scm_t_info_frame
253 #define scm_stack scm_t_stack
254 #define scm_array scm_t_array
255 #define scm_array_dim scm_t_array_dim
256 #define SCM_ARRAY_CONTIGUOUS SCM_ARRAY_FLAG_CONTIGUOUS
257 #define SCM_FUNC_NAME (scm_makfrom0str (FUNC_NAME))
259 #define SCM_WTA(pos, scm) \
260 do { scm_wta (scm, (char *) pos, FUNC_NAME); } while (0)
262 #define RETURN_SCM_WTA(pos, scm) \
263 do { return scm_wta (scm, (char *) pos, FUNC_NAME); } while (0)
265 #define SCM_VALIDATE_NUMBER_COPY(pos, z, cvar) \
268 cvar = (double) SCM_INUM (z); \
269 else if (SCM_REALP (z)) \
270 cvar = SCM_REAL_VALUE (z); \
271 else if (SCM_BIGP (z)) \
272 cvar = scm_i_big2dbl (z); \
276 SCM_WRONG_TYPE_ARG (pos, z); \
280 #define SCM_VALIDATE_NUMBER_DEF_COPY(pos, number, def, cvar) \
282 if (SCM_UNBNDP (number)) \
285 SCM_VALIDATE_NUMBER_COPY(pos, number, cvar); \
288 #define SCM_VALIDATE_OPDIR(pos, port) SCM_MAKE_VALIDATE (pos, port, OPDIRP)
290 void scm_i_init_deprecated (void);
294 #endif /* SCM_DEPRECATED_H */