See ChangeLog from 2005-03-02.
[bpt/guile.git] / libguile / ChangeLog
Content-type: text/html HCoop Git - bpt/guile.git/blame - libguile/ChangeLog


500 - Internal Server Error

Malformed UTF-8 character (fatal) at (eval 8) line 1, <$fd> line 2680.
CommitLineData
9de87eea
MV
12005-03-02 Marius Vollmer <marius.vollmer@uni-dortmund.de>
2
3 Big merge from the mvo-thread-cleanup branch. The main changes
4 are:
5
6 - The dynamic roots functionality has been split into dynamic
7 states and continuations barriers. Fluids have been
8 reimplemented and can now be garbage collected.
9
10 - Initialization of Guile now works in a multi-thread friendly
11 manner. Threads can freely enter and leave guile mode.
12
13 - Blocking on mutexes or condition variables or while selecting
14 can now be reliably interrupted via system asyncs.
15
16 - The low-level threading interface has been removed.
17
18 - Signals are delivered via a pipe to a dedicated 'signal delivery
19 thread'.
20
21 - SCM_DEFER_INTS, SCM_ALLOW_INTS etc have been deprecated.
22
23 * throw.c (scm_handle_by_message): Exit only the current thread,
24 not the whole process.
25 (scm_handle_by_message_noexit): Exit when catching 'quit.
26
27 * scmsigs.c (take_signal, signal_delivery_thread,
28 start_signal_delivery_thread, ensure_signal_delivery_thread,
29 install_handler): Reimplemented signal delivery as explained in
30 the comments.
31
32 * pthreads-threads.h (scm_i_pthread_t, scm_i_pthread_self,
33 scm_i_pthread_create, scm_i_pthread_detach, scm_i_pthread_exit,
34 scm_i_sched_yield, scm_i_pthread_sigmask,
35 SCM_I_PTHREAD_MUTEX_INITIALIZER,
36 SCM_I_PTHREAD_RECURSIVE_MUTEX_INITIALIZER, scm_i_pthread_mutex_t ,
37 scm_i_pthread_mutex_init, scm_i_pthread_mutex_destroy,
38 scm_i_pthread_mutex_trylock, scm_i_pthread_mutex_lock,
39 scm_i_pthread_mutex_unlock, SCM_I_PTHREAD_COND_INITIALIZER,
40 scm_i_pthread_cond_t, scm_i_pthread_cond_init,
41 scm_i_pthread_cond_destroy, scm_i_pthread_cond_signal,
42 scm_i_pthread_cond_broadcast, scm_i_pthread_cond_wait,
43 scm_i_pthread_cond_timedwait, scm_i_pthread_once_t,
44 SCM_I_PTHREAD_ONCE_INIT, scm_i_pthread_once, scm_i_pthread_key_t ,
45 scm_i_pthread_key_create, scm_i_pthread_setspecific,
46 scm_i_pthread_getspecific, scm_i_scm_pthread_mutex_lock,
47 scm_i_frame_pthread_mutex_lock, scm_i_scm_pthread_cond_wait,
48 scm_i_scm_pthread_cond_timedwait): Provide the obvious mapping
49 when using pthreads.
50 * null-threads.c, null-threads.h: Provide dummy definitions for
51 the above symbols when not using pthreads.
52
53 * modules.h, modules.c (scm_frame_current_module): New.
54
55 * load.c (scm_primitive_load): Use scm_i_frame_current_load_port
56 instead of scm_internal_dynamic_wind.
57
58 * init.h, init.c (restart_stack, start_stack): Removed.
59 (scm_boot_guile, invoke_main_func): Simply use scm_with_guile.
60 (scm_boot_guile_1): Removed.
61 (scm_i_init_mutex): New.
62 (really_cleanup_for_exit, cleanup_for_exit): New.
63 (scm_init_guile_1, scm_i_init_guile): Renamed former to latter.
64 Moved around some init funcs. Call
65 scm_init_threads_default_dynamic_state. Register cleanup_for_exit
66 with atexit.
67
68 * hashtab.c (scm_hash_fn_create_handle_x, scm_hash_fn_remove_x):
69 Use "!scm_is_eq" instead of "!=".
70
71 * ge-scmconfig.c, gen-scmconfig.h.in (SCM_I_GSC_USE_COOP_THREADS,
72 SCM_USE_COOP_THREADS): Removed.
73
74 * gc.c (scm_igc): Take care that scm_gc_running_p is properly
75 maintained. Unlock scm_i_sweep_mutex before running
76 scm_after_gc_c_hook.
77 (scm_permanent_object): Allocate outside of critical section.
78 (cleanup): Removed.
79
80 * fluids.h, fluids.c: Reimplemented completely.
81 (SCM_FLUID_NUM, SCM_FAST_FLUID_REF,
82 SCM_FAST_FLUID_SET): Reimplemented as functions.
83 (scm_is_fluid): New.
84 (scm_i_make_initial_fluids, scm_i_copy_fluids): Removed.
85 (scm_make_dynamic_state, scm_dynamic_state_p,
86 scm_is_dynamic_state, scm_current_dynamic_state,
87 scm_set_current_dynamic_state, scm_frame_current_dynamic_state,
88 scm_c_with_dynamic_state, scm_with_dynamic_state,
89 scm_i_make_initial_dynamic_state, scm_fluids_prehistory): New.
90
91 * feature.c (progargs_fluid): New.
92 (scm_program_arguments, scm_set_program_arguments): Use it instead
93 of scm_progargs.
94 (scm_init_feature): Allocate it. Also, only add "threads" feature
95 when SCM_USE_PTHREAD_THREADS is true.
96
97 * eval.c (scm_makprom): Use scm_make_recursive_mutex instead of
98 scm_make_rec_mutex, with all the consequences.
99 (scm_eval_x, scm_eval): Use scm_frame_begin etc instead of
100 scm_internal_dynamic_wind. Handle dynamic states as second
101 argument.
102
103 * threads.h, threads.c (scm_internal_select): Renamed to
104 scm_std_select and discouraged old name.
105 (scm_thread_sleep, scm_thread_usleep): Likewise, as scm_std_sleep
106 and scm_std_usleep.
107 (scm_tc16_fair_mutex, scm_tc16_fair_condvar, SCM_MUTEXP,
108 SCM_FAIR_MUTEX_P, SCM_MUTEX_DATA, SCM_CONDVARP,
109 SCM_FAIR_CONDVAR_P, SCM_CONDVAR_DATA, SCM_THREADP,
110 SCM_THREAD_DATA): Removed.
111 (SCM_I_IS_THREAD, SCM_I_THREAD_DATA): New.
112 (scm_i_thread): New.
113 (SCM_VALIDATE_THREAD, SCM_VALIDATE_MUTEX, SCM_VALIDATE_CONDVAR):
114 Use scm_assert_smob_type.
115 (scm_c_scm2thread, scm_thread_join, scm_thread_detach,
116 scm_thread_self, scm_thread_yield, scm_mutex_init,
117 scm_mutex_destroy, scm_mutex_trylock, scm_mutex_unlock,
118 scm_rec_mutex_init, scm_rec_mutex_destroy, scm_make_rec_mutex,
119 scm_rec_mutex_free, scm_rec_mutex_lock, scm_rec_mutex_trylock,
120 scm_cond_init, scm_cond_destroy, scm_cond_wait,
121 scm_cond_timedwait, scm_cond_signal, scm_cond_broadcast,
122 scm_key_create, scm_key_delete, scm_setspecific, scm_getspecific,
123 scm_thread_select): Removed. Replaced with scm_i_pthread
124 functions as appropriate.
125 (scm_in_guile, scm_outside_guile): Removed.
126 (scm_t_guile_ticket, scm_leave_guile, scm_enter_guile): Return and
127 take a ticket.
128 (scm_with_guile, scm_without_guile, scm_i_with_guile_and_parent):
129 New.
130 (scm_i_frame_single_threaded): New.
131 (scm_init_threads_default_dynamic_state): New.
132 (scm_i_create_thread): Removed.
133 (scm_make_fair_mutex, scm_make_fair_condition_variable): Removed.
134 (scm_make_recursive_mutex): New.
135 (scm_frame_critical_section): New.
136 (SCM_CURRENT_THREAD, SCM_I_CURRENT_THREAD): Renamed former to
137 latter, changed all uses.
138 (scm_i_dynwinds, scm_i_setdynwinds, scm_i_last_debug_frame,
139 scm_i_set_last_debug_frame): New, use them instead of scm_root
140 stuff.
141 (SCM_THREAD_LOCAL_DATA, SCM_SET_THREAD_LOCAL_DATA,
142 scm_i_root_state_key,m scm_i_set_thread_data): Removed.
143 (scm_pthread_mutex_lock, scm_frame_pthread_mutex_lock,
144 scm_pthread_cond_wait, scm_pthread_cond_timedwait).
145 (remqueue): Allow the removal of already removed cells. Indicate
146 whether a real removal has happened.
147 (scm_thread): Removed, replaced with scm_i_thread.
148 (make_thread, init_thread_creatant): Removed.
149 (cur_thread): Removed.
150 (block_self, unblock_from_queue): New.
151 (block, timed_block, unblock): Removed.
152 (guilify_self_1, guilify_self_2, do_thread_exit,
153 init_thread_key_once, init_thread_key,
154 scm_i_init_thread_for_guile, get_thread_stack_base,
155 scm_init_guile): New initialisation method.
156 (scm_call_with_new_thread, scm_spawn_thread): Use it to simplify
157 thread creation.
158 (fair_mutex, fat_mutex, etc, fair_condvar, fat_condvar): Renamed
159 "fair" to fat and implemented new semantics, including reliable
160 interruption.
161 (all_threads): Now a pointer to a scm_i_thread, not a SCM.
162 (scm_threads_mark_stacks): Explicitly mark handle.
163 (scm_std_select): Allow interruption by also selecting on the
164 sleep_pipe.
165 (scm_i_thread_put_to_sleep): Handle recursive requests for
166 single-threadedness.
167 (scm_threads_prehistory, scm_init_threads): Put current thread
168 into guile mode via guileify_self_1 and guileify_self_2,
169 respectively.
170
171 * fluid.h (SCM_FLUIDP): Deprecated.
172
173 * coop-threads.c: Removed.
174
175 * continuations.h, continuations.c (scm_with_continuation_barrier,
176 scm_c_with_continuation_barrier, scm_i_with_continuation_barrier):
177 New.
178
179 * async.h, async.c (scm_i_setup_sleep, scm_i_reset_sleep): New.
180 (async_mutex): New.
181 (scm_async_click): Protected with async_mutex. Do not deal with
182 signal_asyncs, which are gone. Set cdr of handled async cell to
183 #f.
184 (scm_i_queue_async_cell): Protected with async_mutex. Interrupt
185 current sleep.
186 (scm_system_async_mark_for_thread): Do not use scm_current_thread
187 since that might not work during early initialization.
188
189 * __scm.h (SCM_DEFER_INTS, SCM_ALLOW_INTS, SCM_REDEFER_INTS,
190 SCM_REALLOW_INTS): Deprecated by moving into deprecated.h and
191 deprecated.c. Replaced all uses with SCM_CRITICAL_SECTION_START
192 and SCM_CRITICAL_SECTION_END.
193 (SCM_ENTER_A_SECTION, SCM_EXIT_A_SECTION): Removed. Replaced with
194 SCM_CRITICAL_SECTION_START/END.
195
196 * Makefile.am (modinclude_HEADER): Removed threads-plugin.h.
197 (libguile_la_SOURCES): Added null-threads.c
198 (EXTRA_libguile_la_SOURCES): Removed pthread-threads.c and
199 threads-plugin.c.
200 * pthread-threads.c, threads-plugin.c, threads-plugin.h: Removed.
201
202 * root.h, root.c (scm_tc16_root, SCM_ROOTP, SCM_ROOT_STATE,
203 scm_root_state, scm_stack_base, scm_save_regs_gc_mark,
204 scm_errjmp_bad, scm_rootcont, scm_dynwinds, scm_progargs,
205 scm_last_debug_frame, scm_exitval, scm_cur_inp, scm_outp,
206 scm_cur_err, scm_cur_loadp, scm_root, scm_set_root,
207 scm_make_root): Removed or deprecated. Replaced with references
208 to the current thread, dynamic state, continuation barrier, or
209 some fluid, as appropriate.
210 (root_mark, root_print): Removed.
211 (scm_internal_cwdr): Reimplemented guts with
212 scm_frame_current_dynamic_state and
213 scm_i_with_continuation_barrier.
214 (scm_dynamic_root): Return current continuation barrier.
215
216
ad3d5a65
MV
2172005-02-28 Marius Vollmer <mvo@zagadka.de>
218
219 * socket.c (scm_setsockopt): Handle IP_ADD_MEMBERSHIP and
220 IP_DROP_MEMBERSHIP options. Also, reorganized the code a bit for
221 cleanliness.
222 (scm_init_socket): Define IP_ADD_MEMBERSHIP and
223 IP_DROP_MEMBERSHIP.
224 Thanks to Greg Troxel!
225
73a90115
MD
2262005-02-27 Mikael Djurfeldt <djurfeldt@nada.kth.se>
227
228 * gh.h: Bugfix: Include <libguile.h> outside of the extern "C"
229 block.
230
5d2cb3ab
MV
2312005-02-25 Marius Vollmer <mvo@zagadka.de>
232
233 * hashtab.c (scm_i_rehash): Remove elements from old bucket vector
234 so that no two weak alist vectors share a spine.
235 (scm_hash_fn_create_handle_x): Deal with a possible rehashing
236 during GC before inserting the new alist cell.
237
838c4126
MV
2382005-02-23 Marius Vollmer <marius.vollmer@uni-dortmund.de>
239
240 * hashtab.c (scm_i_rehash): Cope with the case that a GC modifies
241 the hashtable.
242 (scm_hash_fn_create_handle_x): Likewise.
243 * vectors.h (SCM_I_SET_WVECT_TYPE): New, for use in scm_i_rehash.
244
29fed193
MD
2452005-02-10 Mikael Djurfeldt <djurfeldt@nada.kth.se>
246
247 * unif.c (prototype_to_type): Bugfix: Don't compare prototype to
248 the prototypical examples mentioned in the old reference manual.
249 Instead keep the old semantics of dispatching on type. (Yes, this
250 is extremely ugly, but the whole point of keeping the deprecated
251 interface is not to break old code.)
252
9cc49060
MD
2532005-02-08 Mikael Djurfeldt <djurfeldt@nada.kth.se>
254
255 * deprecated.h (SCM_ARRAY_DIMS): Rename scm_i_attay_dims -->
256 scm_i_array_dims.
257
8447f463
KR
2582005-01-28 Kevin Ryde <user42@zip.com.au>
259
260 * numbers.c (scm_ash): Rewrite using shifts, much faster than
261 integer-expt and multiply/divide. Inexacts and fractions no longer
262 supported (they happened to work before for left shifts, but not
263 right). Don't really need inexacts and fractions, since ash is
264 documented as a "bitwise operation", and all the rest of those only
265 take exact integers.
266
1367aa5e
HWN
2672005-01-27 Han-Wen Nienhuys <hanwen@xs4all.nl>
268
856fca7e
HWN
269 * gc-card.c (scm_i_card_statistics): map structs, closures and
270 subrs to one tag.
271
1367aa5e 272 * gc.c (s_scm_gc_live_object_stats): return alist, not hashtable.
856fca7e 273 (tag_table_to_type_alist): ignore unknown types.
1367aa5e
HWN
274
275 * gc-segment.c (scm_i_all_segments_statistics): new function.
276 (scm_i_heap_segment_statistics): new function
277
278 * gc.c (s_scm_gc_live_object_stats): new GUILE callable: return
279 statistics on the number of live objects of each type.
280
281 * gc-card.c (scm_i_tag_name): new function.
282 (scm_i_card_statistics): new function.
283
333db3b8
KR
2842005-01-24 Kevin Ryde <user42@zip.com.au>
285
286 * posix.c (scm_setlocale): Force errno=EINVAL for an error, since
287 POSIX and C99 don't document errno being set. Reported by Bruno
288 Haible.
289 (scm_flock): Update docstring from manual.
290
8447f463
KR
291 * random.c (scm_i_init_rstate): Compare w to -1 not 0xffffffffUL, now
292 that it's an scm_t_int32. Otherwise gcc 3.4 says it's always false on
293 a 64-bit system.
294
295 * scmsigs.c (scm_sigaction_for_thread): Use scm_to_long for
296 sa_handler, needs to be a long on 64-bit systems where int is only 32
297 bits.
298
88f59e53
MV
2992005-01-20 Marius Vollmer <marius.vollmer@uni-dortmund.de>
300
0eeb2611
MV
301 * environments.c (obarray_enter, obarray_replace): Call
302 SCM_HASHTABLE_INCREMENT when adding a new entry.
303
88f59e53
MV
304 * objects.c: Include goops.h for the scm_class_of prototype.
305
306 * hashtab.c (hashtable_size, HASHTABLE_SIZE_N): Restrict hashtable
307 sizes to be smaller than the maximum lengths of vectors.
308
219b2868
MV
3092005-01-18 Marius Vollmer <marius.vollmer@uni-dortmund.de>
310
311 * ports.c, smob.c: Include "libguile/goops.h".
312
313 * objects.h, objects.c, goops.c, goops.h (scm_class_boolean,
314 scm_class_char, scm_class_pair, scm_class_procedure,
315 scm_class_string, scm_class_symbol,
316 scm_class_procedure_with_setter, scm_class_primitive_generic,
317 scm_class_vector, scm_class_null, scm_class_real,
318 scm_class_complex, scm_class_integer, scm_class_fraction,
319 scm_class_unknown, scm_port_class, scm_smob_class,
320 scm_no_applicable_method, scm_class_of): Moved from objects to
321 goops since they are only useable once goops has been loaded.
322 (scm_classes_initialized): Removed.
323 (scm_class_of): Do not check it.
324 (create_standard_classes): Do not set it.
325
009c6b9c
MV
3262005-01-17 Marius Vollmer <marius.vollmer@uni-dortmund.de>
327
50472546
MV
328 * objects.h, objects.c (scm_classes_initialized): New.
329 (scm_class_of): Signal error when scm_classes_initialized is zero.
330 * goops.c (create_standard_classes): Set scm_classes_initialized
331 to one.
332
009c6b9c
MV
333 * random.c (scm_random_solid_sphere_x): Use
334 scm_c_generalized_vector_length instead of
335 scm_uniform_vector_length.
336
7719cbe9
MV
3372005-01-16 Marius Vollmer <mvo@zagadka.de>
338
339 * script.c (scm_compile_shell_switches): Removed debugging output.
340
1ec44fed
KR
3412005-01-15 Kevin Ryde <user42@zip.com.au>
342
343 * numbers.c (scm_logtest, scm_logbit_p, scm_integer_expt): Update
344 docstrings from manual.
345 * random.c (scm_random_solid_sphere_x): Update docstring from manual.
346
6e4cd850
MV
3472005-01-14 Marius Vollmer <marius.vollmer@uni-dortmund.de>
348
0b5a0521
MV
349 * random.c: Don't check for definedness of SCM_HAVE_T_INT64, check
350 its value.
351
352 Implement u64 and s64 uniform numeric vectors with bignums when
353 scm_t_uint64 and scm_t_int64 are not available.
354
355 * srfi-4.h, srfi-4.c, srfi-4.i.c (scm_take_u64vector,
356 scm_array_handle_u64_elements,
357 scm_array_handle_u64_writable_elements, scm_u64vector_elements,
358 scm_u64vector_writable_elements): Do not define when scm_t_uint64
359 is not available.
360 (scm_take_s64vector, scm_array_handle_s64_elements,
361 scm_array_handle_s64_writable_elements, scm_s64vector_elements,
362 scm_s64vector_writable_elements): Likewise for scm_t_int64.
363 (uvec_sizes, uvec_print, uvec_equalp): Use SCM bignums when
364 scm_t_int64/scm_t_uint64 are not available.
365 (uvec_mark): New, to mark the bignums.
366 (alloc_uvec): Initialize bignums.
367 (uvec_fast_ref): Return bignums directly.
368 (scm_uint64_min, scm_uint64_max, scm_int64_min, scm_int64_max,
369 assert_exact_integer): New.
370 (uvec_fast_set): Use them to validate the bignums.
371 (scm_init_srfi_4): Set mark function of smob when needed.
372 Initialize scm_uint64_min, scm_uint64_max, scm_int64_min,
373 scm_int64_max.
374
6e4cd850
MV
375 Recognize 1.4 -e syntax.
376
377 * script.c (sym_at, sym_atat, sym_main, all_symbols): New.
378 (scm_compile_shell_switches): Use them to recognize and convert
379 1.4 "-e" syntax.
380
3b698afe
MV
3812005-01-12 Marius Vollmer <marius.vollmer@uni-dortmund.de>
382
383 * deprecated.h, deprecated.c, strings.h, strings.c: Turn all
384 deprecated features that once were macros but are now functions
385 back into macros.
386
d6dc83a9
MV
3872005-01-11 Marius Vollmer <marius.vollmer@uni-dortmund.de>
388
49086691
MV
389 * eval.c, debug.h (SCM_WARN_DEPRECATED): New debug option.
390 * deprecation.c (scm_issue_deprecation_warning,
391 scm_c_issue_deprecation_warning_fmt): Use it.
392 (mode): Removed.
393 (print_summary): New.
394 (scm_init_deprecation): Initialize SCM_WARN_DEPRECATED instead of
395 mode.
396
d6dc83a9
MV
397 Deprecated SCM_ARRAY* macros.
398
399 * unif.h, unif.c, ramap.c, vectors.c, srfi-4.c, srfi-4.i.c
400 (SCM_ARRAYP, SCM_I_ARRAYP): Renamed former to latter internal
401 version. Changed all uses.
402 (scm_tc16_array, scm_i_tc16_array,
403 scm_tc16_enclosed_array, scm_i_tc16_enclosed_array,
404 SCM_ARRAY_FLAG_CONTIGUOUS, SCM_I_ARRAY_FLAG_CONTIGUOUS,
405 SCM_ENCLOSE_ARRAYP, SCM_I_ENCLOSE_ARRAYP,
406 SCM_ARRAY_NDIM, SCM_I_ARRAY_NDIM,
407 SCM_ARRAY_CONTP, SCM_I_ARRAY_CONTP,
408 SCM_ARRAY_MEM, SCM_I_ARRAY_MEM,
409 SCM_ARRAY_V, SCM_I_ARRAY_V,
410 SCM_ARRAY_BASE, SCM_I_ARRAY_BASE,
411 SCM_ARRAY_DIMS, SCM_I_ARRAY_DIMS,
412 scm_t_array, scm_i_t_array): Likewise.
413 (SCM_SET_ARRAY_CONTIGUOUS_FLAG, SCM_CLR_ARRAY_CONTIGUOUS_FLAG):
414 Moved from unif.h to unif.c.
415 (scm_c_array_rank): New.
416 (scm_array_rank): Reimplement using it.
417
418 * deprecated.h, deprecated.c (SCM_ARRAYP, SCM_ARRAY_NDIM,
419 SCM_ARRAY_CONTP, SCM_ARRAY_MEM, SCM_ARRAY_V, SCM_ARRAY_BASE,
420 SCM_ARRAY_DIMS, scm_t_array): New deprecated versions.
421
dc91d8de
MV
4222005-01-11 Marius Vollmer <mvo@zagadka.de>
423
424 * ramap.c: Replace uses of scm_make_ra with scm_i_make_ra.
425 (GVREF, GVSET): New abbreviations. Use them everywhere instead of
426 scm_c_generalized_vector_ref and scm_cvref, and
427 scm_c_generalized_vector_set_x, respectively.
428 (RVREF, IVDEP, BINARY_ELTS_CODE, BINARY_PAIR_ELTS_CODE,
429 UNARY_ELTS_CODE, UNARY_PAIR_ELTS_CODE): Removed since unused.
430
431 * unif.h, unif.c (indices_to_pos, scm_array_handle_pos): Renamed
432 former to latter and made public. Changed all uses.
433 (scm_i_make_ra): Made public, changed tag param to enclosed flag.
434 (scm_make_ra): Deprecated, changed all uses to scm_i_make_ra.
435 (scm_i_shap2ra): New internal version of scm_shap2ra.
436 (scm_shap2ra): Deprecated, changed all uses to scm_i_shap2ra.
437 (scm_i_ra_set_contp): New internal version of scm_ra_set_contp.
438 (scm_ra_set_contp): Deprecated, changed all uses to
439 scm_i_ra_set_contp.
440 (scm_cvref, scm_aind, scm_raprin1): Deprecated.
441
66d33784
MV
4422005-01-10 Marius Vollmer <marius.vollmer@uni-dortmund.de>
443
b06f099d
MV
444 * eval.c (scm_eval): Added example to docstring. Thanks to Issac
445 Trotts!
446
5d35ad81
MV
447 * unif.c (scm_list_to_typed_array): Allow the specification of the
448 upper bound as well. This is needed for empty arrays.
449 (l2ra): Give needed number of elements in error message.
450 (scm_i_print_array): Print length information for arrays that need
451 it.
452 (scm_i_read_array): Parse it.
453
66d33784
MV
454 * deprecated.h, deprecated.c (SCM_CHARS, SCM_UCHARS, SCM_LENGTH,
455 scm_i_object_chars, scm_i_object_length): Brought back from the
456 dead.
457
d7d7d401
MV
4582005-01-10 Marius Vollmer <mvo@zagadka.de>
459
74c58fce
MV
460 * ramap.c: Replaced single-index uses of scm_array_set_x with
461 scm_c_generalized_vector_set_x.
462
d7d7d401
MV
463 * unif.c (scm_array_rank, scm_array_dimensions,
464 scm_shared_array_offset, scm_shared_array_increments,
465 scm_array_ref, scm_array_set_x): Use scm_t_array_handle operations
466 to simplify code and make it more general.
467 (scm_shared_array_root): Work with all kinds of arrays, including
468 naked vectors.
469 (indices_to_pos): New.
74c58fce
MV
470 (scm_make_shared_array): Use it instead of scm_aind; use handle
471 for oldra.
472
4475d3fe
KR
4732005-01-10 Kevin Ryde <user42@zip.com.au>
474
475 * posix.c (scm_mkstemp): Update docstring from manual.
476
d3ddc95e
KR
477 * stime.c (scm_mktime): Missing default errno=EINVAL from prev change.
478
8c8491f5
MV
4792005-01-09 Marius Vollmer <mvo@zagadka.de>
480
b89ecc6f
MV
481 * srfi-4.h, srfi-4.c, srfi-4.i.c (scm_i_uniform_vector_ref_proc,
482 scm_i_uniform_vector_set_proc): New.
483 (u8ref, u8set, s8ref, s8set, etc): New.
484 (uvec_reffers, uvec_setters): New.
485 (uvec_to_list): Use generic scm_array_handle_ref instead of
486 uvec_fast_ref since scm_array_handle_ref should be faster now.
8cb01d9f
MV
487 (coerce_to_uvec, scm_c_uniform_vector_ref,
488 scm_c_uniform_vector_set_x): Likewise.
b89ecc6f
MV
489
490 * unif.h, unif.c, inline.h (scm_i_t_array_ref, scm_i_t_array_set):
491 New.
492 (scm_t_array_handle): Added ref, set, elements and
493 writable_elements for fast inline operation of
494 scm_array_handle_ref and scm_array_handle_set.
495 (scm_array_handle_ref, scm_array_handle_set): Moved to inline.h
496 and replaced with inline code that simply calls the ref/set
497 members of the handle.
498 (enclosed_ref, vector_ref, string_ref, bitvector_ref, memoize_ref,
499 enclosed_set, vector_set, string_set, bitvector_set, memoize_set):
500 New.
501 (scm_array_handle_get): Initialize ref/set fields to memoize_ref
502 and memoize_set.
503 (scm_bitvector_fill_x, scm_bitvector_to_list, scm_bit_count,
504 scm_bit_position, scm_bit_set_star_x, scm_bit_count_star,
505 scm_bit_invert_x): Correctly multiply index with increment in the
506 general case.
507
8c8491f5
MV
508 * unif.c (scm_array_handle_set): Correctly execute only one
509 alternative. D'Oh!
510 (scm_list_to_typed_array, l2ra): Use scm_t_array_handle to fill
511 the array; this covers all cases with much simpler code.
512
513 * srfi-4.c (scm_uniform_element_size): Deprecated implementation
514 as well.
515
cd5d55c7
MV
5162005-01-09 Marius Vollmer <marius.vollmer@uni-dortmund.de>
517
518 * srfi-4.c (uvec_type): New.
519 (uvec_to_list, uvec_ref, uvec_set_x, scm_c_uniform_vector_ref,
520 scm_c_uniform_vector_x): Use it to get concrete type.
521
522 * unif.h (scm_t_array_dim): Changed type of members to ssize_t, to
523 fit the docs.
524
525 * unif.c (ra2l): Handle zero rank arrays.
526 (scm_i_print_array): Print zero rank arrays specially.
527 (tag_to_type): Return #t for an empty tag, not the empty symbol.
528 (scm_i_read_array): Allow zero rank arrays.
529
a4aad74e
MV
5302005-01-07 Marius Vollmer <marius.vollmer@uni-dortmund.de>
531
532 * hashtab.h, hashtab.c (SCM_HASHTAB_BUCKET_LOC): Removed.
533 (scan_weak_hashtables): Rewrote its use with SCM_HASHTAB_BUCKET
534 and SCM_SET_HASHTAB_BUCKET.
535
536 * print.h, print.c (scm_print_state, SCM_PRINT_STATE_LAYOUT):
537 Removed ref_stack field.
538 (PSTATE_STACK_REF, PSTATE_STACK_SET): New, for accessing the stack
539 of a print state. Use them everywhere instead of ref_stack.
540
3a40d5e1
MV
541 * srfi-4.h (scm_uniform_element_size): Deprecated for real.
542
a4aad74e
MV
543 * srfi-4.c: Include deprecation.h.
544
545 * vectors.h, vectors.c, unif.h, unif.c, deprecated.h,
546 deprecated.c, eq.c
547 (SCM_BITVEC_REF, SCM_BITVEC_SET, SCM_BITVEC_CLR): Removed.
548 (scm_vector_elements, scm_vector_writable_elements,
549 scm_generalized_vector_get_handle): Moved to vectors.[hc] from
550 unif.[hc].
551 (SCM_SIMPLE_VECTOR_LOC): Removed.
552 (SCM_VECTOR_MAX_LENGTH, SCM_VECTOR_LENGTH, SCM_VELTS,
553 SCM_WRITABLE_VELTS, SCM_VECTOR_REF, SCM_VECTOR_SET,
554 scm_vector_equal_p): Moved from vectors.[hc] to deprecated.[hc].
555 (scm_vector_equal_p, scm_i_vector_equal_p): Renamed former to
556 latter. Changed use in eq.c.
557
f01fe441
MV
5582005-01-07 Marius Vollmer <mvo@zagadka.de>
559
560 Make the uniform vector routines also deal with one dimensional
561 arrays.
562
563 * srfi-4.c (SCM_IS_UVEC): New, use it instead of
564 SCM_SMOB_PREDICATE in this file.
565 (is_uvec): Also recognize one-dimensional uniform numeric arrays
566 of the right type.
567 (scm_is_uniform_vector): Likewise.
568 (uvec_fast_ref): Made BASE param const.
569 (uvec_writable_elements, uvec_elements): New.
570 (uvec_to_list, uvec_ref, uvec_set_x, uvec_length,
571 scm_c_uniform_vector_length, scm_c_uniform_vector_ref,
572 scm_c_uniform_set_x): Use them to also deal with one-dimensional
573 arrays.
574 (scm_uniform_vector_ref, scm_uniform_vector_set_x): Deprecate old
575 argument convention.
576 (scm_uniform_vector_to_list): Let uvec_to_list do all the
577 checking.
578 (scm_uniform_vector_length): Use uvec_length.
579
2aaf5726
MV
5802005-01-06 Marius Vollmer <marius.vollmer@uni-dortmund.de>
581
582 * srfi-4.h, srfi-4.c (scm_c_uniform_vector_element_size,
583 scm_c_uniform_vector_size): Removed.
584 (scm_array_handle_uniform_element_size): New.
585
586
587 * unif.h (scm_array_handle_ref, scm_array_handle_set): Changed
588 type of POS parameter to be signed, positions can be negative.
589 (scm_array_handle_release): New, changed all uses of
590 scm_t_array_handle to properly call it.
591 (scm_vector_get_handle, scm_generalized_vector_get_handle):
592 Renamed former to latter, changed all uses.
593
34ae52fc
MV
5942005-01-05 Marius Vollmer <mvo@zagadka.de>
595
596 Updated bitvector routines to also use scm_t_array_handles.
597
598 * unif.h (scm_bitvector_elements,
599 scm_bitvector_writable_elements): Use a scm_t_array_handle and
600 deliver offset, length and increment to caller. Changed all uses.
601 (scm_bitvector_release_elements,
602 scm_frame_bitvector_release_elements,
603 scm_bitvector_release_writable_elements,
604 scm_frame_bitvector_release_writable_elements): Removed.
605 (scm_array_handle_bit_elements,
606 scm_array_handle_bit_writable_elements,
607 scm_array_handle_bit_elements_offset): New.
608 (scm_make_typed_array): The special value for non-initialized
609 arrays is now SCM_UNSPECIFIED. The old special value SCM_BOOL_F
610 was a valid value to fill bitvectors with, so it can't really be
611 specialed out.
612
c4cb7628
KR
6132005-01-04 Kevin Ryde <user42@zip.com.au>
614
615 * stime.c (scm_strftime): Free t.tm_zone produced by bdtime2c.
616 Reported by Bill Schottstaedt.
617
0356881d
MV
6182005-01-02 Marius Vollmer <mvo@zagadka.de>
619
620 * sort.c (quicksort): Added INC parameter for non-contigous
621 vectors.
622 (quicksort1): New, for contigous vectors. Both functions are
623 generated from the same code by including "quicksort.i.c".
624 (scm_restricted_vector_sort_x): Call one of quicksort and
625 quicksort1, depending on increment of vector.
626 (scm_sort): Simply call scm_sort_x on a copy of the list or
627 vector.
628 (scm_merge_vector_x, scm_merge_vector_step): Changed indices to
629 size_t, added inc parameter.
630 (scm_stable_sort_x): Allocate temporary storage as Scheme vector
631 so that it doesn't leak.
632 (scm_stable_sort): Simply call scm_stable_sort_x on a copy of the
633 list or vector.
634
635 * ramap.c (scm_array_map_x): Do not try to convert fill value
636 before filling, any necessary conversion is done while storing.
637
638 * gc-card.c (scm_i_sweep_card): Call scm_i_vector_free instead of
639 doing it inline.
640
641 * hashtab.c, hashtab.h (SCM_HASHTABLE_BUCKETS): Removed.
642 (SCM_HASHTABLE_BUCKET, SCM_HASHTABLE_BUCKET_LOC): New. Replaced
643 all uses of SCM_HASHTABLE_BUCKETS with SCM_HASHTABLE_BUCKET.
644
645 * tags.h, weaks.c, vports.c, hashtab.c, convert.c, sort.c,
646 convert.c, convert.h, convert.i.c, deprecated.c, environments.c,
647 eval.c, filesys.c, fluids.c, gc-mark.c, gh.h, gh_data.c, goops.c,
648 hash.c, init.c, libguile_la-arrays.loT, modules.c, net_db.c,
649 objects.c, ports.c, posix.c, print.c, random.c, read.c,
650 regex-posix.c, scmsigs.c, socket.c, stime.c, symbols.c: Use new
651 vector elements API or simple vector API, as appropriate. Removed
652 SCM_HAVE_ARRAYS ifdefery. Replaced all uses of
653 SCM_HASHTABLE_BUCKETS with SCM_HASHTABLE_BUCKET.
654
655 * srfi-4.h, srfi-4.c,
656 srfi-4.i.c (scm_array_handle_uniform_elements,
657 scm_array_handle_uniform_writable_elements,
658 scm_uniform_vector_elements,
659 scm_uniform_vector_writable_elements):
660 (scm_<foo>vector_elements, scm_<foo>vector_writable_elements): Use
661 scm_t_array_handle, deliver length and increment.
662 (scm_array_handle_<foo>_elements,
663 scm_array_handle_<foo>_writable_elements): New.
664
665 * gen-scmconfig.h.in (SCM_I_GSC_HAVE_ARRAYS): Removed.
666 * gen-scmconfig.c: Hard code SCM_HAVE_ARRAYS to "1".
667
668 * unif.h, unif.c (scm_t_array_handle, scm_array_get_handle,
669 scm_array_handle_rank, scm_array_handle_dims, scm_array_handle_ref
670 scm_array_handle_set, scm_array_handle_elements
671 scm_array_handle_writable_elements, scm_vector_get_handle): New.
672 (scm_make_uve, scm_array_prototype, scm_list_to_uniform_array,
673 scm_dimensions_to_uniform_array): Deprecated for real.
674 (scm_array_p, scm_i_array_p): Use latter for SCM_DEFINE since
675 snarfing wont allow a mismatch between C and Scheme arglists.
676 (scm_make_shared_array, scm_enclose_array): Correctly use
677 scm_c_generalized_vector_length instead of
678 scm_uniform_vector_length.
679
680 * validate.h (SCM_VALIDATE_VECTOR,
681 SCM_VALIDATE_VECTOR_OR_DVECTOR): use scm_is_simple_vector instead
682 of SCM_VECTORP.
683
684 * weaks.h, weaks.c: Use new internal weak vector API from
685 vectors.h.
686
687 * Makefile.am (libguile_la_SOURCES, DOT_X_FILES, DOT_DOC_FILES,
688 EXTRA_libguile_la_SOURCES): Changed ramap.c and unif.c from being
689 'extra' to being regular sources.
690 (noinst_HEADERS): Added quicksort.i.c.
691 * quicksort.i.c: New file.
692
693 * vectors.h, vector.c (SCM_VECTORP, SCM_VECTOR_LENGTH, SCM_VELTS,
694 SCM_WRITABLE_VELTS, SCM_VECTOR_REF, SCM_VECTOR_SET): Deprecated
695 and reimplemented. Replaced all uses with scm_vector_elements,
696 scm_vector_writable_elements, or SCM_SIMPLE_VECTOR_*, as
697 appropriate.
698 (scm_is_simple_vector, SCM_SIMPLE_VECTOR_LENGTH,
699 SCM_SIMPLE_VECTOR_REF, SCM_SIMPLE_VECTOR_SET,
700 SCM_SIMPLE_VECTOR_LOC): New.
701 (SCM_VECTOR_BASE, SCM_SET_VECTOR_BASE, SCM_VECTOR_MAX_LENGTH,
702 SCM_MAKE_VECTOR_TAG, SCM_SET_VECTOR_LENGTH,
703 SCM_VELTS_AS_STACKITEMS, SCM_SETVELTS, SCM_GC_WRITABLE_VELTS):
704 Removed.
705 (scm_vector_copy): New.
706 (scm_vector_elements, scm_vector_writable_elements): Use
707 scm_t_array_handle, deliver length and increment. Moved to
708 unif.h. Changed all uses.
709 (scm_vector_release_elements,
710 scm_vector_release_writable_elements,
711 (scm_frame_vector_release_elements,
712 scm_frame_vector_release_writable_elements): Removed.
713 (SCM_I_IS_VECTOR, SCM_I_VECTOR_ELTS, SCM_I_VECTOR_WELTS,
714 SCM_I_VECTOR_LENGTH, scm_i_vector_free): New internal API.
715 (SCM_I_WVECTP SCM_I_WVECT_LENGTH SCM_I_WVECT_VELTS
716 SCM_I_WVECT_GC_WVELTS SCM_I_WVECT_TYPE SCM_I_WVECT_GC_CHAIN
717 SCM_I_SET_WVECT_GC_CHAIN, scm_i_allocate_weak_vector): New, for
718 weak vectors.
719
0336d18b
MV
7202004-12-29 Marius Vollmer <mvo@zagadka.de>
721
722 No longer use creators to specify the type of an array. Creators
723 expose the fact that arrays are wrapped around vectors, but that
724 might change.
725
726 * srfi-4.h (scm_i_proc_make_u8vector, scm_i_proc_make_s8vector,
727 scm_i_proc_make_u16vector, scm_i_proc_make_s16vector,
728 scm_i_proc_make_u32vector, scm_i_proc_make_s32vector,
729 scm_i_proc_make_u64vector, scm_i_proc_make_s64vector,
730 scm_i_proc_make_f32vector, scm_i_proc_make_f64vector,
731 scm_i_proc_make_c32vector, scm_i_proc_make_c64vector,
732 uvec_proc_vars): Removed.
733 (scm_i_generalized_vector_creator): Removed.
734 (scm_i_generalized_vector_type): New.
735
736 * unif.h, unif.c (scm_typed_array_p, scm_make_array,
737 scm_make_typed_array, scm_array_type, scm_list_to_array,
738 scm_list_to_typed_array, scm_is_array, scm_is_typed_array): New.
739 (scm_array_creator): Removed.
740 (scm_array_p): Deprecated second PROT argument.
741 (scm_dimensions_to_uniform_array, scm_list_to_uniform_array):
742 Deprecated, reimplemented in terms of scm_make_typed_array and
743 scm_list_to_typed_array.
744 (scm_i_proc_make_vector, scm_i_proc_make_string,
745 scm_i_proc_make_bitvector): Removed.
746 (type_creator_table, init_type_creator_table, type_to_creator,
747 make_typed_vector): New.
748 (scm_i_convert_old_prototype): Removed.
749 (prototype_to_type): New.
750 (scm_make_uve): Deprecated, reimplemented using make_typed_vector.
751 (scm_array_dimensions): Use scm_list_1 instead of scm_cons for
752 minor added clarity.
753 (scm_make_shared_array, scm_ra2contig): Use make_typed_vector
754 instead of scm_make_uve.
755 (tag_creator_table, scm_i_tag_to_creator): Removed.
756 (tag_to_type): New.
757 (scm_i_read_array): Use scm_list_to_typed_array instead of
758 scm_list_to_uniform_array.
759
277e8472
MV
7602004-12-27 Marius Vollmer <mvo@zagadka.de>
761
32b26202
MV
762 * unif.h, unif.c (scm_bitvector_elements): Made return value "const".
763 (scm_bitvector_writable_elements): New.
764 (scm_bitvector_release, scm_bitvector_release_elements):
765 Renamed former to latter. Added explicit call to
766 scm_remember_upto_here_1.
767 (scm_frame_bitvector_release,
768 scm_frame_bitvector_release_elements): Renamed former to latter.
769 (scm_bitvector_release_writable_elements,
770 scm_bitvector_release_writable_elements): New.
771 Changed all uses as required by the changes above.
772
773 * srfi-4.h, srfi-4.c, srfi-4.i.c (scm_uniform_vector_elements,
774 scm_u8vector_elements, etc): Made return value "const".
775 (scm_uniform_vector_writable_elements,
776 scm_u8vector_writable_elements, etc): New.
777 (scm_uniform_vector_release, scm_uniform_vector_release_elements):
778 Renamed former to latter. Added explicit call to
779 scm_remember_upto_here_1.
780 (scm_frame_uniform_vector_release,
781 scm_frame_uniform_vector_release_elements): Renamed former to latter.
782 (scm_uniform_vector_release_writable_elements,
783 scm_frame_uniform_vector_release_writable_elements): New. Takes
784 crown of longest identifier yet.
785 Changed all uses as required by the changes above.
786
277e8472
MV
787 * vectors.h, vectors.c (scm_c_vector_set_x): Make return type
788 void.
789 (scm_is_vector, scm_vector_p, scm_vector_length,
790 scm_c_vector_length, scm_vector_ref, scm_c_vector_ref,
791 scm_vector_set_x, scm_c_vector_set_x, scm_vector_to_list,
792 scm_vector_move_left_x, scm_vector_move_right_x,
793 scm_vector_fill_x): handle one-dimensional arrays.
32b26202
MV
794 (scm_vector_elements, scm_vector_release_elements,
795 scm_vector_frame_release_elements, scm_vector_writable_elements,
796 scm_vector_release_writable_elements,
797 scm_vector_frame_release_writable_elements): New.
798 (scm_list_to_vector, scm_vector_to_list, scm_vector_fill,
799 scm_vector_move_left_x, scm_vector_move_right_x): Use them.
277e8472
MV
800
801 * ramap.c (scm_ramapc, scm_raeql): Use
802 scm_c_generalized_vector_length instead of
803 scm_uniform_vector_length.
804 (scm_ramap, rafe): Use scm_c_vector_ref instead of SCM_VELTS. use
805 scm_c_generalized_vector_ref instead of scm_uniform_vector_ref.
806
49c51610
MV
8072004-12-23 Marius Vollmer <marius.vollmer@uni-dortmund.de>
808
809 * continuations.h, continuations.c (scm_t_contregs): New 'offset'
810 member for relocating debug frames.
811 (scm_make_continuation): Set it.
812
813 * stacks.c (read_frame, read_frames, scm_make_stack,
814 scm_last_stack_frame, scm_stack_id): Use the new 'offset' member
815 of continuations instead of calculating the offset ourselves.
816 Relocate 'vect' member of scm_t_debug_frame.
817
3b2ee265
KR
8182004-12-16 Kevin Ryde <user42@zip.com.au>
819
820 * ramap.c (scm_array_map_x): Check for at least one source argument.
821
e120686a
KR
8222004-12-14 Kevin Ryde <user42@zip.com.au>
823
824 * srfi-13.c (string-any, string-every): Use a scheme wrapper around
825 the C code so for the final call to the predicate procedure is a tail
826 call, per SRFI-13 spec.
827
680b5237
KR
8282004-12-10 Kevin Ryde <user42@zip.com.au>
829
830 * eq.c (scm_eq_p, scm_eqv_p, scm_equal_p): Update docstrings from
831 recent revision to the reference manual.
832
833 * numbers.c (scm_modulo): Amend fixme comment about negative divisor
834 with "%", C99 says it's well-defined.
835
836 * socket.c (scm_from_ipv6): Just use mpz_import. Don't bother trying
837 to fit scm_from_ulong_long, since that uses mpz_import anyway. Don't
838 bother trying to fit scm_from_ulong, not really worth the trouble if
839 addresses are more than 4 bytes usually.
840
446d320c
KR
8412004-11-30 Kevin Ryde <user42@zip.com.au>
842
843 * gc_os_dep.c (NetBSD): Test __m68k__ and __arm__ as well as m68k and
844 arm32. Reported by Greg Troxel.
845
f2654760
MV
8462004-11-14 mvo <mvo@zagadka.de>
847
848 * unif.c, unif.h (scm_i_cvref): Made non-static for ramap.c.
849
850 * Makefile.am (INCLUDES): It is "@LTDLINCL@", not "@LTDLINC@".
851
d550e35f
MV
8522004-11-12 Marius Vollmer <marius.vollmer@uni-dortmund.de>
853
854 Enclosed arrays are now their own smob. This has been done to
855 make the code more explicit about them and to prepare for the time
f2654760
MV
856 when generalized vectors include arbitrary one-dimensional
857 arrays. (Uptonow, enclosed arrays have been recognized by their
858 use of an array as their storage 'vector'. When all generalized
859 vectors are allowed as storage, including one-dimensional arrays,
860 this will no longer work.)
d550e35f
MV
861
862 * unif.h, unif.c: (scm_tc16_enclosed_array, SCM_ENCLOSED_ARRAYP):
863 New.
864 (exactly_one_third, singp): Removed.
865 (scm_array_p, scm_array_dimensions, scm_shared_array_root,
866 scm_shared_array_offset, scm_shared_array_increments): Handle
867 enclosed arrays explicitely.
868 (scm_array_rank): Likewise. Also, do not return zero for
869 non-arrays, signal an error instead since arrays with rank zero do
870 exist.
871 (scm_i_make_ra): New, for specifying the tag of the new array.
872 (scm_make_enclosed_array): Use it.
873 (scm_make_ra): Reimplemented in terms of scm_i_make_ra.
874 (scm_make_shared_array): Use scm_c_generalized_vector_length
875 instead of scm_uniform_vector_length.
876 (scm_array_in_bounds_p): Rewritten to be much cleaner.
877 (scm_i_cvref): New, doing the job of scm_cvref.
878 (scm_cvref): Use scm_i_cvref.
879 (scm_array_ref): Do not accept non-arrays when no indices are
880 given. Use scm_i_cvref to do the actual access.
881 ("uniform-array-set1"): Do not register.
882 (scm_array_set_x, scm_uniform_array_read_x,
883 scm_uniform_array_write): Handle enclosed arrays explicitly.
884 (ra2l): Use scm_i_cvref instead of scm_uniform_vector_ref to also
885 handle enclosed arrays.
886 (scm_array_to_list): Handle enclosed arrays explicitly.
887 (rapr1): Removed.
888 (scm_i_print_array_dimension): Use scm_i_cvref to also handle
889 enclosed arrays.
890 (scm_i_print_enclosed_array): New.
891 (tag_proto_table, tag_creator_table): Renamed former to latter.
892 Added "a" and "b" for strings and bitvectors, resp.
893 (scm_i_tag_to_prototype, scm_i_tag_to_creator): Renamed former to
894 latter. Tag "a" is in the table now, no need to handle it as a
895 legacy tag.
896 (scm_raprin1): Just call scm_iprin1.
897 (scm_array_creator, scm_array_prototype): Handle enclosed arrays
898 explicitly.
899 (scm_init_unif): Initialize scm_tc16_enclosed_array smob.
900 Use scm_i_print_array as printer for scm_tc16_array.
901
2ed34885
MV
9022004-11-10 Marius Vollmer <mvo@zagadka.de>
903
823086c1
MV
904 * ramap.c (cind): Changed second arg to be pointer to long instead
905 of uniform vector.
906 (scm_ramapc): Allocate index vector with scm_malloc and not as
d550e35f 907 uniform vector. Wrap it in a frame so that it gets properly freed.
823086c1
MV
908 (scm_array_index_map_x): Likewise.
909
910 * unif.c: Changed all uses of scm_array_prototype to
911 scm_array_creator. (scm_i_get_old_prototype): Signal error when no
912 prototype is known.
913 (scm_uniform_array_read_x, scm_uniform_array_write): Reimplemented
914 in terms of scm_uniform_vector_read_x and
915 scm_uniform_vector_write, respectively. Strings and
916 bitvector support has been dropped.
917
2ed34885
MV
918 * srfi-4.h, srfi-4.c: Do not include <libguile.h>, include the
919 needed files directly. Include config.h, <unistd.h> and <io.h>
920 when available.
921 (scm_uniform_vector_read_x, scm_uniform_vector_write): New.
922
2c72f253
MV
9232004-11-09 Marius Vollmer <mvo@zagadka.de>
924
925 * gh_data.c (gh_uniform_vector_length): Properly use
926 scm_c_uniform_vector_length instead of scm_uniform_vector_length.
927
3cc0a296
MV
9282004-11-09 Marius Vollmer <marius.vollmer@uni-dortmund.de>
929
930 * srfi-4.h (scm_c_uniform_vector_ref, scm_c_uniform_vector_set_x):
931 New.
932 (scm_i_uniform_vector_creator): Removed.
933 (scm_i_generalized_vector_creator): New.
934 (scm_uniform_vector_length, scm_uniform_element_size): Do not
935 handle generalized vectors, only uniform numeric vectors.
936 (alloc_uvec): Do length check here...
937 (make_uvec): ...but not here.
938 (coerce_to_uvec): Use new generalized vector functions to handle
939 all kinds of vectors in one go.
940
941 * tags.h (scm_tc7_bvect): Renamed to scm_tc7_unused7, renaming the
942 remaining scm_tc7_unused tags to get a neatly ordered list.
943
944 * eq.c, evalext.c, gc-card.c, gc-mark.c, objects.c, print.c: Do no
945 longer handle scm_tc7_bvect bitvectors.
946
947 * ramap.c: Use the new generalized vector functions to handle all
948 vector like things.
949
950 * vectors.h, vectors.c (scm_is_vector, scm_c_vector_length,
951 scm_c_vector_ref, scm_c_vector_set_x, scm_generalized_vector_p,
952 scm_generalized_vector_length, scm_generalized_vector_ref,
953 scm_generalized_vector_set_x, scm_generalized_vector_to_list,
954 scm_is_generalized_vector, scm_c_generalized_vector_length,
955 scm_c_generalized_vector_ref, scm_c_generalized_vector_set_x):
956 New.
957
958 * unif.h, unif.c (scm_bitvector_p, scm_bitvector,
959 scm_make_bitvector, scm_bitvector_length, scm_bitvector_ref,
960 scm_bitvector_set_x, scm_list_to_bitvector, scm_bitvector_to_list,
961 scm_bitvector_fill_x, scm_is_bitvector, scm_c_make_bitvector,
962 scm_c_bitvector_length, scm_c_bitvector_ref,
963 scm_c_bitvector_set_x, scm_bitvector_elements,
964 scm_bitvector_release, scm_frame_bitvector_release,
965 scm_tc16_bitvector, bitvector_free, bitvector_print,
966 bitvector_equalp, count_ones, find_first_one): New.
967 (scm_bit_count, scm_bit_position, scm_bit_set_star_x,
968 scm_bit_count_star, scm_bit_invert_x, scm_istr2bve): Rewritten
969 using the new C API for bitvectors and maybe count_ones or
970 find_first_one, as appropriate.
971 (SCM_I_MAX_LENGTH, SCM_BITVECTOR_P, SCM_BITVECTOR_BASE,
972 SCM_SET_BITVECTOR_BASE, SCM_BITVECTOR_MAX_LENGTH,
973 SCM_BITVECTOR_LENGTH, SCM_MAKE_BITVECTOR_TAG,
974 SCM_SET_BITVECTOR_LENGTH): Removed. Replaced all uses with the
975 new functions from above.
976 (scm_i_proc_make_vector, scm_i_proc_make_string,
977 scm_i_proc_make_bitvector): Made non-static for use in
978 scm_i_generalized_vector_creator.
979 (scm_make_u1vector): Removed, replaced by scm_make_bitvector.
980 (scm_make_uve): Validate that the created object is a generalized
981 vector.
982 (scm_i_legacy_tag): Removed.
983 (scm_i_print_array): Do it here.
984 (scm_raprin1): Only print enclosed arrays.
985
986 * Makefile.am (DOT_DOC_FILES): Added srfi-4.doc.
987
c24d026b
MV
9882004-11-04 Marius Vollmer <marius.vollmer@uni-dortmund.de>
989
1f2328fe
MV
990 * srfi-4.c (make_uvec): Use SCM_I_SIZE_MAX instead of SIZE_MAX for
991 added portability.
992
993 * chars.c (scm_charnames, scm_charnums): Added "sp" as an alias
994 for "space". Thanks to Bruce Korb!
995
c24d026b
MV
996 * rw.c (scm_read_string_x_partial): Bugfix, apply offset to dest
997 only after dest has been set. Thanks to Hyper Division!
998
999 * gh_data.c (gh_uniform_vector_length): Use
1000 scm_uniform_vector_length instead of SCM_UVECTOR_LENGTH.
1001
d4ea47c8
MV
10022004-11-03 Marius Vollmer <mvo@zagadka.de>
1003
1004 * unif.h (SCM_UVECTOR_BASE, SCM_SET_UVECTOR_BASE,
1005 SCM_UVECTOR_MAXLENGTH, SCM_UVECTOR_LENGTH, SCM_MAKE_UVECTOR_TAG,
1006 SCM_SET_UVECTOR_LENGTH): Removed.
1007
236288e2
MV
10082004-11-02 Marius Vollmer <mvo@zagadka.de>
1009
1010