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, 2005, 2006, 2007, 2009 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 License
12 * as published by the Free Software Foundation; either version 3 of
13 * the License, or (at your option) any later version.
15 * This library is distributed in the hope that it will be useful, but
16 * 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., 51 Franklin Street, Fifth Floor, Boston, MA
26 #include "libguile/__scm.h"
27 #include "libguile/arrays.h"
28 #include "libguile/strings.h"
30 #if (SCM_ENABLE_DEPRECATED == 1)
32 /* From eval.h: Macros for handling ilocs. These were deprecated in guile
33 * 1.7.0 on 2004-04-22. */
34 #define SCM_IFRINC (0x00000100L)
35 #define SCM_ICDR (0x00080000L)
36 #define SCM_IFRAME(n) ((long)((SCM_ICDR-SCM_IFRINC)>>8) \
37 & (SCM_UNPACK (n) >> 8))
38 #define SCM_IDIST(n) (SCM_UNPACK (n) >> 20)
39 #define SCM_ICDRP(n) (SCM_ICDR & SCM_UNPACK (n))
42 /* From tags.h: Macros to access internal symbol names of isyms. Deprecated
43 * in guile 1.7.0 on 2004-04-22. */
44 SCM_API
char *scm_isymnames
[];
45 #define SCM_ISYMNUM(n) 0
46 #define SCM_ISYMCHARS(n) "#@<deprecated>"
49 /* From tags.h: Macro checking for two tc16 types that are allocated to differ
50 * only in the 's'-bit. Deprecated in guile 1.7.0 on 2003-09-21. */
51 #define SCM_TYP16S(x) (0xfeff & SCM_CELL_TYPE (x))
54 /* From numbers.h: Macros checking for types, but avoiding a redundant check
55 * for !SCM_IMP. These were deprecated in guile 1.7.0 on 2003-09-06. */
56 #define SCM_SLOPPY_INEXACTP(x) (SCM_TYP16S (x) == scm_tc16_real)
57 #define SCM_SLOPPY_REALP(x) (SCM_TYP16 (x) == scm_tc16_real)
58 #define SCM_SLOPPY_COMPLEXP(x) (SCM_TYP16 (x) == scm_tc16_complex)
61 /* From eval.h: Macros for handling ilocs. These were deprecated in guile
62 * 1.7.0 on 2003-06-04. */
63 #define SCM_ILOC00 SCM_MAKE_ITAG8(0L, scm_tc8_iloc)
64 #define SCM_IDINC (0x00100000L)
65 #define SCM_IDSTMSK (-SCM_IDINC)
68 /* From eval.h: Error messages of the evaluator. These were deprecated in
69 * guile 1.7.0 on 2003-06-02. */
70 SCM_DEPRECATED
const char scm_s_expression
[];
71 SCM_DEPRECATED
const char scm_s_test
[];
72 SCM_DEPRECATED
const char scm_s_body
[];
73 SCM_DEPRECATED
const char scm_s_bindings
[];
74 SCM_DEPRECATED
const char scm_s_variable
[];
75 SCM_DEPRECATED
const char scm_s_clauses
[];
76 SCM_DEPRECATED
const char scm_s_formals
[];
79 /* From eval.h: Helper macros for evaluation and application. These were
80 * deprecated in guile 1.7.0 on 2003-06-02. */
81 #define SCM_EVALIM2(x) \
82 ((scm_is_eq ((x), SCM_EOL) \
83 ? scm_misc_error (NULL, scm_s_expression, SCM_EOL), 0 \
86 #define SCM_EVALIM(x, env) (SCM_ILOCP (x) \
87 ? *scm_ilookup ((x), env) \
89 #define SCM_XEVAL(x, env) (scm_i_eval_x ((x), (env)))
90 #define SCM_XEVALCAR(x, env) (SCM_SYMBOLP (SCM_CAR (x)) \
91 ? *scm_lookupcar (x, env, 1) \
92 : scm_i_eval_x (SCM_CAR (x), (env)))
95 #define scm_substring_move_left_x scm_substring_move_x
96 #define scm_substring_move_right_x scm_substring_move_x
98 #define scm_sizet size_t
100 SCM_DEPRECATED SCM
scm_wta (SCM arg
, const char *pos
, const char *s_subr
);
103 #define SCM_OUTOFRANGE 10
104 #define SCM_NALLOC 11
106 SCM_DEPRECATED
void scm_register_module_xxx (char *module_name
, void *init_func
);
107 SCM_DEPRECATED SCM
scm_registered_modules (void);
108 SCM_DEPRECATED SCM
scm_clear_registered_modules (void);
110 SCM_DEPRECATED SCM
scm_protect_object (SCM obj
);
111 SCM_DEPRECATED SCM
scm_unprotect_object (SCM obj
);
113 #define SCM_SETAND_CAR(x, y) \
114 (SCM_SETCAR ((x), SCM_PACK (SCM_UNPACK (SCM_CAR (x)) & (y))))
115 #define SCM_SETOR_CAR(x, y)\
116 (SCM_SETCAR ((x), SCM_PACK (SCM_UNPACK (SCM_CAR (x)) | (y))))
117 #define SCM_SETAND_CDR(x, y)\
118 (SCM_SETCDR ((x), SCM_PACK (SCM_UNPACK (SCM_CDR (x)) & (y))))
119 #define SCM_SETOR_CDR(x, y)\
120 (SCM_SETCDR ((x), SCM_PACK (SCM_UNPACK (SCM_CDR (x)) | (y))))
121 #define SCM_FREEP(x) (0)
122 #define SCM_NFREEP(x) (1)
123 #define SCM_GC8MARKP(x) SCM_GC_MARK_P (x)
124 #define SCM_SETGC8MARK(x) SCM_SET_GC_MARK (x)
125 #define SCM_CLRGC8MARK(x) SCM_CLEAR_GC_MARK (x)
126 #define SCM_GCTYP16(x) SCM_TYP16 (x)
127 #define SCM_GCCDR(x) SCM_CDR (x)
128 SCM_DEPRECATED
void scm_remember (SCM
* ptr
);
130 SCM_DEPRECATED SCM
scm_the_root_module (void);
131 SCM_DEPRECATED SCM
scm_make_module (SCM name
);
132 SCM_DEPRECATED SCM
scm_ensure_user_module (SCM name
);
133 SCM_DEPRECATED SCM
scm_load_scheme_module (SCM name
);
135 #define scm_port scm_t_port
136 #define scm_ptob_descriptor scm_t_ptob_descriptor
137 #define scm_port_rw_active scm_t_port_rw_active
139 SCM_DEPRECATED SCM
scm_close_all_ports_except (SCM ports
);
141 #define scm_rstate scm_t_rstate
142 #define scm_rng scm_t_rng
144 #define SCM_SLOPPY_CONSP(x) ((1 & SCM_CELL_TYPE (x)) == 0)
145 #define SCM_SLOPPY_NCONSP(x) (!SCM_SLOPPY_CONSP(x))
147 #define scm_tc7_ssymbol scm_tc7_symbol
148 #define scm_tc7_msymbol scm_tc7_symbol
149 #define scm_tcs_symbols scm_tc7_symbol
151 SCM_DEPRECATED SCM
scm_makstr (size_t len
, int);
152 SCM_DEPRECATED SCM
scm_makfromstr (const char *src
, size_t len
, int);
154 SCM_DEPRECATED SCM
scm_variable_set_name_hint (SCM var
, SCM hint
);
155 SCM_DEPRECATED SCM
scm_builtin_variable (SCM name
);
157 SCM_DEPRECATED SCM
scm_internal_with_fluids (SCM fluids
, SCM vals
,
158 SCM (*cproc
)(void *),
161 SCM_DEPRECATED SCM
scm_make_gsubr (const char *name
,
162 int req
, int opt
, int rst
,
164 SCM_DEPRECATED SCM
scm_make_gsubr_with_generic (const char *name
,
171 SCM_DEPRECATED SCM
scm_create_hook (const char* name
, int n_args
);
173 #define SCM_LIST0 SCM_EOL
174 #define SCM_LIST1(e0) scm_cons ((e0), SCM_EOL)
175 #define SCM_LIST2(e0, e1) scm_cons2 ((e0), (e1), SCM_EOL)
176 #define SCM_LIST3(e0, e1, e2) scm_cons ((e0), SCM_LIST2 ((e1), (e2)))
177 #define SCM_LIST4(e0, e1, e2, e3)\
178 scm_cons2 ((e0), (e1), SCM_LIST2 ((e2), (e3)))
179 #define SCM_LIST5(e0, e1, e2, e3, e4)\
180 scm_cons ((e0), SCM_LIST4 ((e1), (e2), (e3), (e4)))
181 #define SCM_LIST6(e0, e1, e2, e3, e4, e5)\
182 scm_cons2 ((e0), (e1), SCM_LIST4 ((e2), (e3), (e4), (e5)))
183 #define SCM_LIST7(e0, e1, e2, e3, e4, e5, e6)\
184 scm_cons ((e0), SCM_LIST6 ((e1), (e2), (e3), (e4), (e5), (e6)))
185 #define SCM_LIST8(e0, e1, e2, e3, e4, e5, e6, e7)\
186 scm_cons2 ((e0), (e1), SCM_LIST6 ((e2), (e3), (e4), (e5), (e6), (e7)))
187 #define SCM_LIST9(e0, e1, e2, e3, e4, e5, e6, e7, e8)\
189 SCM_LIST8 ((e1), (e2), (e3), (e4), (e5), (e6), (e7), (e8)))
191 #define scm_listify scm_list_n
193 SCM_DEPRECATED SCM
scm_sloppy_memq (SCM x
, SCM lst
);
194 SCM_DEPRECATED SCM
scm_sloppy_memv (SCM x
, SCM lst
);
195 SCM_DEPRECATED SCM
scm_sloppy_member (SCM x
, SCM lst
);
197 SCM_DEPRECATED SCM
scm_read_and_eval_x (SCM port
);
199 #define scm_subr_entry scm_t_subr_entry
201 #define SCM_SUBR_DOC(x) SCM_BOOL_F
203 SCM_DEPRECATED SCM
scm_make_subr (const char *name
, int type
, SCM (*fcn
) ());
204 SCM_DEPRECATED SCM
scm_make_subr_with_generic (const char *name
,
208 SCM_DEPRECATED SCM
scm_make_subr_opt (const char *name
,
213 SCM_DEPRECATED SCM
scm_call_catching_errors (SCM (*thunk
)(), SCM (*err_filter
)(),
216 SCM_DEPRECATED
long scm_make_smob_type_mfpe (char *name
, size_t size
,
218 size_t (*free
) (SCM
),
219 int (*print
) (SCM
, SCM
,
221 SCM (*equalp
) (SCM
, SCM
));
223 SCM_DEPRECATED
void scm_set_smob_mfpe (long tc
,
225 size_t (*free
) (SCM
),
226 int (*print
) (SCM
, SCM
, scm_print_state
*),
227 SCM (*equalp
) (SCM
, SCM
));
229 SCM_DEPRECATED
size_t scm_smob_free (SCM obj
);
231 SCM_DEPRECATED SCM
scm_strprint_obj (SCM obj
);
232 SCM_DEPRECATED SCM
scm_read_0str (char *expr
);
233 SCM_DEPRECATED SCM
scm_eval_0str (const char *expr
);
235 SCM_DEPRECATED
char *scm_i_object_chars (SCM
);
237 #define SCM_CHARS(x) scm_i_object_chars(x)
238 #define SCM_UCHARS(x) ((unsigned char *)SCM_CHARS(x))
240 SCM_DEPRECATED
long scm_i_object_length (SCM
);
242 #define SCM_LENGTH(x) scm_i_object_length(x)
244 #define scm_strhash(str, len, n) (scm_string_hash ((str), (len)) % (n))
246 SCM_DEPRECATED SCM
scm_sym2ovcell_soft (SCM sym
, SCM obarray
);
247 SCM_DEPRECATED SCM
scm_sym2ovcell (SCM sym
, SCM obarray
);
248 SCM_DEPRECATED SCM
scm_intern_obarray_soft (const char *name
, size_t len
,
249 SCM obarray
, unsigned int softness
);
250 SCM_DEPRECATED SCM
scm_intern_obarray (const char *name
, size_t len
, SCM obarray
);
251 SCM_DEPRECATED SCM
scm_symbol_value0 (const char *name
);
253 SCM_DEPRECATED SCM
scm_string_to_obarray_symbol (SCM o
, SCM s
, SCM softp
);
254 SCM_DEPRECATED SCM
scm_intern_symbol (SCM o
, SCM s
);
255 SCM_DEPRECATED SCM
scm_unintern_symbol (SCM o
, SCM s
);
256 SCM_DEPRECATED SCM
scm_symbol_binding (SCM o
, SCM s
);
258 /* This name has been reused for real uninterned symbols. */
259 SCM_DEPRECATED SCM
scm_symbol_interned_p (SCM o
, SCM s
);
261 SCM_DEPRECATED SCM
scm_symbol_bound_p (SCM o
, SCM s
);
262 SCM_DEPRECATED SCM
scm_symbol_set_x (SCM o
, SCM s
, SCM v
);
264 SCM_DEPRECATED SCM
scm_gentemp (SCM prefix
, SCM obarray
);
266 #define SCM_OPDIRP(x) (SCM_DIRP (x) && (SCM_DIR_OPEN_P (x)))
267 #define scm_fport scm_t_fport
268 #define scm_option scm_t_option
269 #define scm_srcprops scm_t_srcprops
270 #define scm_srcprops_chunk scm_t_srcprops_chunk
271 #define scm_info_frame scm_t_info_frame
272 #define scm_stack scm_t_stack
273 #define scm_array scm_t_array
274 #define scm_array_dim scm_t_array_dim
275 #define SCM_ARRAY_CONTIGUOUS SCM_ARRAY_FLAG_CONTIGUOUS
276 #define SCM_FUNC_NAME (scm_makfrom0str (FUNC_NAME))
278 #define SCM_WTA(pos, scm) \
279 do { scm_wta (scm, (char *) pos, FUNC_NAME); } while (0)
281 #define RETURN_SCM_WTA(pos, scm) \
282 do { return scm_wta (scm, (char *) pos, FUNC_NAME); } while (0)
284 #define SCM_VALIDATE_NUMBER_COPY(pos, z, cvar) \
286 if (SCM_I_INUMP (z)) \
287 cvar = (double) SCM_I_INUM (z); \
288 else if (SCM_REALP (z)) \
289 cvar = SCM_REAL_VALUE (z); \
290 else if (SCM_BIGP (z)) \
291 cvar = scm_i_big2dbl (z); \
295 SCM_WRONG_TYPE_ARG (pos, z); \
299 #define SCM_VALIDATE_NUMBER_DEF_COPY(pos, number, def, cvar) \
301 if (SCM_UNBNDP (number)) \
304 SCM_VALIDATE_NUMBER_COPY(pos, number, cvar); \
307 #define SCM_VALIDATE_OPDIR(pos, port) SCM_MAKE_VALIDATE (pos, port, OPDIRP)
309 /* Deprecated because we can not safely cast a SCM* to a scm_t_bits*
312 #define SCM_CELL_WORD_LOC(x, n) ((scm_t_bits*)SCM_CELL_OBJECT_LOC((x),(n)))
314 /* Users shouldn't know about INUMs.
317 SCM_DEPRECATED SCM
scm_i_makinum (scm_t_signed_bits val
);
318 SCM_DEPRECATED
int scm_i_inump (SCM obj
);
319 SCM_DEPRECATED scm_t_signed_bits
scm_i_inum (SCM obj
);
321 #define SCM_MAKINUM(x) scm_i_makinum(x)
322 #define SCM_INUM(x) scm_i_inum(x)
323 #define SCM_INUMP(x) scm_i_inump(x)
324 #define SCM_NINUMP(x) (!SCM_INUMP(x))
326 #define SCM_VALIDATE_INUM(pos, k) SCM_MAKE_VALIDATE_MSG (pos, k, INUMP, "exact integer")
328 #define SCM_VALIDATE_INUM_COPY(pos, k, cvar) \
330 SCM_ASSERT (SCM_I_INUMP (k), k, pos, FUNC_NAME); \
331 cvar = SCM_I_INUM (k); \
334 #define SCM_VALIDATE_BIGINT(pos, k) SCM_MAKE_VALIDATE_MSG (pos, k, BIGP, "bignum")
336 #define SCM_VALIDATE_INUM_MIN(pos, k, min) \
338 SCM_ASSERT (SCM_I_INUMP(k), k, pos, FUNC_NAME); \
339 SCM_ASSERT_RANGE (pos, k, (SCM_I_INUM (k) >= min)); \
342 #define SCM_VALIDATE_INUM_MIN_COPY(pos, k, min, cvar) \
344 SCM_ASSERT (SCM_I_INUMP (k), k, pos, FUNC_NAME); \
345 SCM_ASSERT_RANGE (pos, k, (SCM_I_INUM (k) >= min)); \
346 cvar = SCM_INUM (k); \
349 #define SCM_VALIDATE_INUM_MIN_DEF_COPY(pos, k, min, default, cvar) \
351 if (SCM_UNBNDP (k)) \
352 k = SCM_I_MAKINUM (default); \
353 SCM_ASSERT (SCM_I_INUMP (k), k, pos, FUNC_NAME); \
354 SCM_ASSERT_RANGE (pos, k, (SCM_I_INUM (k) >= min)); \
355 cvar = SCM_INUM (k); \
358 #define SCM_VALIDATE_INUM_DEF(pos, k, default) \
360 if (SCM_UNBNDP (k)) \
361 k = SCM_I_MAKINUM (default); \
362 else SCM_ASSERT (SCM_I_INUMP (k), k, pos, FUNC_NAME); \
365 #define SCM_VALIDATE_INUM_DEF_COPY(pos, k, default, cvar) \
367 if (SCM_UNBNDP (k)) \
369 k = SCM_I_MAKINUM (default); \
374 SCM_ASSERT (SCM_I_INUMP (k), k, pos, FUNC_NAME); \
375 cvar = SCM_INUM (k); \
380 #define SCM_VALIDATE_INUM_RANGE(pos, k, low, high) \
381 do { SCM_ASSERT(SCM_I_INUMP(k), k, pos, FUNC_NAME); \
382 SCM_ASSERT_RANGE(pos, k, \
383 (SCM_I_INUM (k) >= low && \
384 SCM_I_INUM (k) < high)); \
387 #define SCM_VALIDATE_INUM_RANGE_COPY(pos, k, low, high, cvar) \
389 SCM_ASSERT (SCM_INUMP (k), k, pos, FUNC_NAME); \
390 SCM_ASSERT_RANGE (pos, k, low <= SCM_INUM (k) && SCM_INUM (k) < high); \
391 cvar = SCM_INUM (k); \
394 #define SCM_STRING_COERCE_0TERMINATION_X(x) (x)
396 /* XXX - buggy interface, STR might not be large enough.
398 Converts the given Scheme string OBJ into a C string, containing a copy
399 of OBJ's content with a trailing null byte. If LENP is non-NULL, set
400 *LENP to the string's length.
402 When STR is non-NULL it receives the copy and is returned by the function,
403 otherwise new memory is allocated and the caller is responsible for
404 freeing it via free(). If out of memory, NULL is returned.
406 Note that Scheme strings may contain arbitrary data, including null
407 characters. This means that null termination is not a reliable way to
408 determine the length of the returned value. However, the function always
409 copies the complete contents of OBJ, and sets *LENP to the length of the
410 scheme string (if LENP is non-null).
412 SCM_DEPRECATED
char *scm_c_string2str (SCM obj
, char *str
, size_t *lenp
);
414 /* XXX - buggy interface, you don't know how many bytes have been copied.
416 Copy LEN characters at START from the Scheme string OBJ to memory
417 at STR. START is an index into OBJ; zero means the beginning of
418 the string. STR has already been allocated by the caller.
420 If START + LEN is off the end of OBJ, silently truncate the source
421 region to fit the string. If truncation occurs, the corresponding
422 area of STR is left unchanged.
424 SCM_DEPRECATED
char *scm_c_substring2str (SCM obj
, char *str
, size_t start
, size_t len
);
426 SCM_DEPRECATED
char *scm_c_symbol2str (SCM obj
, char *str
, size_t *lenp
);
428 /* Deprecated because the names belong to what is now
429 scm_truncate_number and scm_round_number.
431 SCM_DEPRECATED
double scm_truncate (double x
);
432 SCM_DEPRECATED
double scm_round (double x
);
434 /* Deprecated because we don't want people to access the internal
435 representation of strings directly.
438 #define SCM_VALIDATE_STRING_COPY(pos, str, cvar) \
440 SCM_ASSERT (SCM_STRINGP (str), str, pos, FUNC_NAME); \
441 cvar = SCM_STRING_CHARS(str); \
444 /* validate a string and optional start/end arguments which default to
445 0/string-len. this is unrelated to the old shared substring
446 support, so please do not deprecate it :) */
447 #define SCM_VALIDATE_SUBSTRING_SPEC_COPY(pos_str, str, c_str, \
448 pos_start, start, c_start,\
449 pos_end, end, c_end) \
451 SCM_VALIDATE_STRING_COPY (pos_str, str, c_str);\
452 c_start = SCM_UNBNDP(start)? 0 : scm_to_size_t (start);\
453 c_end = SCM_UNBNDP(end)? SCM_STRING_LENGTH(str) : scm_to_size_t (end);\
454 SCM_ASSERT_RANGE (pos_start, start,\
456 && (size_t) c_start <= SCM_STRING_LENGTH (str));\
457 SCM_ASSERT_RANGE (pos_end, end,\
459 && (size_t) c_end <= SCM_STRING_LENGTH (str));\
462 /* Deprecated because we don't want people to access the internals of
466 SCM_DEPRECATED
char *scm_i_deprecated_symbol_chars (SCM sym
);
467 SCM_DEPRECATED
size_t scm_i_deprecated_symbol_length (SCM sym
);
469 #define SCM_SYMBOL_CHARS(x) scm_i_deprecated_symbol_chars(x)
470 #define SCM_SYMBOL_LENGTH(x) scm_i_deprecated_symbol_length(x)
472 /* Deprecated because the macros used to evaluate the arguments more
473 than once and because the symbol of a keyword now has no dash.
476 SCM_DEPRECATED
int scm_i_keywordp (SCM obj
);
477 SCM_DEPRECATED SCM
scm_i_keywordsym (SCM keyword
);
479 #define SCM_KEYWORDP(x) scm_i_keywordp(x)
480 #define SCM_KEYWORDSYM(x) scm_i_keywordsym(x)
482 /* Deprecated because we don't want to hand out unprotected pointers
483 to arrays, vectors, etc. */
485 #define SCM_VECTOR_MAX_LENGTH ((1L << 24) - 1)
487 SCM_DEPRECATED
int scm_i_vectorp (SCM x
);
488 SCM_DEPRECATED
unsigned long scm_i_vector_length (SCM x
);
489 SCM_DEPRECATED
const SCM
*scm_i_velts (SCM x
);
490 SCM_DEPRECATED SCM
*scm_i_writable_velts (SCM x
);
491 SCM_DEPRECATED SCM
scm_i_vector_ref (SCM x
, size_t idx
);
492 SCM_DEPRECATED
void scm_i_vector_set (SCM x
, size_t idx
, SCM val
);
493 SCM_DEPRECATED SCM
scm_vector_equal_p (SCM x
, SCM y
);
495 #define SCM_VECTORP(x) scm_i_vectorp(x)
496 #define SCM_VECTOR_LENGTH(x) scm_i_vector_length(x)
497 #define SCM_VELTS(x) scm_i_velts(x)
498 #define SCM_WRITABLE_VELTS(x) scm_i_writable_velts(x)
499 #define SCM_VECTOR_REF(x,y) scm_i_vector_ref(x,y)
500 #define SCM_VECTOR_SET(x,y,z) scm_i_vector_set(x,y,z)
502 typedef scm_i_t_array scm_t_array
;
504 SCM_DEPRECATED
int scm_i_arrayp (SCM a
);
505 SCM_DEPRECATED
size_t scm_i_array_ndim (SCM a
);
506 SCM_DEPRECATED
int scm_i_array_contp (SCM a
);
507 SCM_DEPRECATED scm_t_array
*scm_i_array_mem (SCM a
);
508 SCM_DEPRECATED SCM
scm_i_array_v (SCM a
);
509 SCM_DEPRECATED
size_t scm_i_array_base (SCM a
);
510 SCM_DEPRECATED scm_t_array_dim
*scm_i_array_dims (SCM a
);
512 #define SCM_ARRAYP(a) scm_i_arrayp(a)
513 #define SCM_ARRAY_NDIM(a) scm_i_array_ndim(a)
514 #define SCM_ARRAY_CONTP(a) scm_i_array_contp(a)
515 #define SCM_ARRAY_MEM(a) scm_i_array_mem(a)
516 #define SCM_ARRAY_V(a) scm_i_array_v(a)
517 #define SCM_ARRAY_BASE(a) scm_i_array_base(a)
518 #define SCM_ARRAY_DIMS(a) scm_i_array_dims(a)
520 /* Deprecated because they should not be lvalues and we want people to
521 use the official interfaces.
524 #define scm_cur_inp scm_i_cur_inp ()
525 #define scm_cur_outp scm_i_cur_outp ()
526 #define scm_cur_errp scm_i_cur_errp ()
527 #define scm_cur_loadp scm_i_cur_loadp ()
528 #define scm_progargs scm_i_progargs ()
529 #define scm_dynwinds scm_i_deprecated_dynwinds ()
530 #define scm_last_debug_frame scm_i_deprecated_last_debug_frame ()
531 #define scm_stack_base scm_i_stack_base ()
533 SCM_DEPRECATED SCM
scm_i_cur_inp (void);
534 SCM_DEPRECATED SCM
scm_i_cur_outp (void);
535 SCM_DEPRECATED SCM
scm_i_cur_errp (void);
536 SCM_DEPRECATED SCM
scm_i_cur_loadp (void);
537 SCM_DEPRECATED SCM
scm_i_progargs (void);
538 SCM_DEPRECATED SCM
scm_i_deprecated_dynwinds (void);
539 SCM_DEPRECATED scm_t_debug_frame
*scm_i_deprecated_last_debug_frame (void);
540 SCM_DEPRECATED SCM_STACKITEM
*scm_i_stack_base (void);
542 /* Deprecated because it evaluates its argument twice.
544 #define SCM_FLUIDP(x) scm_i_fluidp (x)
545 SCM_DEPRECATED
int scm_i_fluidp (SCM x
);
547 /* In the old days, SCM_CRITICAL_SECTION_START stopped signal handlers
548 from running, since in those days the handler directly ran scheme
549 code, and that had to be avoided when the heap was not in a
550 consistent state etc. And since the scheme code could do a stack
551 swapping new continuation etc, signals had to be deferred around
552 various C library functions which were not safe or not known to be
553 safe to swap away, which was a lot of stuff.
555 These days signals are implemented with asyncs and don't directly
556 run scheme code in the handler, but hold it until an SCM_TICK etc
557 where it will be safe. This means interrupt protection is not
558 needed and SCM_CRITICAL_SECTION_START / SCM_CRITICAL_SECTION_END is
559 something of an anachronism.
561 What past SCM_CRITICAL_SECTION_START usage also did though was
562 indicate code that was not reentrant, ie. could not be reentered by
563 signal handler code. The present definitions are a mutex lock,
564 affording that reentrancy protection against the new guile 1.8
565 free-running posix threads.
567 One big problem with the present defintions though is that code which
568 throws an error from within a DEFER/ALLOW region will leave the
569 defer_mutex locked and hence hang other threads that attempt to enter a
570 similar DEFER/ALLOW region.
573 SCM_DEPRECATED
void scm_i_defer_ints_etc (void);
574 #define SCM_DEFER_INTS scm_i_defer_ints_etc ()
575 #define SCM_ALLOW_INTS scm_i_defer_ints_etc ()
576 #define SCM_REDEFER_INTS scm_i_defer_ints_etc ()
577 #define SCM_REALLOW_INTS scm_i_defer_ints_etc ()
579 /* Deprecated since they are unnecessary and had not been documented.
581 SCM_DEPRECATED SCM
scm_guard (SCM guardian
, SCM obj
, int throw_p
);
582 SCM_DEPRECATED SCM
scm_get_one_zombie (SCM guardian
);
584 /* Deprecated since guardians no longer have these special features.
586 SCM_DEPRECATED SCM
scm_destroy_guardian_x (SCM guardian
);
587 SCM_DEPRECATED SCM
scm_guardian_greedy_p (SCM guardian
);
588 SCM_DEPRECATED SCM
scm_guardian_destroyed_p (SCM guardian
);
591 /* GC-related things deprecated with the move to BDW-GC starting from 1.9.3
594 SCM_DEPRECATED
unsigned long scm_mallocated
;
595 SCM_DEPRECATED
unsigned long scm_mtrigger
;
597 SCM_DEPRECATED
size_t scm_max_segment_size
;
599 #if defined (GUILE_DEBUG) || defined (GUILE_DEBUG_FREELIST)
600 SCM_DEPRECATED SCM
scm_map_free_list (void);
603 #if defined (GUILE_DEBUG_FREELIST)
604 SCM_DEPRECATED SCM
scm_gc_set_debug_check_freelist_x (SCM flag
);
609 void scm_i_init_deprecated (void);
613 #endif /* SCM_DEPRECATED_H */