summaryrefslogtreecommitdiff
path: root/libguile/srfi-4.c
AgeCommit message (Collapse)AuthorFilesLines
2014-04-25Merge branch 'stable-2.0'v2.1.0Mark H Weaver1-2/+3
Conflicts: GUILE-VERSION NEWS guile-readline/ice-9/readline.scm libguile/async.c libguile/backtrace.c libguile/deprecated.h libguile/gc-malloc.c libguile/gdbint.c libguile/init.c libguile/ioext.c libguile/mallocs.c libguile/print.c libguile/rw.c libguile/scmsigs.c libguile/script.c libguile/simpos.c libguile/snarf.h libguile/strports.c libguile/threads.c libguile/vm-i-scheme.c libguile/vm-i-system.c module/srfi/srfi-18.scm test-suite/Makefile.am test-suite/standalone/test-num2integral.c
2014-03-19Fix breakage of SRFI-4 C accessorsAndy Wingo1-2/+3
* libguile/srfi-4.c (DEFINE_SRFI_4_C_FUNCS): Fix bad assumption that width was a byte width. Thanks very much to Barry Fishman for the report, and to Daniel Llorens for tracking it down. * test-suite/standalone/Makefile.am (test_srfi_4_CFLAGS): * test-suite/standalone/test-srfi-4.c: Add test.
2014-02-08Merge commit 'dc65b88d839c326889618112c4870ad3a64e9446'Andy Wingo1-43/+25
Conflicts: libguile/srfi-4.c
2014-02-08Simplify srfi-4 C implementationAndy Wingo1-43/+25
* libguile/srfi-4.c (DEFINE_SRFI_4_C_FUNCS): In the raw element accessors (e.g scm_u32vector_writable_elements), only permit bytevectors, as the constructors will only make bytevectors. This harmonizes with the Scheme interfaces as well, which expect packed bytevectors. (scm_make_srfi_4_vector): Knowing that the new value is a bytevector with base 0 and inc 1, simplify initialization.
2014-02-06Remove generalized-vectors.h includesDaniel Llorens1-1/+0
* libguile/srfi-4.c, libguile/uniform.h: ditto.
2011-05-07bytevectors have internal parent fieldAndy Wingo1-2/+3
* libguile/bytevectors.h (SCM_BYTEVECTOR_HEADER_SIZE): Bump, giving bytevectors another word: a parent pointer. Will allow for sub-bytevectors and efficient mmap bindings. * libguile/bytevectors.c (make_bytevector): (make_bytevector_from_buffer): Init parent to #f. (scm_c_take_bytevector, scm_c_take_typed_bytevector): Another argument, the parent, which gets set in the bytevector. * libguile/foreign.c (scm_pointer_to_bytevector): Use the parent field instead of registering a weak reference from bytevector to foreign pointer. * libguile/objcodes.c (scm_objcode_to_bytecode): Use the parent field to avoid copying the objcode. * libguile/srfi-4.c (DEFINE_SRFI_4_C_FUNCS): * libguile/strings.c (scm_from_stringn): * libguile/vm.c (really_make_boot_program): * libguile/r6rs-ports.c (scm_get_bytevector_some) (scm_get_bytevector_all, bytevector_output_port_procedure): Set the parent to #f.
2010-07-26remove SCM_HAVE_T_INT64, SCM_HAVE_T_UINT64Andy Wingo1-4/+0
* libguile/__scm.h: * libguile/numbers.h: * libguile/random.c: * libguile/srfi-4.c: * libguile/srfi-4.h: * libguile/numbers.c: * test-suite/standalone/test-conversion.c: * libguile/gen-scmconfig.c: As we require 64-bit integers in configure.ac, remove conditional definition of 64-bit types.
2010-03-03Fix off-by-one error in the off-by-one fix of `make-srfi-4-vector'.Ludovic Courtès1-1/+2
This is a followup to d900a8557db21641413db8995a7cdc1453adbe1f ("Fix off-by-one error when initializing vectors in `make-srfi-4-vector'."). * libguile/srfi-4.c (scm_make_srfi_4_vector): Don't initialize RET when LEN is zero.
2010-03-02Fix off-by-one error when initializing vectors in `make-srfi-4-vector'.Ludovic Courtès1-0/+6
* libguile/srfi-4.c (scm_make_srfi_4_vector): When FILL is bound and non-zero, initialize the last element. * test-suite/tests/srfi-4.test ("TAG vectors")["make-TAGvector"]: New tests.
2010-01-12hopefully fix shared c32 / c64 uniform arraysAndy Wingo1-17/+17
* libguile/srfi-4.c (DEFINE_SRFI_4_C_FUNCS): Add a width parameter, indicating the number of sizeof(ctype) entries comprised by one element of the uniform; normally 1, but 2 for c32 and c64.
2010-01-12fix srfi-4 shared vector access from cAndy Wingo1-2/+2
* libguile/srfi-4.c (DEFINE_SRFI_4_C_FUNCS): Fix elements/writable_elements for shared vectors. Thanks to Daniel Llorens del Río for the info.
2010-01-07reimplement srfi-4 vectors on top of bytevectorsAndy Wingo1-822/+203
* libguile/srfi-4.h: * libguile/srfi-4.c (scm_make_srfi_4_vector): New function, exported by (srfi srfi-4 gnu). * libguile/srfi-4.i.c: Removed. * module/srfi/srfi-4.scm: * module/srfi/srfi-4/gnu.scm: Reimplement srfi-4 vectors on top of bytevectors. The implementation is mostly in Scheme now. * test-suite/tests/unif.test: Update to use (srfi srfi-4 gnu). * libguile/bytevectors.c (bytevector_ref_c32, bytevector_ref_c64) (bytevector_set_c32, bytevector_set_c64): Fix some embarrassing bugs. Still need to do an upper bounds check. * libguile/deprecated.h: Remove deprecated array functions: scm_i_arrayp, scm_i_array_ndim, scm_i_array_mem, scm_i_array_v, scm_i_array_base, scm_i_array_dims, and the deprecated macros: SCM_ARRAYP, SCM_ARRAY_NDIM, SCM_ARRAY_CONTP, SCM_ARRAY_MEM, SCM_ARRAY_V, SCM_ARRAY_BASE, SCM_ARRAY_DIMS. * libguile/deprecated.c (scm_uniform_vector_read_x) (scm_uniform_vector_write, scm_uniform_array_read_x) (scm_uniform_array_write): Newly deprecated functions. * libguile/generalized-arrays.c (scm_array_type): Remove the bytevector hack. * libguile/objcodes.c (scm_bytecode_to_objcode, scm_objcode_to_bytecode): Rework to operate on bytevectors, as scm_make_u8vector now causes a module lookup, which can't be done e.g. when loading the VM boot program for psyntax-pp.go on a fresh bootstrap. * libguile/objcodes.h (SCM_F_OBJCODE_IS_BYTEVECTOR): (SCM_OBJCODE_IS_BYTEVECTOR): s/U8VECTOR/BYTEVECTOR/. * module/ice-9/boot-9.scm (the-scm-module): A terrible hack to pull in (srfi srfi-4), as the bindings are primarily there now. We'll worry about this later.
2009-12-15Remove extraneous semicolon after `SCM_ARRAY_IMPLEMENTATION' & co.Ludovic Courtès1-1/+1
* libguile/bitvectors.c, libguile/srfi-4.c, libguile/strings.c, libguile/vectors.c: Remove extraneous semicolon after `SCM_ARRAY_IMPLEMENTATION' and `SCM_VECTOR_IMPLEMENTATION' invocations.
2009-12-08add SCM_SMOB_TYPE_BITS and SCM_SMOB_TYPE_MASKAndy Wingo1-1/+2
* libguile/smob.h (SCM_SMOB_TYPE_BITS, SCM_SMOB_TYPE_MASK): New macros, for when you want to identify a SMOB by type and mask. * libguile/arrays.c: * libguile/bitvectors.c: * libguile/srfi-4.c: Use the new macros.
2009-12-08SCM_CELL in srfi-4.cAndy Wingo1-3/+3
* libguile/srfi-4.c (SCM_UVEC_TYPE, SCM_UVEC_LENGTH, SCM_UVEC_BASE): Fix SCM_CELL macro usage.
2009-12-05remove a bunch of needless scm_permanent_object callsAndy Wingo1-8/+4
* libguile/array-handle.c: * libguile/bytevectors.c: * libguile/deprecated.c: * libguile/eval.c: * libguile/feature.c: * libguile/filesys.c: * libguile/gc.c: * libguile/gdbint.c: * libguile/goops.c: * libguile/instructions.c: * libguile/load.c: * libguile/modules.c: * libguile/numbers.c: * libguile/options.c: * libguile/ports.c: * libguile/scmsigs.c: * libguile/srcprop.c: * libguile/srfi-4.c: * libguile/stacks.c: * libguile/threads.c: * libguile/vm.c: Remove calls to scm_permanent_object, as they are no longer needed with the BDW GC.
2009-09-14Rename "boehm-gc.h" to "bdw-gc.h"; add to the distribution.Ludovic Courtès1-1/+1
* libguile/Makefile.am (modinclude_HEADERS): Add `bdw-gc.h'. * libguile/bdw-gc.h: Rename from "boehm-gc.h"; users updated. Update to LGPLv3+.
2009-09-01Fix leaky behavior of `scm_take_TAGvector ()'.Ludovic Courtès1-0/+9
* libguile/srfi-4.c (free_user_data): New function. * libguile/srfi-4.i.c (scm_take_TAGvector): Register `free_user_data ()' as a finalizer for DATA. * libguile/objcodes.c (scm_objcode_to_bytecode): Allocate with `scm_malloc ()' since the memory taken by `scm_take_u8vector ()' will eventually be free(3)d. * libguile/vm.c (really_make_boot_program): Likewise.
2009-08-28Merge branch 'master' into boehm-demers-weiser-gcLudovic Courtès1-251/+78
Conflicts: libguile/Makefile.am libguile/bytevectors.c libguile/gc-card.c libguile/gc-mark.c libguile/programs.c libguile/srcprop.c libguile/srfi-14.c libguile/symbols.c libguile/threads.c libguile/unif.c libguile/vm.c
2009-08-18Merge branch 'master' into boehm-demers-weiser-gcLudovic Courtès1-7/+15
Conflicts: lib/Makefile.am libguile/Makefile.am libguile/frames.c libguile/gc-card.c libguile/gc-freelist.c libguile/gc-mark.c libguile/gc-segment.c libguile/gc_os_dep.c libguile/load.c libguile/macros.c libguile/objcodes.c libguile/programs.c libguile/strings.c libguile/vm.c m4/gnulib-cache.m4 m4/gnulib-comp.m4 m4/inline.m4
2009-07-19any->u8vector and family now implemented in SchemeAndy Wingo1-23/+31
* module/Makefile.am: * module/srfi/srfi-4/gnu.scm: New module, for extensions to srfi-4. Currently defines the any->FOOvector family. * libguile/srfi-4.c: * libguile/srfi-4.i.c: Dispatch scm_any_to_FOOvector calls to the scheme-implemented functions in (srfi srfi-4 gnu).
2009-07-19add registry of vector constructors, make-generalized-vectorAndy Wingo1-0/+18
* libguile/generalized-vectors.h: * libguile/generalized-vectors.c: Add a registry of vector constructors. (scm_make_generalized_vector): New public function, constructs a vector of a given type. * libguile/bitvectors.c: * libguile/bytevectors.c: * libguile/srfi-4.c: * libguile/strings.c: * libguile/vectors.c: Register vector constructors. * libguile/extensions.c (scm_init_extensions): No need to NULL the list of registered extensions here, the static init does it for us. Allows scm_c_register_extension to be called before scm_init_extensions. * libguile/init.c (scm_i_init_guile): Move array initialization earlier, so e.g. scm_init_strings has access to a valid list of array element types when registering its vector constructor.
2009-07-19uniform vector functions to their own fileAndy Wingo1-216/+1
* libguile/uniform.c: * libguile/uniform.h: * libguile/srfi-4.c: * libguile/srfi-4.h: * libguile/Makefile.am: Move uniform vector funcs out of srfi-4 to their own file. * libguile.h: * libguile/arrays.c: * libguile/bytevectors.c: Update includers.
2009-07-19generic vector ops to own fileAndy Wingo1-0/+1
* libguile/Makefile.am: * libguile/vectors.c: * libguile/vectors.h: * libguile/generalized-vectors.c: * libguile/generalized-vectors.h: Move generic vector ops off into their own file too. The implementation is now based on the generic array-handle infrastructure. * libguile.h: * libguile/array-map.c: * libguile/bitvectors.c: * libguile/random.c: * libguile/srfi-4.c: Update includers.
2009-07-19add generic array implementation facilityAndy Wingo1-11/+25
* libguile/array-handle.c (scm_i_register_array_implementation): (scm_i_array_implementation_for_obj): Add generic array facility, which will (in a few commits) detangle the array code. (scm_array_get_handle): Use the generic array facility. Note that scm_t_array_handle no longer has ref and set function pointers; instead it has a pointer to the array implementation. It is unlikely that code out there used these functions, however, as the supported way was through scm_array_handle_ref/set_x. (scm_array_handle_pos): Move this function here from arrays.c. (scm_array_handle_element_type): New function, returns a Scheme value representing the type of element stored in this array. * libguile/array-handle.h (scm_t_array_element_type): New enum, for generically determining the type of an array. (scm_array_handle_rank): (scm_array_handle_dims): These are now just #defines. * libguile/arrays.c: * libguile/bitvectors.c: * libguile/bytevectors.c: * libguile/srfi-4.c: * libguile/strings.c: * libguile/vectors.c: Register array implementations for all of these. * libguile/inline.h: Update for array_handle_ref/set change. * libguile/deprecated.h: Need to include arrays.h now.
2009-07-19rename unif.[ch] to arrays.[ch]Andy Wingo1-1/+1
* libguile/Makefile.am: * libguile/unif.c: * libguile/unif.h: * libguile/arrays.c: * libguile/arrays.h: Rename unif.[ch] to arrays.[ch]. * libguile.h: * libguile/array-handle.c: * libguile/array-map.c: * libguile/bitvectors.c: * libguile/bytevectors.c: * libguile/eq.c: * libguile/gc-card.c: * libguile/gc-malloc.c: * libguile/gc-mark.c: * libguile/gc.c: * libguile/init.c: * libguile/inline.h: * libguile/print.c: * libguile/random.c: * libguile/read.c: * libguile/socket.c: * libguile/sort.c: * libguile/srfi-4.c: * libguile/srfi-4.h: * libguile/strports.c: * libguile/vectors.c: * libguile/vectors.h: Update includers.
2009-07-19bitvector exodus from unif.[ch]Andy Wingo1-0/+1
* libguile/Makefile.am: * libguile/unif.c: * libguile/unif.h: * libguile/bitvectors.c: * libguile/bitvectors.h: Move bitvector functionality out of unif.[ch]. * libguile/array-handle.c: * libguile/array-map.c: * libguile/init.c: * libguile/read.c: * libguile/srfi-4.c: * libguile/vectors.c: Oh, what a tangled web we weave...
2009-06-22Make bytevectors accessible using the generalized-vector API.Ludovic Courtès1-1/+8
As a side effect, this allows compilation of literal bytevectors ("#vu8(...)"), which gets done by the generic array handling of the GLIL->assembly compiler. * doc/ref/api-compound.texi (Generalized Vectors): Mention bytevectors. (Arrays, Array Syntax): Likewise. * doc/ref/api-data.texi (Bytevectors as Generalized Vectors): New node. * libguile/bytevectors.c (scm_i_bytevector_generalized_set_x): New. * libguile/bytevectors.h (scm_i_bytevector_generalized_set_x): New declaration. * libguile/srfi-4.c (scm_i_generalized_vector_type, scm_array_handle_uniform_element_size, scm_array_handle_uniform_writable_elements): Add support for bytevectors. * libguile/unif.c (type_creator_table): Add `vu8'. (bytevector_ref, bytevector_set): New functions. (memoize_ref, memoize_set): Add support for bytevectors. * libguile/vectors.c (scm_is_generalized_vector, scm_c_generalized_vector_length, scm_c_generalized_vector_ref, scm_c_generalized_vector_set_x): Add support for bytevectors. * test-suite/tests/bytevectors.test ("Generalized Vectors"): New test set.
2009-06-17Change Guile license to LGPLv3+Neil Jerram1-6/+7
(Not quite finished, the following will be done tomorrow. module/srfi/*.scm module/rnrs/*.scm module/scripts/*.scm testsuite/*.scm guile-readline/* )
2008-09-23Merge branch 'master' into boehm-demers-weiser-gcLudovic Courtès1-31/+4
2008-09-15Make multi-byte reads on unbuffered ports more efficient.Neil Jerram1-31/+4
Idea and original patch were by Ludovic Courtès, this is Neil Jerram's reworking of it. * libguile/srfi-4.c (scm_uniform_vector_read_x): Use scm_c_read, instead of equivalent code here. * libguile/ports.c (scm_fill_input): Add assertion that read buffer is empty when called. (port_and_swap_buffer, swap_buffer): New, for... (scm_c_read): Use caller's buffer for reading, to avoid making N 1-byte low-level read calls, in the case where the port is unbuffered (or has a very small buffer).
2008-09-13Merge branch 'master' into boehm-demers-weiser-gcLudovic Courtès1-1/+1
Conflicts: lib/Makefile.am libguile/gc-card.c libguile/gc-freelist.c libguile/gc-mark.c libguile/gc-segment.c libguile/gc.c libguile/gc.h libguile/gc_os_dep.c libguile/private-gc.h m4/.cvsignore m4/gnulib-cache.m4 m4/gnulib-comp.m4
2008-09-13Include <config.h> in all C files; use `#ifdef HAVE_CONFIG_H' rather than `#if'.Ludovic Courtès1-1/+1
2008-09-05Removed a lot of now-useless SMOB mark/free functions.Ludovic Courtes1-32/+0
* libguile/arbiters.c (scm_init_arbiters): Don't invoke `scm_set_smob_mark'. * libguile/async.c (async_gc_mark): Removed. (scm_init_async): Don't invoke `scm_set_smob_mark'. * libguile/coop-pthreads.c (thread_mark): Removed. (create_thread): Use `scm_gc_malloc' instead of `scm_malloc' when allocating `launch_data'. (mutex_mark): Removed. (scm_threads_init): Don't invoke `scm_set_smob_mark' and `scm_set_smob_free'. * libguile/debug.c (scm_init_debug): Don't invoke `scm_set_smob_mark'. * libguile/dynl.c (dynl_obj_mark): Removed. (scm_init_dynamic_linking): Don't invoke `scm_set_smob_mark'. * libguile/dynwind.c (winder_mark): Removed. (scm_init_dynwind): Don't invoke `scm_set_smob_mark'. * libguile/environments.c (environment_mark): Removed. (environment_free): Removed. (observer_mark): Removed. (core_environments_mark): Removed. (core_environments_finalize): Removed. (leaf_environment_mark): Removed. (leaf_environment_free): Removed. (leaf_environment_funcs): Don't refer to the above funcs. (eval_environment_mark): Removed. (eval_environment_free): Removed. (eval_environment_funcs): Don't refer to the above funcs. (import_environment_mark): Removed. (import_environment_free): Removed. (import_environment_funcs): Don't refer to the above funcs. (export_environment_mark): Removed. (export_environment_free): Removed. (export_environment_funcs): Don't refer to the above funcs. (scm_environments_prehistory): Don't invoke `scm_set_smob_mark' and `scm_set_smob_free'. * libguile/environments.h (scm_environment_funcs)[mark]: Removed. [free]: Removed. * libguile/eval.c (promise_mark): Removed. (promise_free): Removed. (scm_init_eval): Don't invoke `scm_set_smob_mark' and `scm_set_smob_free'. * libguile/fluids.c (fluid_free): Removed. (scm_fluids_prehistory): Don't invoke `scm_set_smob_mark' and `scm_set_smob_free'. * libguile/futures.c (future_mark): Removed. (scm_init_futures): Don't invoke `scm_set_smob_mark'. * libguile/hashtab.c (hashtable_free): Removed. (scm_hashtab_prehistory): Don't invoke `scm_set_smob_mark' and `scm_set_smob_free'. * libguile/hooks.c (scm_init_hooks): Don't invoke `scm_set_smob_mark'. * libguile/keywords.c (scm_init_keywords): Don't invoke `scm_set_smob_mark'. * libguile/macros.c (scm_init_macros): Don't invoke `scm_set_smob_mark'. * libguile/modules.c (scm_init_modules): Don't invoke `scm_set_smob_mark'. * libguile/print.c (scm_init_print): Don't invoke `scm_set_smob_mark'. * libguile/random.c (scm_i_copy_rstate): Use `scm_gc_malloc' instead of `scm_malloc'. (scm_c_make_rstate): Likewise. (rstate_free): Removed. (scm_init_random): Don't invoke `scm_set_smob_free'. * libguile/srcprop.c (srcprops_mark): Removed. (scm_init_srcprop): Don't invoke `srcprops_mark'. * libguile/srfi-14.c (charset_free): Removed. (scm_init_srfi_14): Don't invoke `scm_set_smob_free'. * libguile/srfi-4.c (uvec_mark): Removed. (uvec_free): Removed. (scm_init_srfi_4): Don't invoke `scm_set_smob_free' and `scm_set_smob_mark'. * libguile/threads.c (thread_mark): Removed. (fat_mutex_mark): Removed. (fat_cond_mark): Removed. (scm_init_threads): Dont invoke `scm_set_smob_mark' and `scm_set_smob_free'. * libguile/unif.c (bitvector_free): Removed. (array_mark): Removed. (array_free): Removed. (scm_init_unif): Don't invoke `scm_set_smob_free' and `scm_set_smob_mark'. git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-28
2006-05-27Replace SCM_C_INLINE with SCM_C_INLINE_KEYWORD. Thanks to Mark Gran!Marius Vollmer1-12/+12
2006-04-17merge from 1.8 branchKevin Ryde1-3/+3
2005-12-06(take_uvec): Make BASE pointer non-const.Marius Vollmer1-1/+1
(scm_take_u8vector, etc): Likewise. Thanks to Ludovic Courtès!
2005-05-23The FSF has a new address.Marius Vollmer1-1/+1
2005-03-04Docstring updates.Marius Vollmer1-8/+8
2005-03-02See ChangeLog from 2005-03-02.Marius Vollmer1-2/+2
2005-01-14(scm_take_u64vector,Marius Vollmer1-1/+105
scm_array_handle_u64_elements, scm_array_handle_u64_writable_elements, scm_u64vector_elements, scm_u64vector_writable_elements): Do not define when scm_t_uint64 is not available. (scm_take_s64vector, scm_array_handle_s64_elements, scm_array_handle_s64_writable_elements, scm_s64vector_elements, scm_s64vector_writable_elements): Likewise for scm_t_int64. (uvec_sizes, uvec_print, uvec_equalp): Use SCM bignums when scm_t_int64/scm_t_uint64 are not available. (uvec_mark): New, to mark the bignums. (alloc_uvec): Initialize bignums. (uvec_fast_ref): Return bignums directly. (scm_uint64_min, scm_uint64_max, scm_int64_min, scm_int64_max, assert_exact_integer): New. (uvec_fast_set): Use them to validate the bignums. (scm_init_srfi_4): Set mark function of smob when needed. Initialize scm_uint64_min, scm_uint64_max, scm_int64_min, scm_int64_max.
2005-01-11(SCM_ARRAYP, SCM_I_ARRAYP): Renamed former to latter internalMarius Vollmer1-12/+12
version. Changed all uses. (scm_tc16_array, scm_i_tc16_array, scm_tc16_enclosed_array, scm_i_tc16_enclosed_array, SCM_ARRAY_FLAG_CONTIGUOUS, SCM_I_ARRAY_FLAG_CONTIGUOUS, SCM_ENCLOSE_ARRAYP, SCM_I_ENCLOSE_ARRAYP, SCM_ARRAY_NDIM, SCM_I_ARRAY_NDIM, SCM_ARRAY_CONTP, SCM_I_ARRAY_CONTP, SCM_ARRAY_MEM, SCM_I_ARRAY_MEM, SCM_ARRAY_V, SCM_I_ARRAY_V, SCM_ARRAY_BASE, SCM_I_ARRAY_BASE, SCM_ARRAY_DIMS, SCM_I_ARRAY_DIMS, scm_t_array, scm_i_t_array): Likewise. (SCM_SET_ARRAY_CONTIGUOUS_FLAG, SCM_CLR_ARRAY_CONTIGUOUS_FLAG): Moved from unif.h to unif.c. (scm_c_array_rank): New. (scm_array_rank): Reimplement using it.
2005-01-09(coerce_to_uvec, scm_c_uniform_vector_ref,Marius Vollmer1-12/+9
scm_c_uniform_vector_set_x): Use generic scm_array_handle_ref/set instead of uvec_fast_ref/set since scm_array_handle_ref should be faster now.
2005-01-09* srfi-4.h, srfi-4.c, srfi-4.i.c (scm_i_uniform_vector_ref_proc,Marius Vollmer1-3/+31
scm_i_uniform_vector_set_proc): New. (u8ref, u8set, s8ref, s8set, etc): New. (uvec_reffers, uvec_setters): New. (uvec_to_list): Use generic scm_array_handle_ref instead of uvec_fast_ref since scm_array_handle_ref should be faster now. More changes like this are upcoming.
2005-01-09(scm_uniform_element_size): Deprecated implementationMarius Vollmer1-0/+8
as well.
2005-01-09(uvec_type): New.Marius Vollmer1-2/+21
(uvec_to_list, uvec_ref, uvec_set_x, scm_c_uniform_vector_ref, scm_c_uniform_vector_x): Use it to get concrete type.
2005-01-07Include deprecation.h.Marius Vollmer1-0/+1
2005-01-07(SCM_IS_UVEC): New, use it instead ofMarius Vollmer1-76/+141
SCM_SMOB_PREDICATE in this file. (is_uvec): Also recognize one-dimensional uniform numeric arrays of the right type. (scm_is_uniform_vector): Likewise. (uvec_fast_ref): Made BASE param const. (uvec_writable_elements, uvec_elements): New. (uvec_to_list, uvec_ref, uvec_set_x, uvec_length, scm_c_uniform_vector_length, scm_c_uniform_vector_ref, scm_c_uniform_set_x): Use them to also deal with one-dimensional arrays. (scm_uniform_vector_ref, scm_uniform_vector_set_x): Deprecate old argument convention. (scm_uniform_vector_to_list): Let uvec_to_list do all the checking. (scm_uniform_vector_length): Use uvec_length.
2005-01-06(scm_c_uniform_vector_element_size,Marius Vollmer1-19/+16
scm_c_uniform_vector_size): Removed. (scm_array_handle_uniform_element_size): New.
2005-01-02* weaks.c: Use new vector elements API or simple vectorMarius Vollmer1-76/+68
API, as appropriate. * srfi-4.h, srfi-4.c, srfi-4.i.c (scm_array_handle_uniform_elements, scm_array_handle_uniform_writable_elements, scm_uniform_vector_elements, scm_uniform_vector_writable_elements): (scm_<foo>vector_elements, scm_<foo>vector_writable_elements): Use scm_t_array_handle, deliver length and increment. (scm_array_handle_<foo>_elements, scm_array_handle_<foo>_writable_elements): New. * unif.h, unif.c (scm_t_array_handle, scm_array_get_handle, scm_array_handle_rank, scm_array_handle_dims, scm_array_handle_ref scm_array_handle_set, scm_array_handle_elements scm_array_handle_writable_elements, scm_vector_get_handle): New. (scm_make_uve, scm_array_prototype, scm_list_to_uniform_array, scm_dimensions_to_uniform_array): Deprecated for real. (scm_array_p, scm_i_array_p): Use latter for SCM_DEFINE since snarfing wont allow a mismatch between C and Scheme arglists. (scm_make_shared_array, scm_enclose_array): Correctly use scm_c_generalized_vector_length instead of scm_uniform_vector_length. * weaks.h, weaks.c: Use new internal weak vector API from vectors.h. * Makefile.am (libguile_la_SOURCES, DOT_X_FILES, DOT_DOC_FILES, EXTRA_libguile_la_SOURCES): Changed ramap.c and unif.c from being 'extra' to being regular sources. (noinst_HEADERS): Added quicksort.i.c. * quicksort.i.c: New file. * vectors.h, vector.c (SCM_VECTORP, SCM_VECTOR_LENGTH, SCM_VELTS, SCM_WRITABLE_VELTS, SCM_VECTOR_REF, SCM_VECTOR_SET): Deprecated and reimplemented. Replaced all uses with scm_vector_elements, scm_vector_writable_elements, or SCM_SIMPLE_VECTOR_*, as appropriate. (scm_is_simple_vector, SCM_SIMPLE_VECTOR_LENGTH, SCM_SIMPLE_VECTOR_REF, SCM_SIMPLE_VECTOR_SET, SCM_SIMPLE_VECTOR_LOC): New. (SCM_VECTOR_BASE, SCM_SET_VECTOR_BASE, SCM_VECTOR_MAX_LENGTH, SCM_MAKE_VECTOR_TAG, SCM_SET_VECTOR_LENGTH, SCM_VELTS_AS_STACKITEMS, SCM_SETVELTS, SCM_GC_WRITABLE_VELTS): Removed. (scm_vector_copy): New. (scm_vector_elements, scm_vector_writable_elements): Use scm_t_array_handle, deliver length and increment. Moved to unif.h. Changed all uses. (scm_vector_release_elements, scm_vector_release_writable_elements, (scm_frame_vector_release_elements, scm_frame_vector_release_writable_elements): Removed. (SCM_I_IS_VECTOR, SCM_I_VECTOR_ELTS, SCM_I_VECTOR_WELTS, SCM_I_VECTOR_LENGTH, scm_i_vector_free): New internal API. (SCM_I_WVECTP SCM_I_WVECT_LENGTH SCM_I_WVECT_VELTS SCM_I_WVECT_GC_WVELTS SCM_I_WVECT_TYPE SCM_I_WVECT_GC_CHAIN SCM_I_SET_WVECT_GC_CHAIN, scm_i_allocate_weak_vector): New, for weak vectors.