1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 11:50:28 +02:00
Commit graph

140 commits

Author SHA1 Message Date
Michael Gran
806f1ded95 Avoid type-punning warning in scm_gentemp
Int and size_t may not have the same storage size

* libguile/deprecated.c (scm_gentemp): use size_t for string length
2009-08-23 09:28:58 -07:00
Michael Gran
7f5946427e Use string and symbol accessors with obarrays and keyword-dash-symbols
* libguile/deprecated.c (intern_obarray_soft): new function
  (scm_intern_obarray_soft, scm_string_to_obarray_symbol): use
  intern_obarray_soft
  (scm_gentemp): don't unpack string chars, use intern_obarray_soft

* libguile/discouraged.c (scm_make_keyword_from_dash_symbol): use
  symbol accessor
2009-08-20 21:39:44 -07:00
Andy Wingo
1030b45049 move generic array foo out to its own file
* libguile/arrays.h:
* libguile/arrays.c:
* libguile/generalized-arrays.h:
* libguile/generalized-arrays.c: Move some generic functionality out of
  arrays.c to a new file.

* libguile/array-map.c:
* libguile/deprecated.c:
* libguile/init.c: Update includers.
2009-07-19 15:15:44 +02:00
Andy Wingo
66b9d7d304 remove enclosed arrays
* libguile/arrays.h:
* libguile/array-map.c:
* libguile/arrays.c:
* libguile/deprecated.c: Remove "enclosed arrays". The only user-facing
  procedures that this affects are scm_enclose_array / enclose-array. If
  enclosed arrays are added back, it should be through the generic array
  interface; but really, it sounds like something that would be better
  implemented in Scheme.
2009-07-19 15:15:44 +02:00
Neil Jerram
53befeb700 Change Guile license to LGPLv3+
(Not quite finished, the following will be done tomorrow.
   module/srfi/*.scm
   module/rnrs/*.scm
   module/scripts/*.scm
   testsuite/*.scm
   guile-readline/*
)
2009-06-17 00:22:09 +01:00
Ludovic Courtès
dbb605f575 Include <config.h> in all C files; use #ifdef HAVE_CONFIG_H' rather than #if'. 2008-09-13 15:35:27 +02:00
Ludovic Courtès
6eadcdab98 Work around `#define except' on Tru64. 2008-06-02 21:43:07 +02:00
Kevin Ryde
2b829bbb3d merge from 1.8 branch 2006-04-17 00:05:42 +00:00
Marius Vollmer
06c1d90009 * gc-mark.c (scm_mark_all): Do not rely on hooks to run the weak
hashtable and guardian machinery but call the relevant functions
directly.

* guardians.h, guardians.c, deprecated.h,
deprecated.c (scm_destroy_guardian_x, scm_guardian_greedy_p,
scm_guardian_destroyed_p, scm_guard, scm_get_one_zombie):
Deprecated and moved into deprecated.[ch].

* guardians.h, guardians.c: Mostly rewritten.
(scm_i_init_guardians_for_gc,
scm_i_identify_inaccessible_guardeds,
scm_i_mark_inaccessible_guardeds): New.

* weaks.h, weaks.c (SCM_I_WVECT_TYPE, SCM_I_SET_WVECT_TYPE): New.
(SCM_I_WVECT_N_ITEMS, SCM_I_SET_WVECT_N_ITEMS): New.
(SCM_WVECTF_NOSCAN, SCM_WVECT_NOSCAN_P): Removed.
(scm_weaks_prehistory): Removed.
(scm_i_init_weak_vectors_for_gc, scm_i_mark_weak_vector,
scm_i_mark_weak_vectors_non_weaks,
scm_i_remove_weaks_from_weak_vectors, scm_i_remove_weaks): New.
(scm_weak_vector_gc_init, scm_mark_weak_vector_spines,
scm_scan_weak_vectors): Removed.

* hashtab.h (scm_i_scan_weak_hashtables): New.
* hashtab.c (make_hash_table, scm_i_rehash): Do not use
SCM_WVECTF_NOSCAN.
(hashtable_print): Use SCM_HASHTABLE_N_ITEMS instead of
t->n_items.
(scan_weak_hashtables, scm_i_scan_weak_hashtables): Renamed former
to latter.  Do not scan the alists themselves, this is done by the
weak vector code now.  Just update the element count.

* vectors.h (SCM_I_WVECT_TYPE, SCM_I_WVECT_EXTRA): Renamed former
to latter.  The type is now only part of the cell word.
(SCM_I_SET_WVECT_TYPE, SCM_I_SET_WVECT_EXTRA): Likewise.

* init.c (scm_i_init_guile): Do not call scm_weaks_prehistory.
2005-07-31 23:04:36 +00:00
Marius Vollmer
92205699d0 The FSF has a new address. 2005-05-23 19:57:22 +00:00
Marius Vollmer
4e047c3e46 Include "libguile/async.h" for SCM_CRITICAL_SECTION_START/END. 2005-03-07 21:42:02 +00:00
Marius Vollmer
9de87eea47 See ChangeLog from 2005-03-02. 2005-03-02 20:42:01 +00:00
Marius Vollmer
fe78c51aa2 Turn all deprecated features that once were macros but are now
functions back into macros.
2005-01-12 11:10:02 +00:00
Marius Vollmer
1f366ef7f0 (SCM_ARRAYP, SCM_ARRAY_NDIM, SCM_ARRAY_CONTP, SCM_ARRAY_MEM,
SCM_ARRAY_V, SCM_ARRAY_BASE, SCM_ARRAY_DIMS, scm_t_array): New
deprecated versions.
2005-01-11 16:55:29 +00:00
Marius Vollmer
a725fa951c (SCM_CHARS, SCM_UCHARS, SCM_LENGTH, scm_i_object_chars,
scm_i_object_length): Brought back from the dead.
2005-01-10 17:42:23 +00:00
Marius Vollmer
354116f7c2 (SCM_BITVEC_REF, SCM_BITVEC_SET, SCM_BITVEC_CLR): Removed.
(scm_vector_elements, scm_vector_writable_elements,
scm_generalized_vector_get_handle): Moved to vectors.[hc] from
unif.[hc].
(SCM_SIMPLE_VECTOR_LOC): Removed.
(SCM_VECTOR_MAX_LENGTH, SCM_VECTOR_LENGTH, SCM_VELTS,
SCM_WRITABLE_VELTS, SCM_VECTOR_REF, SCM_VECTOR_SET,
scm_vector_equal_p): Moved from vectors.[hc] to deprecated.[hc].
(scm_vector_equal_p, scm_i_vector_equal_p): Renamed former to
latter.  Changed use in eq.c.
2005-01-07 15:44:09 +00:00
Marius Vollmer
4057a3e05a Use new vector elements API or simple vector API, as appropriate.
Removed SCM_HAVE_ARRAYS ifdefery.  Replaced all uses of
SCM_HASHTABLE_BUCKETS with SCM_HASHTABLE_BUCKET.
2005-01-02 20:49:04 +00:00
Marius Vollmer
db74ed0306 Include discouraged.h and keywords.h. Fixed silly typo. 2004-10-04 18:00:53 +00:00
Marius Vollmer
265a7997fb * keywords.h, keywords.c, deprecated.h, deprecated.c
(SCM_KEYWORDP, SCM_KEYWORDSYM): Deprecated and implemented in
terms of scm_is_keyword and scm_keyword_dash_symbol.

* keywords.h, keywords.c, discouraged.h, discouraged.c
(scm_make_keyword_from_dash_symbol, scm_keyword_dash_symbol,
scm_c_make_keyword): Discouraged.

* keywords.h, keywords.c (scm_symbol_to_keyword,
scm_keyword_to_symbol): Implemented in C.
(scm_is_keyword, scm_from_locale_keyword,
scm_from_locale_keywordn): New.
2004-10-04 17:02:01 +00:00
Marius Vollmer
d2e53ed6f8 *** empty log message *** 2004-09-22 17:41:37 +00:00
Marius Vollmer
c44ca4fe75 Include "srfi-13.h" instead of "strop.h". 2004-08-24 22:12:37 +00:00
Marius Vollmer
ba16a103a4 (SCM_SYMBOL_CHARS): Cast away const in return.
(SCM_SYMBOL_LENGTH): It's scm_i_symbol_length, not
scm_c_symbol_length.
2004-08-19 20:36:29 +00:00
Marius Vollmer
3ee86942a7 * strings.h, strings.c: (scm_i_string_chars, scm_i_string_length,
scm_i_string_writable_chars, scm_i_string_stop_writing): New, to
replace SCM_I_STRING_CHARS and SCM_I_STRING_LENGTH.  Updated all
uses.
(scm_i_make_string, scm_c_make_string): New, to replace
scm_allocate_string.  Updated all uses.
(SCM_STRINGP, SCM_STRING_CHARS, SCM_STRING_UCHARS,
SCM_STRING_LENGTH): Deprecated.
(scm_allocate_string, scm_take_str, scm_take0str, scm_mem2string,
scm_str2string, scm_makfrom0str, scm_makfrom0str_opt):
Discouraged.  Replaced all uses with scm_from_locale_string or
similar, as appropriate.
(scm_c_string_length, scm_c_string_ref, scm_c_string_set_x,
scm_c_substring, scm_c_substring_shared, scm_c_substring_copy,
scm_substring_shared, scm_substring_copy): New.

* symbols.c, symbols.h (SCM_SYMBOLP, SCM_SYMBOL_FUNC,
SCM_SET_SYMBOL_FUNC, SCM_SYMBOL_PROPS, SCM_SET_SYMBOL_PROPS,
SCM_SYMBOL_HASH, SCM_SYMBOL_INTERNED_P, scm_mem2symbol,
scm_str2symbol, scm_mem2uninterned_symbol): Discouraged.
(SCM_SYMBOL_LENGTH, SCM_SYMBOL_CHARS, scm_c_symbol2str):
Deprecated.
(SCM_MAKE_SYMBOL_TAG, SCM_SET_SYMBOL_LENGTH, SCM_SET_SYMBOL_CHARS,
SCM_PROP_SLOTS, SCM_SET_PROP_SLOTS): Removed.
(scm_is_symbol, scm_from_locale_symbol, scm_from_locale_symboln):
New, to replace scm_str2symbol and scm_mem2symbol, respectively.
Updated all uses.
(scm_gensym): Generate only the number suffix in the buffer, just
string-append the prefix.
2004-08-19 16:49:42 +00:00
Marius Vollmer
c829a4274f * strings.h, deprecated.h (SCM_STRING_COERCE_0TERMINATION_X):
Moved from string.h to deprecated.h.

* deprecated.c, deprecated.h (SCM_CHARS, SCM_LENGTH): Removed.

* strings.h, strings.c (SCM_MAKE_STRING_TAG): Rename dto
SCM_I_MAKE_STRING_TAG, changed all uses.
(SCM_STRING_CHARS, SCM_STRING_UCHARS, SCM_STRING_LENGTH): Renamed
to SCM_I_STRING_CHARS, SCM_I_STRING_UCHARS, and SCM_I_LENGTH
respectively.  For a short time, the old names are still there as
aliases.  Not all uses have been changed yet, but the ones in
strings.c have.
(SCM_STRING_MAX_LEN): Do not hardcode to 24 bits, compute from
SCM_T_BITS_MAX.
(scm_is_string, scm_from_locale_string, scm_from_locale_stringn,
scm_take_locale_string, scm_take_locale_stringn,
scm_to_locale_string, scm_to_locale_stringn,
scm_to_locale_stringbuf): New.
(scm_c_string2str, scm_c_substring2str): Deprecated by moving to
deprecated.[hc]. Implemented in terms of the new functions above.
(scm_take_str, scm_take0str, scm_mem2string, scm_str2string,
scm_makfrom0str): Reimplemented in terms of the new functions from
above.  They will be discouraged shortly.
(scm_substring): Do not use scm_mem2string.
(scm_i_allocate_string_pointers, scm_i_free_string_pointers): New,
to replace similar code from posix.c, simpos.c, and dynl.c.
(scm_string_append): Use memcpy instead of explicit loop.  Do not
use register keyword.  Use plain 'char' instead of 'unsigned
char'.
2004-08-10 13:20:59 +00:00
Marius Vollmer
3101f40f76 (scm_round, scm_truncate): Renamed to scm_c_round and scm_c_truncate;
deprecated versions installed in deprecated.h and deprecated.c.
Changed all uses.
2004-08-09 23:32:14 +00:00
Marius Vollmer
c71b07063e * discouraged.h, discouraged.c: New files.
* deprecated.h (SCM_FALSEP, SCM_NFALSEP, SCM_BOOLP, SCM_EQ_P,
SCM_NEGATE_BOOL, SCM_BOOL, SCM_BOOT_NOT): Promoted from being
deprecated to being discouraged by moving to discouraged.h.

* numbers.h, numbers.c, discouraged.h, discouraged.c
(scm_short2num, scm_ushort2num, scm_int2num, scm_uint2num,
scm_long2num, scm_ulong2num, scm_size2num, scm_ptrdiff2num,
scm_num2short, scm_num2ushort, scm_num2int, scm_num2uint,
scm_num2long, scm_num2ulong, scm_num2size, scm_num2ptrdiff,
scm_long_long2num, scm_ulong_long2num, scm_num2long_long,
scm_num2ulong_long): Discouraged by moving to discouraged.h and
discouraged.c and reimplementing in terms of scm_from_* and
scm_to_*.

* numbers.h, numbers.c: Removed GUILE_DEBUG code.
(scm_i_short2big, scm_i_ushort2big, scm_i_int2big, scm_i_uint2big,
scm_i_size2big, scm_i_ptrdiff2big): Removed.
(scm_i_long2big, scm_i_ulong2big): New, explicit definitions.
* conv-integer.i.c, conv-uinteger.i.c: Use them instead of
explicit code.
2004-08-02 15:57:04 +00:00
Marius Vollmer
bc36d0502b * tags.h, deprecated.h (SCM_EQ_P): Deprecated by moving it into
deprecated.h.  Replaced all uses with scm_is_eq.
2004-07-27 15:41:49 +00:00
Marius Vollmer
3aa13a0579 (SCM_INUMP, SCM_NINUMP, SCM_INUM): Deprecated by reenaming them to
SCM_I_INUMP, SCM_I_NINUMP and SCM_I_INUM, respectively and adding
deprecated versions to deprecated.h and deprecated.c.  Changed all
uses to either use the SCM_I_ variants or scm_is_*, scm_to_*, or
scm_from_*, as appropriate.
2004-07-23 15:29:27 +00:00
Marius Vollmer
5a572ca13c * numbers.h (SCM_MAKINUM, SCM_I_MAKINUM): Renamed SCM_MAKINUM to
SCM_I_MAKINUM and changed all uses.
* deprecated.h, deprecated.c (SCM_MAKINUM): Newly deprecated.
2004-07-08 15:41:48 +00:00
Marius Vollmer
7888309be8 * deprecated.h, boolean.h (SCM_FALSEP, SCM_NFALSEP, SCM_BOOL,
SCM_NEGATE_BOOL, SCM_BOOLP): Deprecated by moving into "deprecated.h".
Replaced all uses with scm_is_false, scm_is_true, scm_from_bool, and
scm_is_bool, respectively.
2004-07-06 10:59:25 +00:00
Dirk Herrmann
7e6e6b37ba Hide the implementation of ilocs and isyms in eval.c.
* deprecated.h (SCM_IFRINC, SCM_ICDR, SCM_IFRAME, SCM_IDIST,
	SCM_ICDRP), eval.c (SCM_IFRINC, SCM_ICDR, SCM_IFRAME, SCM_IDIST,
	SCM_ICDRP), eval.h (SCM_ICDR, SCM_IFRINC, SCM_IFRAME, SCM_IDIST,
	SCM_ICDRP): Deprecated and added to deprecated.h.  Moved from
	eval.h to eval.c.

	* deprecated.c (scm_isymnames), deprecated.h (scm_isymnames,
	SCM_ISYMNUM, SCM_ISYMCHARS), eval.c (SCM_ISYMNUM, isymnames,
	scm_unmemocopy, CEVAL), print.c (scm_isymnames), tags.h
	(SCM_ISYMNUM, scm_isymnames, SCM_ISYMCHARS): Deprecated
	scm_isymnames, SCM_ISYMNUM and SCM_ISYMCHARS and added to
	deprecated.[hc].  Moved scm_isymnames from print.c to eval.c and
	renamed to isymnames.  Moved SCM_ISYMNUM from tags.h to eval.c and
	renamed to ISYMNUM.

	* eval.c (scm_i_print_iloc, scm_i_print_isym), eval.h
	(scm_i_print_iloc, scm_i_print_isym), print.c (scm_iprin1):
	Extracted printing of ilocs and isyms to guile internal functions
	scm_i_print_iloc, scm_i_print_isym of eval.c.
2004-04-22 19:19:17 +00:00
Marius Vollmer
cc5c1b6606 (scm_strhash, scm_sym2ovcell_soft, scm_sym2ovcell,
scm_intern_obarray_soft, scm_intern_obarray, scm_symbol_value0,
scm_string_to_obarray_symbol scm_intern_symbol, scm_unintern_symbol,
scm_symbol_binding, scm_symbol_interned_p, scm_symbol_bound_p,
scm_symbol_set_x, scm_gentemp): Re-added from the release_1_6 branch.
2003-06-19 12:48:47 +00:00
Dirk Herrmann
e90c3a895d * deprecated.c, deprecated.h, eval.c, eval.h: Deprecated
scm_s_expression, scm_s_test, scm_s_body, scm_s_bindings,
	scm_s_variable, scm_s_clauses, scm_s_formals.  In eval.c the
	definitions are make static and renamed from scm_s_xxx to s_xxx.
	In deprecated.c the original definitions are copied.

	* deprecated.h, eval.c, eval: Deprecated SCM_EVALIM2, SCM_EVALIM,
	SCM_XEVAL and SCM_XEVALCAR.  The macro definitions are moved from
	eval.h into eval.c and a copy (slightly modified to work in user
	code) is placed into deprecated.h.

	* eval.c: Use the local static s_xxx definitions instead of the
	scm_s_xxx definitions throughout.
2003-06-02 20:54:21 +00:00
Dirk Herrmann
f8ba2197fa * deprecated.c (scm_read_and_eval_x): Fixed C99-ism. 2003-05-25 05:13:17 +00:00
Marius Vollmer
4abecea81c (scm_subr_entry, SCM_SUBR_DOC, scm_make_subr,
scm_make_subr_with_generic, scm_make_subr_opt,
scm_call_catching_errors, scm_make_smob_type_mfpe, scm_set_smob_mfpe,
scm_strprint_obj, scm_read_0str, scm_eval_0str, SCM_CHARS, SCM_UCHARS,
SCM_LENGTH): Re-added from the release_1_6 branch.  Some have been
slightly rewritten.  (scm_i_object_chars, scm_i_object_length): New,
to support SCM_CHARS, SCM_UCHARS, and SCM_LENTH.
2003-05-20 19:59:38 +00:00
Marius Vollmer
965445d4b3 (scm_makstr, scm_makfromstr, scm_variable_set_name_hint,
scm_builtin_variable, scm_internal_with_fluids, scm_make_gsubr,
scm_make_gsubr_with_generic, scm_create_hook, SCM_LIST0, SCM_LIST1,
SCM_LIST2, SCM_LIST3, SCM_LIST4, SCM_LIST5, SCM_LIST6, SCM_LIST7,
SCM_LIST8, SCM_LIST9, scm_listify, scm_sloppy_memq, scm_sloppy_memv,
scm_sloppy_member, scm_read_and_eval_x): Re-added from release_1_6
branch.
2003-05-20 19:14:20 +00:00
Marius Vollmer
a0454d7215 (scm_protect_object, scm_unprotect_object, SCM_SETAND_CAR,
SCM_SETOR_CAR, SCM_SET_AND_CDR, SCM_SET_OR_CDR, SCM_FREEP, SCM_NFREEP,
SCM_GC8MARKP, SCM_SETGC8MARK, SCM_CLRGC8MARK, SCM_GCTYP16, SCM_GCCDR,
scm_remember, scm_the_root_module, scm_make_module,
scm_ensure_user_module, scm_load_scheme_module, scm_port,
scm_ptob_descriptor, scm_port_rw_active, scm_close_all_ports_except):
New.
2003-04-30 14:50:53 +00:00
Marius Vollmer
73be1d9e8e Changed license terms to the plain LGPL thru-out. 2003-04-05 19:15:35 +00:00
Marius Vollmer
55d30fac0a More deprecated stuff. 2003-03-26 17:59:55 +00:00
Marius Vollmer
19e2247dc7 * deprecated.c, deprecated.h: New files, to collect deprecated
things in one place.
* Makefile.am: Added them in all the right places.
2003-03-26 17:02:31 +00:00