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, 2010 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/strings.h"
28 #include "libguile/eval.h"
29 #include "libguile/throw.h"
30 #include "libguile/iselect.h"
32 #if (SCM_ENABLE_DEPRECATED == 1)
34 /* From eval.h: Macros for handling ilocs. These were deprecated in guile
35 * 1.7.0 on 2004-04-22. */
36 #define SCM_IFRINC (0x00000100L)
37 #define SCM_ICDR (0x00080000L)
38 #define SCM_IFRAME(n) ((long)((SCM_ICDR-SCM_IFRINC)>>8) \
39 & (SCM_UNPACK (n) >> 8))
40 #define SCM_IDIST(n) (SCM_UNPACK (n) >> 20)
41 #define SCM_ICDRP(n) (SCM_ICDR & SCM_UNPACK (n))
44 /* From tags.h: Macros to access internal symbol names of isyms. Deprecated
45 * in guile 1.7.0 on 2004-04-22. */
46 SCM_API
char *scm_isymnames
[];
47 #define SCM_ISYMNUM(n) 0
48 #define SCM_ISYMCHARS(n) "#@<deprecated>"
51 /* From tags.h: Macro checking for two tc16 types that are allocated to differ
52 * only in the 's'-bit. Deprecated in guile 1.7.0 on 2003-09-21. */
53 #define SCM_TYP16S(x) (0xfeff & SCM_CELL_TYPE (x))
56 /* From numbers.h: Macros checking for types, but avoiding a redundant check
57 * for !SCM_IMP. These were deprecated in guile 1.7.0 on 2003-09-06. */
58 #define SCM_SLOPPY_INEXACTP(x) (SCM_TYP16S (x) == scm_tc16_real)
59 #define SCM_SLOPPY_REALP(x) (SCM_TYP16 (x) == scm_tc16_real)
60 #define SCM_SLOPPY_COMPLEXP(x) (SCM_TYP16 (x) == scm_tc16_complex)
64 Deprecated in Guile 1.9.5 on 2009-11-03. */
65 #define scm_vtable_index_vtable scm_vtable_index_self
66 #define scm_vtable_index_printer scm_vtable_index_instance_printer
67 #define scm_struct_i_free scm_vtable_index_instance_finalize
68 #define scm_struct_i_flags scm_vtable_index_flags
69 #define SCM_STRUCTF_MASK ((scm_t_bits)-1)
70 #define SCM_SET_VTABLE_DESTRUCTOR(X, D) (SCM_STRUCT_DATA(x)[scm_struct_i_free]=(scm_t_bits)(D))
72 #define scm_substring_move_left_x scm_substring_move_x
73 #define scm_substring_move_right_x scm_substring_move_x
75 #define scm_sizet size_t
77 SCM_DEPRECATED SCM
scm_wta (SCM arg
, const char *pos
, const char *s_subr
);
80 #define SCM_OUTOFRANGE 10
83 SCM_DEPRECATED
void scm_register_module_xxx (char *module_name
, void *init_func
);
84 SCM_DEPRECATED SCM
scm_registered_modules (void);
85 SCM_DEPRECATED SCM
scm_clear_registered_modules (void);
87 SCM_DEPRECATED SCM
scm_protect_object (SCM obj
);
88 SCM_DEPRECATED SCM
scm_unprotect_object (SCM obj
);
90 #define SCM_SETAND_CAR(x, y) \
91 (SCM_SETCAR ((x), SCM_PACK (SCM_UNPACK (SCM_CAR (x)) & (y))))
92 #define SCM_SETOR_CAR(x, y)\
93 (SCM_SETCAR ((x), SCM_PACK (SCM_UNPACK (SCM_CAR (x)) | (y))))
94 #define SCM_SETAND_CDR(x, y)\
95 (SCM_SETCDR ((x), SCM_PACK (SCM_UNPACK (SCM_CDR (x)) & (y))))
96 #define SCM_SETOR_CDR(x, y)\
97 (SCM_SETCDR ((x), SCM_PACK (SCM_UNPACK (SCM_CDR (x)) | (y))))
98 #define SCM_FREEP(x) (0)
99 #define SCM_NFREEP(x) (1)
100 #define SCM_GCTYP16(x) SCM_TYP16 (x)
101 #define SCM_GCCDR(x) SCM_CDR (x)
102 SCM_DEPRECATED
void scm_remember (SCM
* ptr
);
104 SCM_DEPRECATED SCM
scm_make_module (SCM name
);
105 SCM_DEPRECATED SCM
scm_ensure_user_module (SCM name
);
106 SCM_DEPRECATED SCM
scm_load_scheme_module (SCM name
);
108 #define scm_port scm_t_port
109 #define scm_ptob_descriptor scm_t_ptob_descriptor
110 #define scm_port_rw_active scm_t_port_rw_active
112 SCM_DEPRECATED SCM
scm_close_all_ports_except (SCM ports
);
114 #define scm_rstate scm_t_rstate
115 #define scm_rng scm_t_rng
117 #define SCM_SLOPPY_CONSP(x) ((1 & SCM_CELL_TYPE (x)) == 0)
118 #define SCM_SLOPPY_NCONSP(x) (!SCM_SLOPPY_CONSP(x))
120 #define scm_tc7_ssymbol scm_tc7_symbol
121 #define scm_tc7_msymbol scm_tc7_symbol
122 #define scm_tcs_symbols scm_tc7_symbol
124 SCM_DEPRECATED SCM
scm_makstr (size_t len
, int);
125 SCM_DEPRECATED SCM
scm_makfromstr (const char *src
, size_t len
, int);
127 SCM_DEPRECATED SCM
scm_variable_set_name_hint (SCM var
, SCM hint
);
128 SCM_DEPRECATED SCM
scm_builtin_variable (SCM name
);
130 SCM_DEPRECATED SCM
scm_internal_with_fluids (SCM fluids
, SCM vals
,
131 SCM (*cproc
)(void *),
134 SCM_DEPRECATED SCM
scm_make_gsubr (const char *name
,
135 int req
, int opt
, int rst
,
137 SCM_DEPRECATED SCM
scm_make_gsubr_with_generic (const char *name
,
144 SCM_DEPRECATED SCM
scm_create_hook (const char* name
, int n_args
);
146 #define SCM_LIST0 SCM_EOL
147 #define SCM_LIST1(e0) scm_cons ((e0), SCM_EOL)
148 #define SCM_LIST2(e0, e1) scm_cons2 ((e0), (e1), SCM_EOL)
149 #define SCM_LIST3(e0, e1, e2) scm_cons ((e0), SCM_LIST2 ((e1), (e2)))
150 #define SCM_LIST4(e0, e1, e2, e3)\
151 scm_cons2 ((e0), (e1), SCM_LIST2 ((e2), (e3)))
152 #define SCM_LIST5(e0, e1, e2, e3, e4)\
153 scm_cons ((e0), SCM_LIST4 ((e1), (e2), (e3), (e4)))
154 #define SCM_LIST6(e0, e1, e2, e3, e4, e5)\
155 scm_cons2 ((e0), (e1), SCM_LIST4 ((e2), (e3), (e4), (e5)))
156 #define SCM_LIST7(e0, e1, e2, e3, e4, e5, e6)\
157 scm_cons ((e0), SCM_LIST6 ((e1), (e2), (e3), (e4), (e5), (e6)))
158 #define SCM_LIST8(e0, e1, e2, e3, e4, e5, e6, e7)\
159 scm_cons2 ((e0), (e1), SCM_LIST6 ((e2), (e3), (e4), (e5), (e6), (e7)))
160 #define SCM_LIST9(e0, e1, e2, e3, e4, e5, e6, e7, e8)\
162 SCM_LIST8 ((e1), (e2), (e3), (e4), (e5), (e6), (e7), (e8)))
164 #define scm_listify scm_list_n
166 SCM_DEPRECATED SCM
scm_sloppy_memq (SCM x
, SCM lst
);
167 SCM_DEPRECATED SCM
scm_sloppy_memv (SCM x
, SCM lst
);
168 SCM_DEPRECATED SCM
scm_sloppy_member (SCM x
, SCM lst
);
170 SCM_DEPRECATED SCM
scm_read_and_eval_x (SCM port
);
172 #define scm_subr_entry scm_t_subr_entry
174 #define SCM_SUBR_DOC(x) SCM_BOOL_F
176 SCM_DEPRECATED SCM
scm_call_catching_errors (SCM (*thunk
)(), SCM (*err_filter
)(),
179 SCM_DEPRECATED
long scm_make_smob_type_mfpe (char *name
, size_t size
,
181 size_t (*free
) (SCM
),
182 int (*print
) (SCM
, SCM
,
184 SCM (*equalp
) (SCM
, SCM
));
186 SCM_DEPRECATED
void scm_set_smob_mfpe (long tc
,
188 size_t (*free
) (SCM
),
189 int (*print
) (SCM
, SCM
, scm_print_state
*),
190 SCM (*equalp
) (SCM
, SCM
));
192 SCM_DEPRECATED
size_t scm_smob_free (SCM obj
);
194 SCM_DEPRECATED SCM
scm_strprint_obj (SCM obj
);
195 SCM_DEPRECATED SCM
scm_read_0str (char *expr
);
196 SCM_DEPRECATED SCM
scm_eval_0str (const char *expr
);
198 SCM_DEPRECATED
char *scm_i_object_chars (SCM
);
200 #define SCM_CHARS(x) scm_i_object_chars(x)
201 #define SCM_UCHARS(x) ((unsigned char *)SCM_CHARS(x))
203 SCM_DEPRECATED
long scm_i_object_length (SCM
);
205 #define SCM_LENGTH(x) scm_i_object_length(x)
207 #define scm_strhash(str, len, n) (scm_string_hash ((str), (len)) % (n))
209 SCM_DEPRECATED SCM
scm_sym2ovcell_soft (SCM sym
, SCM obarray
);
210 SCM_DEPRECATED SCM
scm_sym2ovcell (SCM sym
, SCM obarray
);
211 SCM_DEPRECATED SCM
scm_intern_obarray_soft (const char *name
, size_t len
,
212 SCM obarray
, unsigned int softness
);
213 SCM_DEPRECATED SCM
scm_intern_obarray (const char *name
, size_t len
, SCM obarray
);
214 SCM_DEPRECATED SCM
scm_symbol_value0 (const char *name
);
216 SCM_DEPRECATED SCM
scm_string_to_obarray_symbol (SCM o
, SCM s
, SCM softp
);
217 SCM_DEPRECATED SCM
scm_intern_symbol (SCM o
, SCM s
);
218 SCM_DEPRECATED SCM
scm_unintern_symbol (SCM o
, SCM s
);
219 SCM_DEPRECATED SCM
scm_symbol_binding (SCM o
, SCM s
);
221 /* This name has been reused for real uninterned symbols. */
222 SCM_DEPRECATED SCM
scm_symbol_interned_p (SCM o
, SCM s
);
224 SCM_DEPRECATED SCM
scm_symbol_bound_p (SCM o
, SCM s
);
225 SCM_DEPRECATED SCM
scm_symbol_set_x (SCM o
, SCM s
, SCM v
);
227 SCM_DEPRECATED SCM
scm_gentemp (SCM prefix
, SCM obarray
);
229 #define SCM_OPDIRP(x) (SCM_DIRP (x) && (SCM_DIR_OPEN_P (x)))
230 #define scm_fport scm_t_fport
231 #define scm_option scm_t_option
232 #define scm_srcprops scm_t_srcprops
233 #define scm_srcprops_chunk scm_t_srcprops_chunk
234 #define scm_array scm_t_array
235 #define scm_array_dim scm_t_array_dim
236 #define SCM_FUNC_NAME (scm_makfrom0str (FUNC_NAME))
238 #define SCM_WTA(pos, scm) \
239 do { scm_wta (scm, (char *) pos, FUNC_NAME); } while (0)
241 #define RETURN_SCM_WTA(pos, scm) \
242 do { return scm_wta (scm, (char *) pos, FUNC_NAME); } while (0)
244 #define SCM_VALIDATE_NUMBER_COPY(pos, z, cvar) \
246 if (SCM_I_INUMP (z)) \
247 cvar = (double) SCM_I_INUM (z); \
248 else if (SCM_REALP (z)) \
249 cvar = SCM_REAL_VALUE (z); \
250 else if (SCM_BIGP (z)) \
251 cvar = scm_i_big2dbl (z); \
255 SCM_WRONG_TYPE_ARG (pos, z); \
259 #define SCM_VALIDATE_NUMBER_DEF_COPY(pos, number, def, cvar) \
261 if (SCM_UNBNDP (number)) \
264 SCM_VALIDATE_NUMBER_COPY(pos, number, cvar); \
267 #define SCM_VALIDATE_OPDIR(pos, port) SCM_MAKE_VALIDATE (pos, port, OPDIRP)
269 /* Deprecated because we can not safely cast a SCM* to a scm_t_bits*
272 #define SCM_CELL_WORD_LOC(x, n) ((scm_t_bits*)SCM_CELL_OBJECT_LOC((x),(n)))
274 /* Users shouldn't know about INUMs.
277 SCM_DEPRECATED SCM
scm_i_makinum (scm_t_signed_bits val
);
278 SCM_DEPRECATED
int scm_i_inump (SCM obj
);
279 SCM_DEPRECATED scm_t_signed_bits
scm_i_inum (SCM obj
);
281 #define SCM_MAKINUM(x) scm_i_makinum(x)
282 #define SCM_INUM(x) scm_i_inum(x)
283 #define SCM_INUMP(x) scm_i_inump(x)
284 #define SCM_NINUMP(x) (!SCM_INUMP(x))
286 #define SCM_VALIDATE_INUM(pos, k) SCM_MAKE_VALIDATE_MSG (pos, k, INUMP, "exact integer")
288 #define SCM_VALIDATE_INUM_COPY(pos, k, cvar) \
290 SCM_ASSERT (SCM_I_INUMP (k), k, pos, FUNC_NAME); \
291 cvar = SCM_I_INUM (k); \
294 #define SCM_VALIDATE_BIGINT(pos, k) SCM_MAKE_VALIDATE_MSG (pos, k, BIGP, "bignum")
296 #define SCM_VALIDATE_INUM_MIN(pos, k, min) \
298 SCM_ASSERT (SCM_I_INUMP(k), k, pos, FUNC_NAME); \
299 SCM_ASSERT_RANGE (pos, k, (SCM_I_INUM (k) >= min)); \
302 #define SCM_VALIDATE_INUM_MIN_COPY(pos, k, min, cvar) \
304 SCM_ASSERT (SCM_I_INUMP (k), k, pos, FUNC_NAME); \
305 SCM_ASSERT_RANGE (pos, k, (SCM_I_INUM (k) >= min)); \
306 cvar = SCM_INUM (k); \
309 #define SCM_VALIDATE_INUM_MIN_DEF_COPY(pos, k, min, default, cvar) \
311 if (SCM_UNBNDP (k)) \
312 k = SCM_I_MAKINUM (default); \
313 SCM_ASSERT (SCM_I_INUMP (k), k, pos, FUNC_NAME); \
314 SCM_ASSERT_RANGE (pos, k, (SCM_I_INUM (k) >= min)); \
315 cvar = SCM_INUM (k); \
318 #define SCM_VALIDATE_INUM_DEF(pos, k, default) \
320 if (SCM_UNBNDP (k)) \
321 k = SCM_I_MAKINUM (default); \
322 else SCM_ASSERT (SCM_I_INUMP (k), k, pos, FUNC_NAME); \
325 #define SCM_VALIDATE_INUM_DEF_COPY(pos, k, default, cvar) \
327 if (SCM_UNBNDP (k)) \
329 k = SCM_I_MAKINUM (default); \
334 SCM_ASSERT (SCM_I_INUMP (k), k, pos, FUNC_NAME); \
335 cvar = SCM_INUM (k); \
340 #define SCM_VALIDATE_INUM_RANGE(pos, k, low, high) \
341 do { SCM_ASSERT(SCM_I_INUMP(k), k, pos, FUNC_NAME); \
342 SCM_ASSERT_RANGE(pos, k, \
343 (SCM_I_INUM (k) >= low && \
344 SCM_I_INUM (k) < high)); \
347 #define SCM_VALIDATE_INUM_RANGE_COPY(pos, k, low, high, cvar) \
349 SCM_ASSERT (SCM_INUMP (k), k, pos, FUNC_NAME); \
350 SCM_ASSERT_RANGE (pos, k, low <= SCM_INUM (k) && SCM_INUM (k) < high); \
351 cvar = SCM_INUM (k); \
354 #define SCM_STRING_COERCE_0TERMINATION_X(x) (x)
356 /* XXX - buggy interface, STR might not be large enough.
358 Converts the given Scheme string OBJ into a C string, containing a copy
359 of OBJ's content with a trailing null byte. If LENP is non-NULL, set
360 *LENP to the string's length.
362 When STR is non-NULL it receives the copy and is returned by the function,
363 otherwise new memory is allocated and the caller is responsible for
364 freeing it via free(). If out of memory, NULL is returned.
366 Note that Scheme strings may contain arbitrary data, including null
367 characters. This means that null termination is not a reliable way to
368 determine the length of the returned value. However, the function always
369 copies the complete contents of OBJ, and sets *LENP to the length of the
370 scheme string (if LENP is non-null).
372 SCM_DEPRECATED
char *scm_c_string2str (SCM obj
, char *str
, size_t *lenp
);
374 /* XXX - buggy interface, you don't know how many bytes have been copied.
376 Copy LEN characters at START from the Scheme string OBJ to memory
377 at STR. START is an index into OBJ; zero means the beginning of
378 the string. STR has already been allocated by the caller.
380 If START + LEN is off the end of OBJ, silently truncate the source
381 region to fit the string. If truncation occurs, the corresponding
382 area of STR is left unchanged.
384 SCM_DEPRECATED
char *scm_c_substring2str (SCM obj
, char *str
, size_t start
, size_t len
);
386 SCM_DEPRECATED
char *scm_c_symbol2str (SCM obj
, char *str
, size_t *lenp
);
388 /* Deprecated because the names belong to what is now
389 scm_truncate_number and scm_round_number.
391 SCM_DEPRECATED
double scm_truncate (double x
);
392 SCM_DEPRECATED
double scm_round (double x
);
393 /* Deprecated, use scm_expt */
394 SCM_DEPRECATED SCM
scm_sys_expt (SCM x
, SCM y
);
396 /* if your platform doesn't have asinh et al */
397 SCM_API
double scm_asinh (double x
);
398 SCM_API
double scm_acosh (double x
);
399 SCM_API
double scm_atanh (double x
);
400 SCM_API SCM
scm_sys_atan2 (SCM z1
, SCM z2
);
402 /* Deprecated because we don't want people to access the internal
403 representation of strings directly.
406 #define SCM_VALIDATE_STRING_COPY(pos, str, cvar) \
408 SCM_ASSERT (SCM_STRINGP (str), str, pos, FUNC_NAME); \
409 cvar = SCM_STRING_CHARS(str); \
412 /* validate a string and optional start/end arguments which default to
413 0/string-len. this is unrelated to the old shared substring
414 support, so please do not deprecate it :) */
415 #define SCM_VALIDATE_SUBSTRING_SPEC_COPY(pos_str, str, c_str, \
416 pos_start, start, c_start,\
417 pos_end, end, c_end) \
419 SCM_VALIDATE_STRING_COPY (pos_str, str, c_str);\
420 c_start = SCM_UNBNDP(start)? 0 : scm_to_size_t (start);\
421 c_end = SCM_UNBNDP(end)? SCM_STRING_LENGTH(str) : scm_to_size_t (end);\
422 SCM_ASSERT_RANGE (pos_start, start,\
424 && (size_t) c_start <= SCM_STRING_LENGTH (str));\
425 SCM_ASSERT_RANGE (pos_end, end,\
427 && (size_t) c_end <= SCM_STRING_LENGTH (str));\
430 /* Deprecated because we don't want people to access the internals of
434 SCM_DEPRECATED
char *scm_i_deprecated_symbol_chars (SCM sym
);
435 SCM_DEPRECATED
size_t scm_i_deprecated_symbol_length (SCM sym
);
437 #define SCM_SYMBOL_CHARS(x) scm_i_deprecated_symbol_chars(x)
438 #define SCM_SYMBOL_LENGTH(x) scm_i_deprecated_symbol_length(x)
440 /* Deprecated because the macros used to evaluate the arguments more
441 than once and because the symbol of a keyword now has no dash.
444 SCM_DEPRECATED
int scm_i_keywordp (SCM obj
);
445 SCM_DEPRECATED SCM
scm_i_keywordsym (SCM keyword
);
447 #define SCM_KEYWORDP(x) scm_i_keywordp(x)
448 #define SCM_KEYWORDSYM(x) scm_i_keywordsym(x)
450 /* Deprecated because we don't want to hand out unprotected pointers
451 to arrays, vectors, etc. */
453 #define SCM_VECTOR_MAX_LENGTH ((1L << 24) - 1)
455 SCM_DEPRECATED
int scm_i_vectorp (SCM x
);
456 SCM_DEPRECATED
unsigned long scm_i_vector_length (SCM x
);
457 SCM_DEPRECATED
const SCM
*scm_i_velts (SCM x
);
458 SCM_DEPRECATED SCM
*scm_i_writable_velts (SCM x
);
459 SCM_DEPRECATED SCM
scm_i_vector_ref (SCM x
, size_t idx
);
460 SCM_DEPRECATED
void scm_i_vector_set (SCM x
, size_t idx
, SCM val
);
461 SCM_DEPRECATED SCM
scm_vector_equal_p (SCM x
, SCM y
);
463 #define SCM_VECTORP(x) scm_i_vectorp(x)
464 #define SCM_VECTOR_LENGTH(x) scm_i_vector_length(x)
465 #define SCM_VELTS(x) scm_i_velts(x)
466 #define SCM_WRITABLE_VELTS(x) scm_i_writable_velts(x)
467 #define SCM_VECTOR_REF(x,y) scm_i_vector_ref(x,y)
468 #define SCM_VECTOR_SET(x,y,z) scm_i_vector_set(x,y,z)
470 typedef scm_i_t_array scm_t_array
;
472 SCM_DEPRECATED
int scm_i_arrayp (SCM a
);
473 SCM_DEPRECATED
size_t scm_i_array_ndim (SCM a
);
474 SCM_DEPRECATED
int scm_i_array_contp (SCM a
);
475 SCM_DEPRECATED scm_t_array
*scm_i_array_mem (SCM a
);
476 SCM_DEPRECATED SCM
scm_i_array_v (SCM a
);
477 SCM_DEPRECATED
size_t scm_i_array_base (SCM a
);
478 SCM_DEPRECATED scm_t_array_dim
*scm_i_array_dims (SCM a
);
480 #define SCM_ARRAYP(a) scm_i_arrayp(a)
481 #define SCM_ARRAY_NDIM(a) scm_i_array_ndim(a)
482 #define SCM_ARRAY_CONTP(a) scm_i_array_contp(a)
483 #define SCM_ARRAY_MEM(a) scm_i_array_mem(a)
484 #define SCM_ARRAY_V(a) scm_i_array_v(a)
485 #define SCM_ARRAY_BASE(a) scm_i_array_base(a)
486 #define SCM_ARRAY_DIMS(a) scm_i_array_dims(a)
488 SCM_DEPRECATED SCM
scm_uniform_vector_read_x (SCM v
, SCM port_or_fd
,
490 SCM_DEPRECATED SCM
scm_uniform_vector_write (SCM v
, SCM port_or_fd
,
492 SCM_DEPRECATED SCM
scm_uniform_array_read_x (SCM ra
, SCM port_or_fd
,
494 SCM_DEPRECATED SCM
scm_uniform_array_write (SCM v
, SCM port_or_fd
,
497 /* Deprecated because they should not be lvalues and we want people to
498 use the official interfaces.
501 #define scm_cur_inp scm_i_cur_inp ()
502 #define scm_cur_outp scm_i_cur_outp ()
503 #define scm_cur_errp scm_i_cur_errp ()
504 #define scm_cur_loadp scm_i_cur_loadp ()
505 #define scm_progargs scm_i_progargs ()
506 #define scm_dynwinds scm_i_deprecated_dynwinds ()
507 #define scm_stack_base scm_i_stack_base ()
509 SCM_DEPRECATED SCM
scm_i_cur_inp (void);
510 SCM_DEPRECATED SCM
scm_i_cur_outp (void);
511 SCM_DEPRECATED SCM
scm_i_cur_errp (void);
512 SCM_DEPRECATED SCM
scm_i_cur_loadp (void);
513 SCM_DEPRECATED SCM
scm_i_progargs (void);
514 SCM_DEPRECATED SCM
scm_i_deprecated_dynwinds (void);
515 SCM_DEPRECATED SCM_STACKITEM
*scm_i_stack_base (void);
517 /* Deprecated because it evaluates its argument twice.
519 #define SCM_FLUIDP(x) scm_i_fluidp (x)
520 SCM_DEPRECATED
int scm_i_fluidp (SCM x
);
522 /* Deprecated in Guile 1.9.5 on 2009-11-15 because these are IPv4-only
523 functions which are deprecated upstream. */
525 SCM_DEPRECATED SCM
scm_inet_aton (SCM address
);
526 SCM_DEPRECATED SCM
scm_inet_ntoa (SCM inetid
);
528 /* In the old days, SCM_CRITICAL_SECTION_START stopped signal handlers
529 from running, since in those days the handler directly ran scheme
530 code, and that had to be avoided when the heap was not in a
531 consistent state etc. And since the scheme code could do a stack
532 swapping new continuation etc, signals had to be deferred around
533 various C library functions which were not safe or not known to be
534 safe to swap away, which was a lot of stuff.
536 These days signals are implemented with asyncs and don't directly
537 run scheme code in the handler, but hold it until an SCM_TICK etc
538 where it will be safe. This means interrupt protection is not
539 needed and SCM_CRITICAL_SECTION_START / SCM_CRITICAL_SECTION_END is
540 something of an anachronism.
542 What past SCM_CRITICAL_SECTION_START usage also did though was
543 indicate code that was not reentrant, ie. could not be reentered by
544 signal handler code. The present definitions are a mutex lock,
545 affording that reentrancy protection against the new guile 1.8
546 free-running posix threads.
548 One big problem with the present defintions though is that code which
549 throws an error from within a DEFER/ALLOW region will leave the
550 defer_mutex locked and hence hang other threads that attempt to enter a
551 similar DEFER/ALLOW region.
554 SCM_DEPRECATED
void scm_i_defer_ints_etc (void);
555 #define SCM_DEFER_INTS scm_i_defer_ints_etc ()
556 #define SCM_ALLOW_INTS scm_i_defer_ints_etc ()
557 #define SCM_REDEFER_INTS scm_i_defer_ints_etc ()
558 #define SCM_REALLOW_INTS scm_i_defer_ints_etc ()
560 /* In the old days (pre-1.8), this macro was sometimes used as an lvalue as
561 in "scm_mask_ints = 1" to block async execution. It no longer works. */
562 #define scm_mask_ints (scm_i_mask_ints ())
564 SCM_DEPRECATED
int scm_i_mask_ints (void);
566 /* Deprecated since they are unnecessary and had not been documented.
568 SCM_DEPRECATED SCM
scm_guard (SCM guardian
, SCM obj
, int throw_p
);
569 SCM_DEPRECATED SCM
scm_get_one_zombie (SCM guardian
);
571 /* Deprecated since guardians no longer have these special features.
573 SCM_DEPRECATED SCM
scm_destroy_guardian_x (SCM guardian
);
574 SCM_DEPRECATED SCM
scm_guardian_greedy_p (SCM guardian
);
575 SCM_DEPRECATED SCM
scm_guardian_destroyed_p (SCM guardian
);
578 /* GC-related things deprecated with the move to BDW-GC starting from 1.9.3
581 SCM_DEPRECATED
unsigned long scm_mallocated
;
582 SCM_DEPRECATED
unsigned long scm_mtrigger
;
584 SCM_DEPRECATED
size_t scm_max_segment_size
;
586 #if defined (GUILE_DEBUG) || defined (GUILE_DEBUG_FREELIST)
587 SCM_DEPRECATED SCM
scm_map_free_list (void);
590 #if defined (GUILE_DEBUG_FREELIST)
591 SCM_DEPRECATED SCM
scm_gc_set_debug_check_freelist_x (SCM flag
);
596 /* Deprecated 2009-11-27, scm_call_N is sufficient */
597 SCM_DEPRECATED scm_t_trampoline_0
scm_trampoline_0 (SCM proc
);
598 SCM_DEPRECATED scm_t_trampoline_1
scm_trampoline_1 (SCM proc
);
599 SCM_DEPRECATED scm_t_trampoline_2
scm_trampoline_2 (SCM proc
);
603 /* Deprecated 2009-12-06, use the procedures instead */
604 #define SCM_PROCEDURE_WITH_SETTER_P(obj) (scm_is_true (scm_procedure_with_setter_p (obj)))
605 #define SCM_PROCEDURE(obj) SCM_STRUCT_PROCEDURE (obj, 0)
606 #define SCM_SETTER(obj) SCM_STRUCT_SETTER (obj, 1)
610 /* Deprecated 2010-01-05, use SCM_PRIMITIVE_P instead */
611 SCM_DEPRECATED
int scm_i_subr_p (SCM x
);
612 #define scm_subr_p(x) (scm_i_subr_p (x))
616 /* Deprecated 2010-01-31, use with-throw-handler instead */
617 SCM_DEPRECATED SCM
scm_lazy_catch (SCM tag
, SCM thunk
, SCM handler
);
618 SCM_DEPRECATED SCM
scm_internal_lazy_catch (SCM tag
,
619 scm_t_catch_body body
,
621 scm_t_catch_handler handler
,
626 /* Deprecated 2010-03-31, use array-equal? instead */
627 SCM_DEPRECATED SCM
scm_raequal (SCM ra0
, SCM ra1
);
629 /* Deprecated 2010-04-01, use the dynamic FFI instead */
630 SCM_DEPRECATED SCM
scm_dynamic_args_call (SCM symb
, SCM dobj
, SCM args
);
632 /* Deprecated 2010-05-12, no replacement */
633 SCM_DEPRECATED
int scm_badargsp (SCM formals
, SCM args
);
635 /* Deprecated 2010-06-19, use call-with-error-handling instead */
636 SCM_DEPRECATED SCM
scm_internal_stack_catch (SCM tag
,
637 scm_t_catch_body body
,
639 scm_t_catch_handler handler
,
644 /* These functions were "discouraged" in 1.8, and now are deprecated. */
646 /* scm_to_int, scm_from_int are the official functions to do the job,
647 but there is nothing wrong with using scm_num2int, etc.
649 These could be trivially defined via macros, but we leave them as
650 functions since existing code may take their addresses.
653 SCM_DEPRECATED SCM
scm_short2num (short n
);
654 SCM_DEPRECATED SCM
scm_ushort2num (unsigned short n
);
655 SCM_DEPRECATED SCM
scm_int2num (int n
);
656 SCM_DEPRECATED SCM
scm_uint2num (unsigned int n
);
657 SCM_DEPRECATED SCM
scm_long2num (long n
);
658 SCM_DEPRECATED SCM
scm_ulong2num (unsigned long n
);
659 SCM_DEPRECATED SCM
scm_size2num (size_t n
);
660 SCM_DEPRECATED SCM
scm_ptrdiff2num (scm_t_ptrdiff n
);
661 SCM_DEPRECATED
short scm_num2short (SCM num
, unsigned long int pos
,
662 const char *s_caller
);
663 SCM_DEPRECATED
unsigned short scm_num2ushort (SCM num
, unsigned long int pos
,
664 const char *s_caller
);
665 SCM_DEPRECATED
int scm_num2int (SCM num
, unsigned long int pos
,
666 const char *s_caller
);
667 SCM_DEPRECATED
unsigned int scm_num2uint (SCM num
, unsigned long int pos
,
668 const char *s_caller
);
669 SCM_DEPRECATED
long scm_num2long (SCM num
, unsigned long int pos
,
670 const char *s_caller
);
671 SCM_DEPRECATED
unsigned long scm_num2ulong (SCM num
, unsigned long int pos
,
672 const char *s_caller
);
673 SCM_DEPRECATED scm_t_ptrdiff
scm_num2ptrdiff (SCM num
, unsigned long int pos
,
674 const char *s_caller
);
675 SCM_DEPRECATED
size_t scm_num2size (SCM num
, unsigned long int pos
,
676 const char *s_caller
);
677 #if SCM_SIZEOF_LONG_LONG != 0
678 SCM_DEPRECATED SCM
scm_long_long2num (long long sl
);
679 SCM_DEPRECATED SCM
scm_ulong_long2num (unsigned long long sl
);
680 SCM_DEPRECATED
long long scm_num2long_long (SCM num
, unsigned long int pos
,
681 const char *s_caller
);
682 SCM_DEPRECATED
unsigned long long scm_num2ulong_long (SCM num
, unsigned long int pos
,
683 const char *s_caller
);
686 SCM_DEPRECATED SCM
scm_make_real (double x
);
687 SCM_DEPRECATED
double scm_num2dbl (SCM a
, const char * why
);
688 SCM_DEPRECATED SCM
scm_float2num (float n
);
689 SCM_DEPRECATED SCM
scm_double2num (double n
);
691 /* The next two are implemented in numbers.c since they use features
692 only available there.
694 SCM_DEPRECATED
float scm_num2float (SCM num
, unsigned long int pos
,
695 const char *s_caller
);
696 SCM_DEPRECATED
double scm_num2double (SCM num
, unsigned long int pos
,
697 const char *s_caller
);
699 SCM_DEPRECATED SCM
scm_make_complex (double x
, double y
);
701 /* Discouraged because they don't make the encoding explicit.
704 SCM_DEPRECATED SCM
scm_mem2symbol (const char *mem
, size_t len
);
705 SCM_DEPRECATED SCM
scm_mem2uninterned_symbol (const char *mem
, size_t len
);
706 SCM_DEPRECATED SCM
scm_str2symbol (const char *str
);
708 SCM_DEPRECATED SCM
scm_take_str (char *s
, size_t len
);
709 SCM_DEPRECATED SCM
scm_take0str (char *s
);
710 SCM_DEPRECATED SCM
scm_mem2string (const char *src
, size_t len
);
711 SCM_DEPRECATED SCM
scm_str2string (const char *src
);
712 SCM_DEPRECATED SCM
scm_makfrom0str (const char *src
);
713 SCM_DEPRECATED SCM
scm_makfrom0str_opt (const char *src
);
715 /* Discouraged because scm_c_make_string has a better name and is more
716 consistent with make-string.
718 SCM_DEPRECATED SCM
scm_allocate_string (size_t len
);
720 /* Discouraged because they are just strange.
723 SCM_DEPRECATED SCM
scm_make_keyword_from_dash_symbol (SCM symbol
);
724 SCM_DEPRECATED SCM
scm_keyword_dash_symbol (SCM keyword
);
726 /* Discouraged because it does not state what encoding S is in.
729 SCM_DEPRECATED SCM
scm_c_make_keyword (const char *s
);
731 SCM_DEPRECATED
unsigned int scm_thread_sleep (unsigned int);
732 SCM_DEPRECATED
unsigned long scm_thread_usleep (unsigned long);
733 SCM_DEPRECATED
int scm_internal_select (int fds
,
737 struct timeval
*timeout
);
740 void scm_i_init_deprecated (void);
744 #endif /* SCM_DEPRECATED_H */