* socket.c: use SCM_CHAR_BIT.
[bpt/guile.git] / libguile / ChangeLog
CommitLineData
43261b39
MD
12003-04-16 Mikael Djurfeldt <mdj@kvast.blakulla.net>
2
3 * feature.c (scm_init_feature): Always add threads feature.
4
58241edc
MD
52003-04-15 Mikael Djurfeldt <djurfeldt@nada.kth.se>
6
7 * goops.c (scm_sys_fast_slot_ref): Use SCM_SLOT instead of
8 scm_at_assert_bound_ref. (We don't want the unbound check. See
9 oop/goops/active-slot.scm.)
10
94e91275
RB
112003-04-14 Rob Browning <rlb@defaultvalue.org>
12
13 * tags.h: scm_t_intptr should have been intptr_t.
14
3071ea27
RB
152003-04-13 Rob Browning <rlb@defaultvalue.org>
16
17 * __scm.h (SCM_FLUSH_REGISTER_WINDOWS): don't just rely on "sparc"
18 test. Instead use
19 #if defined (sparc) || defined (__sparc__) || defined (__sparc)
20 as gc_os_dep.c suggests is appropriate.
21
22 * goops.c (prep_hashsets): make static to match prototype.
23 (scm_sym_args): SCM_SYMBOL -> SCM_GLOBAL_SYMBOL. Thanks to Albert
24 Chin.
25
26 * c-tokenize.lex: remove trailing comma from enum. Thanks to
27 Albert Chin.
28
29 * gc_os_dep.c: add NetBSD powerpc config info. Thanks to Thomas
30 Klausner.
31
21ab2aeb
MD
322003-04-13 Mikael Djurfeldt <djurfeldt@nada.kth.se>
33
34 * goops.c (scm_sys_prep_layout_x): Instance allocation is now
35 indicated through extra fields in getters-n-setters.
36 (scm_add_slot): Adapted to new format of getters_n_setters slot.
37 (Thanks to Andy Wingo.)
38
dff96e95
HWN
392003-02-25 Han-Wen Nienhuys <hanwen@cs.uu.nl>
40
41 * gc-segment.c: add comment
42
07921c76
RB
432003-04-07 Rob Browning <rlb@defaultvalue.org>
44
b5331f10
RB
45 * debug.h: change "id" arg name to "info_id" to avoid objective-c
46 clash.
47
07921c76
RB
48 * num2integral.i.c (NUM2INTEGRAL): fix bug pointed out by Mikael
49 and add regression test to standalone/.
50
512003-04-06 Rob Browning <rlb@defaultvalue.org>
52
53 * strings.c (scm_mem2string): use memcpy rather than by-hand loop.
54 Thanks to Dale P. Smith.
55
56 * random.c: #include gmp.h.
57 (scm_c_random_bignum): normalize result on return.
58
59 * init.c: #include gmp.h.
60
61 * numbers.h: remove the gmp.h #include (not needed now).
62
63 * posix.h: change occurences of "id" to something else so we don't
64 cause trouble when included via objective-c (can't hurt, might
65 help). Still have usage in debug.h, though.
66
938f6b7c
MD
672003-04-06 Mikael Djurfeldt <djurfeldt@nada.kth.se>
68
372691d8
MD
69 * random.c (scm_c_random_bignum): Don't generate a random number
70 equal to m (the second argument of scm_c_random_bignum); only
71 generate numbers in the range 0 <= r < m.
c5f268f8
MD
72 (scm_c_default_rstate): Use SCM_VARIABLE_REF to access
73 scm_var_random_state.
372691d8 74
938f6b7c
MD
75 * num2integral.i.c (INTEGRAL2BIG): Put negation of n inside then
76 clause.
77
6cdb8c3f
RB
782003-04-05 Rob Browning <rlb@defaultvalue.org>
79
938f6b7c 80 * modules.c (scm_module_import_interface): move declaration of
6cdb8c3f
RB
81 uses before any code.
82
15635be5
MD
832003-04-05 Mikael Djurfeldt <djurfeldt@nada.kth.se>
84
1ecfd013
MD
85 * Makefile.am (scmconfig.h): Look for config.h in top_builddir,
86 not top_srcdir.
87
15635be5
MD
88 * hashtab.c (rehash_after_gc): Clear to_rehash list before
89 processing it in order to avoid an infinite loop.
90
91 * print.c (scm_prin1): Remember old state of pstate->writingp.
92
73be1d9e
MV
932003-04-05 Marius Vollmer <mvo@zagadka.de>
94
95 * Changed license terms to the plain LGPL thru-out.
96
ad815c06
RB
972003-04-04 Rob Browning <rlb@defaultvalue.org>
98
99 * socket.c (FLIPCPY_NET_HOST_128): new macro.
100 (ipv6_net_to_num, ipv6_num_to_net, bignum_in_ipv6_range_p):
101 rewrite to handle GMP bignums.
102
103
104 * random.c (scm_c_random_bignum): rewrite to handle GMP bignums.
105
106 * ports.c (scm_getc): minor tweak.
107
108 * numbers.h: remove SCM_BIGDIG conditionals, reorganize, and
109 rewrite to handle GMP bignums.
110
111 * numbers.c: rewrite *many* functions to handle GMP bignums.
112
113 * num2integral.i.c (NUM2INTEGRAL, INTEGRAL2NUM, INTEGRAL2BIG):
114 handle GMP bignums.
115
116 * num2float.i.c (NUM2FLOAT): handle GMP bignums.
117
118 * init.c (check_config): remove SCM_BIGDIG conditionals.
119 (scm_init_guile_1): test to make sure mpz_t fits in a double_cell.
120
121 * gc-card.c ("sweep_card"): handle new mpz_t bignums.
122
123 * eval.c: remove SCM_BIGDIG conditionals.
124
125 * eq.c (s_scm_eqv_p): scm_i_bigcomp -> scm_i_bigcmp.
126
6cdb8c3f
RB
1272003-03-31 Rob Browning <rlb@defaultvalue.org>
128
129 * Makefile.am (scmconfig.h): change srcdir to builddir. (Thanks
130 to Kevin Ryde.)
131
1322003-03-27 Rob Browning <rlb@defaultvalue.org>
133
134 * threads.h: fix various preprocessor usages of new public
135 symbols to expect 0 or 1 values rather than 1 or undefined.
136 i.e. change #ifdef to #if, etc.
137
138 * threads.c: fix various preprocessor usages of new public
139 symbols to expect 0 or 1 values rather than 1 or undefined.
140 i.e. change #ifdef to #if, etc.
141
142 * tags.h: fix various preprocessor usages of new public
143 symbols to expect 0 or 1 values rather than 1 or undefined.
144 i.e. change #ifdef to #if, etc.
145
146 * stacks.c: fix various preprocessor usages of new public
147 symbols to expect 0 or 1 values rather than 1 or undefined.
148 i.e. change #ifdef to #if, etc.
149
150 * stackchk.h: fix various preprocessor usages of new public
151 symbols to expect 0 or 1 values rather than 1 or undefined.
152 i.e. change #ifdef to #if, etc.
153
154 * stackchk.c: fix various preprocessor usages of new public
155 symbols to expect 0 or 1 values rather than 1 or undefined.
156 i.e. change #ifdef to #if, etc.
157
158 * sort.c: fix various preprocessor usages of new public
159 symbols to expect 0 or 1 values rather than 1 or undefined.
160 i.e. change #ifdef to #if, etc.
161
162 * read.c: fix various preprocessor usages of new public
163 symbols to expect 0 or 1 values rather than 1 or undefined.
164 i.e. change #ifdef to #if, etc.
165
166 * random.c: fix various preprocessor usages of new public
167 symbols to expect 0 or 1 values rather than 1 or undefined.
168 i.e. change #ifdef to #if, etc.
169
170 * print.c: fix various preprocessor usages of new public
171 symbols to expect 0 or 1 values rather than 1 or undefined.
172 i.e. change #ifdef to #if, etc.
173
174 * objects.c: fix various preprocessor usages of new public
175 symbols to expect 0 or 1 values rather than 1 or undefined.
176 i.e. change #ifdef to #if, etc.
177
178 * numbers.h: fix various preprocessor usages of new public
179 symbols to expect 0 or 1 values rather than 1 or undefined.
180 i.e. change #ifdef to #if, etc.
181
182 * null-threads.c: fix various preprocessor usages of new public
183 symbols to expect 0 or 1 values rather than 1 or undefined.
184 i.e. change #ifdef to #if, etc.
185
186 * lang.c: fix various preprocessor usages of new public
187 symbols to expect 0 or 1 values rather than 1 or undefined.
188 i.e. change #ifdef to #if, etc.
189
190 * lang.h: fix various preprocessor usages of new public
191 symbols to expect 0 or 1 values rather than 1 or undefined.
192 i.e. change #ifdef to #if, etc.
193
194 * iselect.h: fix various preprocessor usages of new public
195 symbols to expect 0 or 1 values rather than 1 or undefined.
196 i.e. change #ifdef to #if, etc.
197
198 * init.c: fix various preprocessor usages of new public
199 symbols to expect 0 or 1 values rather than 1 or undefined.
200 i.e. change #ifdef to #if, etc.
201
202 * gh_data.c: fix various preprocessor usages of new public
203 symbols to expect 0 or 1 values rather than 1 or undefined.
204 i.e. change #ifdef to #if, etc.
205
206 * gh.h: fix various preprocessor usages of new public
207 symbols to expect 0 or 1 values rather than 1 or undefined.
208 i.e. change #ifdef to #if, etc.
209
210 * gen-scmconfig.c: change most new public symbols to be defined to
211 0 or 1 rather than being either 1 or undefined.
212
213 * gc_os_dep.c: fix various preprocessor usages of new public
214 symbols to expect 0 or 1 values rather than 1 or undefined.
215 i.e. change #ifdef to #if, etc.
216 (STACK_GROWS_DOWN): define to 0 or 1 rather than 1 or undef.
217
218 * gc.h: fix various preprocessor usages of new public
219 symbols to expect 0 or 1 values rather than 1 or undefined.
220 i.e. change #ifdef to #if, etc.
221
222 * gc-card.c: fix various preprocessor usages of new public
223 symbols to expect 0 or 1 values rather than 1 or undefined.
224 i.e. change #ifdef to #if, etc.
225
226 * gc-mark.c: fix various preprocessor usages of new public
227 symbols to expect 0 or 1 values rather than 1 or undefined.
228 i.e. change #ifdef to #if, etc.
229
230 * feature.c: fix various preprocessor usages of new public
231 symbols to expect 0 or 1 values rather than 1 or undefined.
232 i.e. change #ifdef to #if, etc.
233
234 * evalext.c: fix various preprocessor usages of new public
235 symbols to expect 0 or 1 values rather than 1 or undefined.
236 i.e. change #ifdef to #if, etc.
237
238 * eval.h: fix various preprocessor usages of new public
239 symbols to expect 0 or 1 values rather than 1 or undefined.
240 i.e. change #ifdef to #if, etc.
241
242 * eval.c: fix various preprocessor usages of new public
243 symbols to expect 0 or 1 values rather than 1 or undefined.
244 i.e. change #ifdef to #if, etc.
245
246 * eq.c: fix various preprocessor usages of new public
247 symbols to expect 0 or 1 values rather than 1 or undefined.
248 i.e. change #ifdef to #if, etc.
249
250 * coop.c: fix various preprocessor usages of new public
251 symbols to expect 0 or 1 values rather than 1 or undefined.
252 i.e. change #ifdef to #if, etc.
253
254 * coop-threads.c: fix various preprocessor usages of new public
255 symbols to expect 0 or 1 values rather than 1 or undefined.
256 i.e. change #ifdef to #if, etc.
257
258 * coop-pthreads.c: fix various preprocessor usages of new public
259 symbols to expect 0 or 1 values rather than 1 or undefined.
260 i.e. change #ifdef to #if, etc.
261
262 * coop-defs.h: fix various preprocessor usages of new public
263 symbols to expect 0 or 1 values rather than 1 or undefined.
264 i.e. change #ifdef to #if, etc.
265
266 * convert.i.c: fix various preprocessor usages of new public
267 symbols to expect 0 or 1 values rather than 1 or undefined.
268 i.e. change #ifdef to #if, etc.
269
270 * continuations.c: fix various preprocessor usages of new public
271 symbols to expect 0 or 1 values rather than 1 or undefined.
272 i.e. change #ifdef to #if, etc.
273
274 * _scm.h: fix various preprocessor usages of new public symbols to
275 expect 0 or 1 values rather than 1 or undefined. i.e. change
276 #ifdef to #if, etc.
277
d11d697a
MV
2782003-03-26 Marius Vollmer <marius.vollmer@uni-dortmund.de>
279
9686f86d
MV
280 * init.c (scm_init_guile_1): Call scm_i_init_deprecated.
281
282 * deprecated.c, deprecated.h: New files, to collect deprecated
283 things in one place.
284 * Makefile.am: Added them in all the right places.
285
d11d697a
MV
286 * Makefile.am (EXTRA_DIST): Added "scmconfig.h.top".
287 (scmconfig.h): Get "scmconfig.h.top" from $(srcdir) so that VPATH
288 builds work.
9686f86d
MV
289 (DOT_X_FILES): Removed "iselect.x".
290 (DOT_DOC_FILES): Removed "iselect.doc".
d11d697a 291
e3c0c3b9
RB
2922003-03-25 Rob Browning <rlb@defaultvalue.org>
293
294 * win32-socket.h: #include "libguile/__scm.h". Replace usage of
295 HAVE_WINSOCK2_H with SCM_HAVE_WINSOCK2_H.
296
297 * win32-socket.c: #include <config.h> if HAVE_CONFIG_H.
298
299 * vports.c: #include <config.h> if HAVE_CONFIG_H.
300
301 * unif.c: #include <config.h> if HAVE_CONFIG_H. Replace usage of
302 HAVE_LONG_LONGS with "SCM_SIZEOF_LONG_LONG != 0".
303
304 * threads.h: replace usage of struct timespect with
305 scm_t_timespec. Replace usage of USE_PTHREAD_THREADS with
306 SCM_USE_PTHREAD_THREADS. Remove typedef for struct timespec in
307 favor of scm_t_timespec from scmconfig.h.
308
309 * threads.c: move libguile/_scm.h include to the top so we pick up
310 any critical defines like _GNU_SOURCE early. Replace usage of
311 struct timespect with scm_t_timespec. Replace usage of
312 STACK_GROWS_UP with SCM_STACK_GROWS_UP. Replace usage of
313 USE_PTHREAD_THREADS with SCM_USE_PTHREAD_THREADS.
314
315 * threads-plugin.h: replace usage of struct timespect with
316 scm_t_timespec.
317
318 * threads-plugin.c: #include <config.h> if HAVE_CONFIG_H. Replace
319 usage of struct timespect with scm_t_timespec.
320
321 * tags.h: move HAVE_STDINT_H handling to scmconfig.h. Move
322 HAVE_INTTYPES_H handling to scmconfig.h. #include
323 "libguile/__scm.h". Rework handling for scm_t_bits,
324 scm_t_signed_bits, SCM_T_BITS_MAX, SCM_T_SIGNED_BITS_MAX,
325 SCM_T_SIGNED_BITS_MIN, and SIZEOF_SCM_T_BITS to use scm_t_intptr,
326 scm_t_uintptr, SCM_SIZEOF_INTPTR_T, and SCM_SIZEOF_UINTPTR_T, and
327 SCM_SIZEOF_UNSIGNED_LONG. Rename usage of HAVE_ARRAYS to
328 SCM_HAVE_ARRAYS.
329
330 * symbols.c: #include <config.h> if HAVE_CONFIG_H.
331
332 * struct.c: #include <config.h> if HAVE_CONFIG_H.
333
334 * strports.c: #include <config.h> if HAVE_CONFIG_H.
335
336 * strop.c: #include <config.h> if HAVE_CONFIG_H.
337
338 * stime.h: move handling of time related headers to scmconfig.h.
339
340 * stime.c: #include <config.h> if HAVE_CONFIG_H.
341
342 * stacks.c: replace usage of STACK_GROWS_UP with
343 SCM_STACK_GROWS_UP.
344
345 * sort.c: #include <config.h> if HAVE_CONFIG_H. Rename usage of
346 HAVE_ARRAYS to SCM_HAVE_ARRAYS.
347
348 * socket.c: #include <config.h> if HAVE_CONFIG_H. Replace usage
349 of uint32 and HAVE_UINT_32 with scm_t_int32.
350
351 * smob.c: #include <config.h> if HAVE_CONFIG_H.
352
353 * simpos.c: #include <config.h> if HAVE_CONFIG_H.
354
355 * script.c: #include <config.h> if HAVE_CONFIG_H.
356
357 * scmsigs.c: #include <config.h> if HAVE_CONFIG_H.
358
359 * scmconfig.h.top: new file -- preamble for scmconfig.h.
360
361 * rw.c: #include <config.h> if HAVE_CONFIG_H.
362
363 * regex-posix.c: #include <config.h> if HAVE_CONFIG_H.
364
365 * read.c: rename usage of HAVE_ARRAYS to SCM_HAVE_ARRAYS.
366
367 * rdelim.c: #include <config.h> if HAVE_CONFIG_H.
368
369 * random.c: #include <config.h> if HAVE_CONFIG_H. Replace usage
370 of LONG32, LONG64, SIZEOF_LONG, and HAVE_LONG_LONGS with
371 scm_t_int32, scm_t_int64, and SCM_HAVE_T_INT64. Rename usage of
372 HAVE_ARRAYS to SCM_HAVE_ARRAYS.
373
374 * ramap.c: replace usage of HAVE_LONG_LONGS with
375 "SCM_SIZEOF_LONG_LONG != 0".
376
377 * putenv.c: #include <config.h> if HAVE_CONFIG_H. #include
378 "libguile/scmconfig.h".
379
380 * pthread-threads.c: #include <config.h> if HAVE_CONFIG_H.
381
382 * print.c: rename usage of HAVE_ARRAYS to SCM_HAVE_ARRAYS.
383 Replace usage of HAVE_LONG_LONGS with "SCM_SIZEOF_LONG_LONG != 0".
384
385 * posix.c: #include <config.h> if HAVE_CONFIG_H.
386
387 * ports.c: #include <config.h> if HAVE_CONFIG_H.
388
389 * objects.c: rename usage of HAVE_ARRAYS to SCM_HAVE_ARRAYS.
390
391 * numbers.h: replace usage of HAVE_FLOATINGPOINT_H with
392 SCM_HAVE_FLOATINGPOINT_H. Replace usage of HAVE_IEEEFP_H with
393 SCM_HAVE_IEEEFP_H. Replace usage of HAVE_NAN_H with
394 SCM_HAVE_NAN_H. Replace usage of STDC_HEADERS with
395 SCM_HAVE_STDC_HEADERS. Replace usage of ptrdiff_t with
396 scm_t_ptrdiff. Replace usage of HAVE_LONG_LONGS with
397 "SCM_SIZEOF_LONG_LONG != 0".
398
399 * numbers.c: #include <config.h> if HAVE_CONFIG_H. Replace usage
400 of HAVE_LONG_LONGS with "SCM_SIZEOF_LONG_LONG != 0". Replace
401 usage of ptrdiff_t with scm_t_ptrdiff. Replace usage of
402 SIZEOF_PTRDIFF_T with SCM_SIZEOF_SCM_T_PTRDIFF.
403
404 * num2integral.i.c: #include <config.h> if HAVE_CONFIG_H.
405
406 * null-threads.h: replace usage of struct timespect with
407 scm_t_timespec.
408
409 * net_db.c: #include <config.h> if HAVE_CONFIG_H.
410
411 * mkstemp.c: #include <config.h> if HAVE_CONFIG_H. #include
412 "libguile/__scm.h". Remove definition of gcc_uint64_t in favor of
413 scm_t_uint64 and rename usages.
414
415 * mallocs.c: #include <config.h> if HAVE_CONFIG_H.
416
417 * load.c: #include <config.h> if HAVE_CONFIG_H.
418
419 * iselect.h: move handling of time related headers to scmconfig.h.
420 Rename usage of HAVE_SYS_SELECT_H to SCM_HAVE_SYS_SELECT_H.
421 Rename usage of HAVE_WINSOCK2_H to SCM_HAVE_WINSOCK2_H. Rename
422 usage of USE_COOP_THREADS to SCM_USE_COOP_THREADS.
423
424 * iselect.c: #include <config.h> if HAVE_CONFIG_H. Rename usage
425 of USE_COOP_THREADS to SCM_USE_COOP_THREADS. Rename usage of
426 USE_NULL_THREADS to SCM_USE_NULL_THREADS.
427
428 * ioext.c: #include <config.h> if HAVE_CONFIG_H.
429
430 * inline.h: #include "libguile/__scm.h" at the top. Change code
431 to use SCM_C_INLINE and SCM_INLINE_C_INCLUDINT_INLINE_H to decide
432 what to do instead of creating a new public #define. Rename usage
433 of USE_COOP_THREADS to SCM_USE_COOP_THREADS. Rename usage of
434 USE_NULL_THREADS to SCM_USE_NULL_THREADS. Rename usage of
435 USE_COPT_THREADS to SCM_USE_COPT_THREADS.
436
437 * inline.c: rearrange handling -- now we just #define
438 SCM_INLINE_C_INCLUDING_INLINE_H to 1 and #include
439 "libguile/inline.h". scmconfig.h will define SCM_C_INLINE as
440 appropriate, and we use that in inline.h along with the above
441 define to determine how to respond.
442
443 * init.c: #include <config.h> if HAVE_CONFIG_H. Rename usage of
444 HAVE_ARRAYS to SCM_HAVE_ARRAYS.
445
446 * guile.c: #include <config.h> if HAVE_CONFIG_H.
447
448 * gh_data.c: #include <config.h> if HAVE_CONFIG_H. Rename usage
449 of HAVE_ARRAYS to SCM_HAVE_ARRAYS.
450
451 * gh.h: rename usage of HAVE_ARRAYS to SCM_HAVE_ARRAYS.
452
453 * gen-scmconfig.h.in: new file -- see gen-scmconfig.c for details.
454
455 * gen-scmconfig.c: new file -- see comments in file for details.
456
457 * gdbinit.c: #include <config.h> if HAVE_CONFIG_H.
458
459 * gc_os_dep.c: #include <config.h> if HAVE_CONFIG_H. Replace
460 usage of STACK_GROWS_UP with SCM_STACK_GROWS_UP.
461
462 * gc.h: replace usage of SIZEOF_LONG with
463 SCM_SIZEOF_UNSIGNED_LONG. Replace usage of USE_PTHREAD_THREADS
464 with SCM_USE_PTHREAD_THREADS. Remove SCM_SIZEOF_LONG definition
465 since we handle that in scmconfig.h now.
466
467 * gc.c: #include <config.h> if HAVE_CONFIG_H.
468
469 * gc-mark.c: #include <config.h> if HAVE_CONFIG_H. Rename usage
470 of HAVE_ARRAYS to SCM_HAVE_ARRAYS. Replace usage of
471 HAVE_LONG_LONGS with "SCM_SIZEOF_LONG_LONG != 0".
472
473 * gc-malloc.c: #include <config.h> if HAVE_CONFIG_H.
474
475 * gc-card.c: rename usage of HAVE_ARRAYS to SCM_HAVE_ARRAYS.
476 Replace usage of HAVE_LONG_LONGS with "SCM_SIZEOF_LONG_LONG != 0".
477
478 * fports.c: #include <config.h> if HAVE_CONFIG_H.
479
480 * filesys.c: #include <config.h> if HAVE_CONFIG_H.
481
482 * feature.c: #include <config.h> if HAVE_CONFIG_H. Rename usage
483 of USE_NULL_THREADS to SCM_USE_NULL_THREADS.
484
485 * extensions.c: #include <config.h> if HAVE_CONFIG_H.
486
487 * evalext.c: rename usage of HAVE_ARRAYS to SCM_HAVE_ARRAYS.
488 Replace usage of HAVE_LONG_LONGS with "SCM_SIZEOF_LONG_LONG != 0".
489
490 * eval.c: #include <config.h> if HAVE_CONFIG_H. #include
491 "libguile/__scm.h" rather than scmconfig.h. Rename usage of
492 HAVE_ARRAYS to SCM_HAVE_ARRAYS. Replace usage of HAVE_LONG_LONGS
493 with "SCM_SIZEOF_LONG_LONG != 0".
494
495 * error.c: #include <config.h> if HAVE_CONFIG_H.
496
497 * eq.c: #include <config.h> if HAVE_CONFIG_H. Rename usage of
498 HAVE_ARRAYS to SCM_HAVE_ARRAYS. Replace usage of HAVE_LONG_LONGS
499 with "SCM_SIZEOF_LONG_LONG != 0".
500
501 * deprecation.c: #include <config.h> if HAVE_CONFIG_H.
502
503 * coop.c: replace usage of struct timespect with scm_t_timespec.
504 #include <config.h> if HAVE_CONFIG_H.
505
506 * coop-threads.c: #include "libguile/_scm.h" early. Replace
507 usage of struct timespect with scm_t_timespec. Replace usage of
508 STACK_GROWS_UP with SCM_STACK_GROWS_UP.
509
510 * coop-pthreads.c: #include "libguile/_scm.h" early. Replace
511 usage of struct timespect with scm_t_timespec. Replace usage of
512 STACK_GROWS_UP with SCM_STACK_GROWS_UP.
513
514 * coop-defs.h: move handling of time related headers to
515 scmconfig.h. Add #include "libguile/__scm.h". Rename usage of
516 HAVE_WINSOCK2_H to SCM_HAVE_WINSOCK2_H. Replace usage of struct
517 timespect with scm_t_timespec.
518
519 * convert.i.c: rename usage of HAVE_ARRAYS to SCM_HAVE_ARRAYS.
520
521 * convert.h: rename usage of HAVE_ARRAYS to SCM_HAVE_ARRAYS.
522
523 * convert.c: #include <config.h> if HAVE_CONFIG_H. Rename usage
524 of HAVE_ARRAYS to SCM_HAVE_ARRAYS.
525
526 * continuations.c: move libguile/_scm.h include to the top so we
527 pick up any critical defines like _GNU_SOURCE early.
528
529 * backtrace.c: #include <config.h> if HAVE_CONFIG_H.
530
531 * async.c: #include <config.h> if HAVE_CONFIG_H.
532
533 * alloca.c: #include <config.h> if HAVE_CONFIG_H.
534
535 * _scm.h: #include <config.h> if HAVE_CONFIG_H.
536 Rename usage of USE_PTHREAD_THREADS to SCM_USE_PTHREAD_THREADS.
537
538 * __scm.h: move libguile/scmconfig.h include up to the top, so
539 we're sure to pick up any critical defines like _GNU_SOURCE early.
540 #include <limits.h> removed in favor of scmconfig.h inclusion when
541 appropriate. STDC_HEADERS based inclusion of stdlib.h,
542 sys/types.h, stddef.h, and sys/stdtypes.h removed in favor of
543 scmconfig.h inclusion when appropriate. Various Win32 related
544 definitions removed in favor of scmconfig.h inclusion when
545 appropriate.
546 (HAVE_UINTPTR_T): definition removed (see NEWS).
547 (SIZEOF_PTRDIFF_T): definition removed (see NEWS).
548 (HAVE_LONG_LONGS): definition removed (see NEWS).
549 (HAVE_LONG_LONG): definition removed (see NEWS).
550 (HAVE_PTRDIFF_T): definition removed (see NEWS).
551
552 * Makefile.am: scmconfig.h is now generated by building and
553 running gen-scmconfig.h and capturing its output. gen-scmconfig
554 uses config.h and the configure.in generated gen-scmconfig.h to
555 decide what to output. See gen-scmconfig.c for details.
556 (noinst_PROGRAMS): add gen-scmconfig.
557 (gen_scmconfig_SOURCES): new variable.
558 (gen-scmconfig.$(OBJEXT)): new target - be careful to handle
559 cross-compiling right.
560 (scmconfig.h): build scmconfig.h from gen-scmconfig's output.
561 (BUILT_SOURCES): add scmconfig.h.
562
25e0bf97
MV
5632003-03-19 Marius Vollmer <mvo@zagadka.de>
564
565 * gc_os_dep.c: Added defines for sparc-unknown-netbsdelf1.5 from
566 Adrian Bunk. Thanks!
567
74b6d6e4
MD
5682003-03-19 Mikael Djurfeldt <djurfeldt@nada.kth.se>
569
570 * goops.c (make_class_from_template): New fourth arg:
571 applicablep.
572 (scm_class_extended_generic_with_setter, scm_class_self): Fixed
573 cpls.
574
575 * smob.c (scm_set_smob_apply): Call scm_i_inherit_applicable.
576
577 * goops.c, objects.c, objects.h (scm_make_extended_class): New
578 second arg: applicablep.
579 (scm_i_inherit_applicable): New function.
580
581 * goops.c, goops.h (scm_class_applicable,
582 scm_class_extended_accessor): New classes.
583
5c9e7dad
DH
5842003-03-18 Dirk Herrmann <D.Herrmann@tu-bs.de>
585
586 * procs.c (scm_procedure_documentation): Removed redundant
587 SCM_NIMP test and replaced other calls to SCM_IMP by more explicit
588 predicates.
589
f8af5c6d
MD
5902003-03-11 Mikael Djurfeldt <djurfeldt@nada.kth.se>
591
c614a00b
MD
592 * list.c, list.h (scm_filter, scm_filter_x): New functions.
593
109c2c9f
MD
594 * modules.c (scm_module_import_interface): New function.
595
f8af5c6d
MD
596 * goops.c, goops.h (scm_class_accessor_method): Renamed from
597 scm_class_accessor.
598 (scm_class_accessor): New class.
599
a48d60b1
MD
6002003-03-06 Mikael Djurfeldt <djurfeldt@nada.kth.se>
601
602 * goops.c (scm_primitive_generic_generic): Enable primitive
603 generic if not enabled.
604 (scm_sys_goops_loaded): Setup unextended primitive generics.
605
606 * goops.c, goops.h (scm_c_extend_primitive_generic): New function.
607
608 * snarf.h (SCM_PRIMITIVE_GENERIC, SCM_PRIMITIVE_GENERIC_1): New
609 snarf macros.
610
611 * numbers.c (scm_abs): Use SCM_PRIMITIVE_GENERIC. (This is only a
612 testing example. All uses of SCM_GPROC should be converted.)
613
614 * procprop.c (scm_stand_in_scm_proc): Use scm_assq instead of
615 scm_assoc.
616
617 * eq.c (scm_equal_p): Turned into a primitive generic.
618
84edc049
RB
6192003-02-27 Rob Browning <rlb@defaultvalue.org>
620
621 * Makefile.am (scmconfig.h): new target -- generate file from
622 ../config.h.
623 (modinclude_HEADERS): remove version.h.
624 (nodist_modinclude_HEADERS): add version.h.
625
ea5c9285
MD
6262003-02-24 Mikael Djurfeldt <djurfeldt@nada.kth.se>
627
b4a1358c
MD
628 This fixes a serious GC bug, introduced during the latest
629 reorganization of the GC, which disabled freeing of structs and
630 GOOPS objects:
631
632 * struct.c (scm_struct_prehistory): Init scm_i_structs_to_free to
633 SCM_EOL.
53af8255
MD
634 (scm_struct_prehistory): Move scm_free_structs to
635 scm_before_mark_c_hook.
ea5c9285 636
b4a1358c
MD
637 * gc-card.c (sweep_card): Check that we haven't swept structs on
638 this card before. That can happen if scm_i_sweep_all_segments has
639 been called from some other place than scm_igc.
640
c35738c1
MD
6412003-02-19 Mikael Djurfeldt <djurfeldt@nada.kth.se>
642
231a4ea8
MD
643 * environments.c (DEFAULT_OBARRAY_SIZE): Changed from 137 to 31
644 (since hash tables now adapt their size).
645
646 * modules.c (scm_modules_prehistory): Changed from 2001 to 1533
647 (current number of prehistory bindings; hashtable code will select
648 a prime which is greater than this value).
649
650 * symbols.c (scm_symbols_prehistory): Changed from 1009 to 2139
651 (current number of initial symbols).
652
653 * properties.c (scm_init_properties): Don't specify size of
654 scm_properties_whash.
655
656 * objprop.c (scm_init_objprop): Don't specify size of
657 scm_object_whash.
658
659 * keywords.c (scm_init_keywords): Don't specify a hash table size.
660
c35738c1
MD
661 * hooks.c (scm_c_hook_add): Fixed bug in append mode.
662
663 The following changes introduce the use of resizable hash tables
664 throughout Guile. It also renames the old *-hash-table* functions
665 to *-alist-vector* and places them, together with the rest of the
666 weak vector support, in the module (ice-9 weak-vector). We should
667 probably introduce a new, better, API for weak references, for
668 example "weak pairs" a la MIT-Scheme. (In Chez scheme, they even
669 look like and are used like ordinary pairs.)
670
671 * environments.c (obarray_enter, obarray_retrieve, obarray_remove,
672 leaf_environment_fold, obarray_remove_all): Use hashtable
673 accessors.
674
675 * gc.c (scm_init_storage): Moved hook initialization to
676 scm_storage_prehistory.
677 (scm_storage_prehistory): New function.
678 (scm_igc): Added commentary about placement of
679 scm_after_sweep_c_hook.
680
681 * gc-mark.c (scm_mark_all): Use hashtable accessors.
682 (scm_gc_mark_dependencies): Use SCM_WVECT_WEAK_KEY_P and
683 SCM_WVECT_WEAK_VALUE_P.
684
685 * hashtab.c, hashtab.h (scm_hash_for_each, scm_hash_map): New
686 functions.
687 (scm_vector_to_hash_table, scm_c_make_resizing_hash_table):
688 Removed.
689 (scm_make_weak_key_hash_table, scm_make_weak_value_hash_table,
690 scm_make_doubly_weak_hash_table): Moved here from weaks.c.
691
692 * init.c (scm_init_guile_1): Removed call to scm_init_weaks; Added
693 calls to scm_storage_prehistory and scm_hashtab_prehistory.
694
695 * modules.c (module-reverse-lookup): Use hashtable accessors.
696
697 * symbols.c, symbols.h (scm_i_hash_symbol): New function.
698
699 * weaks.c, weaks.h (scm_make_weak_key_alist_vector,
700 scm_make_weak_value_alist_vector,
701 scm_make_doubly_weak_alist_vector): New functions.
702
703 * weaks.c (scm_init_weaks_builtins): New function.
704
705 * weaks.h (SCM_WVECTF_WEAK_KEY, SCM_WVECTF_WEAK_VALUE,
706 SCM_WVECTF_NOSCAN, SCM_WVECT_WEAK_KEY_P, SCM_WVECT_WEAK_VALUE_P,
707 SCM_WVECT_NOSCAN_P): New macros.
708
709 * weaks.c (scm_scan_weak_vectors): Use SCM_WVECT_WEAK_KEY_P
710 and SCM_WVECT_WEAK_VALUE_P.
711
712 * weaks.c, weaks.h (scm_i_allocate_weak_vector): Renamed from
713 allocate_weak_vector and exported.
714
0a4c1355
MD
7152003-02-13 Mikael Djurfeldt <djurfeldt@nada.kth.se>
716
717 * hashtab.c: Undid thread safety. (We decided that it's better to
718 let the user explicitly protect the tables (or not) according what
719 is suitable for the application.)
720
87ca11ff
MD
7212003-02-12 Mikael Djurfeldt <djurfeldt@nada.kth.se>
722
723 * hashtab.c (scm_hash_fn_remove_x, scm_internal_hash_fold): Made
724 thread safe and handle resizing tables.
725 (scm_ihashx, scm_sloppy_assx, scm_delx_x): Removed
726 SCM_DEFER/ALLOW_INTS.
727
f59a096e
MD
7282003-02-11 Mikael Djurfeldt <djurfeldt@nada.kth.se>
729
730 * hashtab.c (scm_vector_to_hash_table,
731 scm_c_make_resizing_hash_table, scm_make_hash_table): New
732 functions.
733 (scm_hash_fn_get_handle, scm_hash_fn_create_handle_x): Made thread
734 safe and handle resizing tables.
735
736 * weaks.c (scm_make_weak_key_hash_table,
737 scm_make_weak_value_hash_table, scm_make_doubly_weak_hash_table):
738 Size argument made optional. Return resizable table if not
739 specified.
740
4b612c5b
MD
7412003-02-10 Mikael Djurfeldt <djurfeldt@nada.kth.se>
742
743 * eval.c (scm_trampoline_0, scm_trampoline_1, scm_trampoline_2):
744 Fixed formals tests for closures. (Thanks to Kevin Ryde.)
745
b3d7f6df
MD
7462003-02-05 Mikael Djurfeldt <djurfeldt@nada.kth.se>
747
748 * debug.c (scm_procedure_source): Handle all objects for which
749 procedure? is #t. (Thanks to Bill Schottstaedt.)
750
756414cf
MD
7512003-01-23 Mikael Djurfeldt <djurfeldt@nada.kth.se>
752
361d631f
MD
753 * futures.c (mark_futures): Don't need to mark data of recycled
754 futures.
755 (scan_futures, cleanup_undead): Be smarter about marking
756 futures---avoid unnecessary passes through future lists.
757
756414cf
MD
758 * futures.h, futures.c: New files; Introduced recycling of
759 futures. For fine-grained threading this lifts performance to
760 another level. We can now use parallelization in inner loops of
761 Guile programs without impossible overhead.
762
763 * threads.h, threads.c: Moved futures to their own file.
764
765 * Makefile.am (libguile_la_SOURCES): Added futures.c.
766 (DOT_X_FILES): Added futures.x.
767 (DOT_DOC_FILES): Added futures.doc.
768 (modinclude_HEADERS): Added futures.h.
769
770 * threads.c, threads.h (scm_i_create_thread): Renamed from
771 create_thread and made global.
772
773 * futures.c (scm_make_future): New procedure.
774
775 * eval.c: #include "libguile/futures.h".
776
777 * init.c: #include "futures.h"
778 (scm_init_guile_1): Call scm_init_futures.
779
780 * stime.c (SCM_TIME_UNITS_PER_SECOND): Renamed from CLKTCK.
781
782 * stime.h (SCM_TIME_UNITS_PER_SECOND): Definition moved here.
783
784 * eval.c, eval.h (scm_trampoline_0, scm_i_call_closure_0): New
785 functions.
786
787 * eval.c (scm_trampoline_1): Fixed arguments test for closures.
788
b4debead
MD
7892003-01-22 Mikael Djurfeldt <djurfeldt@nada.kth.se>
790
791 * threads.c (create_thread): Don't unwind dynwind chain of parent
792 thread before creation. Just start the new thread with an empty
793 dynwind chain.
794
93f26b7b
MD
7952003-01-20 Mikael Djurfeldt <djurfeldt@nada.kth.se>
796
797 * evalext.c, evalext.h (scm_self_evaluating_p): New function.
798
38d8927c
MD
7992003-01-10 Mikael Djurfeldt <djurfeldt@nada.kth.se>
800
41c96c32
MD
801 * threads.c (scm_timed_wait_condition_variable): Support timed
802 waiting also for simple condition variables.
803
38d8927c
MD
804 * goops.c (TEST_CHANGE_CLASS): Use scm_change_object_class instead
805 of calling the procedure change-object-class.
806
9cf5d9b7
MD
8072003-01-09 Mikael Djurfeldt <djurfeldt@nada.kth.se>
808
809 * ramap.c (scm_ramapc): Typo in error message.
810
bbf8d523
MD
8112003-01-08 Mikael Djurfeldt <djurfeldt@nada.kth.se>
812
b46fae00
MD
813 * goops.c (scm_sys_prep_layout_x): Bugfix: Only create layout for
814 slots with instance allocation.
815
bbf8d523
MD
816 * goops.c, goops.h (scm_class_extended_generic_with_setter): New
817 class.
818 (scm_compute_applicable_methods): Use scm_generic_function_methods.
819
820 * goops.c (scm_generic_function_methods): Support extended
821 generic functions.
822
ebf9b47c
MD
8232002-12-29 Mikael Djurfeldt <djurfeldt@nada.kth.se>
824
825 * eval.c (unmemocopy): Bugfix: scm_sym_delay --> scm_sym_future.
2e37d6a2 826 Thanks to Neil for pointing this out!
ebf9b47c 827
14a9ba3f
NJ
8282002-12-29 Neil Jerram <neil@ossau.uklinux.net>
829
830 * lang.h: Remove declarations matching definitions removed from
831 lang.c (just below).
832
c6a040a8
NJ
8332002-12-28 Neil Jerram <neil@ossau.uklinux.net>
834
6054d805
NJ
835 * lang.c (scm_nil_cons, scm_nil_car, scm_nil_cdr, scm_null,
836 scm_m_while, scm_nil_eq): Remove definitions that were superfluous
837 and already commented out.
838
c6a040a8
NJ
839 * read.h (scm_lreadparen), read.c (scm_lreadr, scm_read_token,
840 scm_lreadparen): Support reading vectors with Elisp syntax if
841 SCM_ELISP_READ_EXTENSIONS is defined. (SCM_ELISP_READ_EXTENSIONS
842 is not currently defined, and there isn't even a configure switch
843 to enable it yet.)
844
3742c12f
MV
8452002-12-26 Marius Vollmer <mvo@zagadka.ping.de>
846
847 * Makefile.am (c-tokenize.o): Refer to source via $< so that vpath
848 builds work.
849 (EXTRA_DIST): Added version.h.in.
850
fb50ef08
MD
8512002-12-21 Mikael Djurfeldt <djurfeldt@nada.kth.se>
852
853 This change makes it possible for one thread to do lazy sweeping
854 while other threads are running. Now only the mark phase need to
855 have all threads asleep. We should look further into this issue.
856 Presently, I've put the locking of scm_i_sweep_mutex at
857 "conservative" places due to my current lack of knowledge about
858 the garbage collector. Please feel free to restrict these regions
859 further to allow for maximal parallelism!
860
861 * gc.c, gc.h (scm_i_sweep_mutex): New mutex.
862
863 * gc.c (scm_gc_for_newcell), gc-malloc.c (scm_realloc,
864 scm_gc_register_collectable_memory): Substitute locking of
865 scm_i_sweep_mutex for calls to scm_i_thread_put_to_sleep.
866 (scm_igc): Lock sweep mutex here instead of in callers; Calls to
867 scm_i_thread_put_to_sleep/scm_i_thread_wake_up used to demarkate
868 the single-thread section (which now only contains the mark
869 phase).
870 (scm_gc): Don't lock sweeo mutex here since scm_igc locks it;
871 Removed SCM_DEFER/ALLOW_INTS. Simply call scm_igc directly.
872
873 * threads.c (gc_section_mutex): Removed.
874
9ed24633
MD
8752002-12-19 Mikael Djurfeldt <mdj@kvast.blakulla.net>
876
0d48aca5
MD
877 * threads.c (create_thread): Clear parent field in root state in
878 order not to unnecessarily remember dead threads.
879
9ed24633
MD
880 * eval.c (call_subr2o_1, call_lsubr2_2): New functions.
881 (scm_trampoline_1, scm_trampoline_2): Use them.
882
29717c89
MD
8832002-12-18 Mikael Djurfeldt <mdj@kvast.blakulla.net>
884
885 Partial introduction of real plugin interface.
886
887 * Makefile.am (modinclude_HEADERS): Added threads-plugin.h.
888 (EXTRA_DIST): Added threads-plugin.c.
889
890 * threads-plugin.h, threads-plugin.c: New files.
891
892 * threads.h: #include "libguile/threads-plugin.h".
893
894 * threads.c: #include "libguile/threads-plugin.c".
895
896 * pthread-threads.c: Temporarily remove debugging functions.
897
898 * threads.c, threads.h (scm_yield): Added back.
899
e29e0b09
MD
9002002-12-18 Mikael Djurfeldt <mdj@kvast.blakulla.net>
901
902 * threads.c (really_launch): Detach before unlocking
903 thread_admin_mutex in order not to risk being joined.
904 (scm_i_thread_put_to_sleep, scm_i_thread_wake_up): Keep
905 thread_admin_mutex locked during GC.
906
907 * pthread-threads.c, pthread-threads.h: Improvements to debugging
908 functions.
909
0b6843b1 9102002-12-16 Mikael Djurfeldt <mdj@kvast.blakulla.net>
93cd4dcd 911
6da2dfc4
MD
912 * pthread-threads.c, pthread-threads.h (SCM_DEBUG_THREADS): Added
913 support for debugging mutex operations.
914
1b92fb6b
MD
915 * threads.c (scm_thread): Removed filed joining_threads.
916 (thread_print): Print thread number as well as address of thread
917 structure.
0b6843b1
MD
918 (scm_join_thread): Bugfix.
919 (scm_lock_mutex, scm_try_mutex, scm_unlock_mutex,
920 scm_timed_wait_condition_variable, scm_signal_condition_variable,
921 scm_broadcast_condition_variable): Use the low-level API.
922 (scm_all_threads): Return copy of thread list (to prevent
923 unintended destruction).
924 (scm_threads_prehistory): Initialize heap_mutex of fake thread.
1b92fb6b 925
93cd4dcd
MD
926 * pthread-threads.c, pthread-threads.h, threads.c: Fixes to
927 pthread "native" recursive mutex support.
928
2ff4f181
MD
9292002-12-15 Mikael Djurfeldt <djurfeldt@nada.kth.se>
930
28d52ebb
MD
931 * __scm.h (SCM_DEFER_INTS, SCM_ALLOW_INTS): New definitions.
932 Simply lock a thread C API recursive mutex.
933 (SCM_NONREC_CRITICAL_SECTION_START,
934 SCM_NONREC_CRITICAL_SECTION_END, SCM_REC_CRITICAL_SECTION_START,
935 SCM_REC_CRITICAL_SECTION_END): Removed.
936
937 * eval.c: Replaced SOURCE_SECTION_START / SOURCE_SECTION_END with
938 direct calls to scm_rec_mutex_lock / unlock around the three calls
939 to scm_m_expand_body.
940
941 * eval.c, eval.h (promise_free): New function.
942 (scm_force): Rewritten; Now thread-safe; Removed
943 SCM_DEFER/ALLOW_INTS.
944
945 * pthread-threads.h: Added partially implemented plugin interface
946 for recursive mutexes. These are, for now, only intended to be
947 used internally within the Guile implementation.
948
949 * pthread-threads.c: New file.
950
951 * threads.c: Conditionally #include "pthread-threads.c".
952
953 * eval.c, eval.h (scm_makprom, scm_force): Rewritten to be
954 thread-safe;
955
956 * snarf.h (SCM_MUTEX, SCM_GLOBAL_MUTEX, SCM_REC_MUTEX,
957 SCM_GLOBAL_REC_MUTEX): New macros.
958
959 * eval.c, threads.c, threads.h, snarf.h: Rewrote critical section
960 macros---use mutexes instead.
961
962 * tags.h (SCM_IM_FUTURE): New tag.
963
964 * eval.c (scm_m_future): New primitive macro.
965 (SCM_CEVAL): Support futures.
966 (unmemocopy): Support unmemoization of futures.
967
968 * print.c (scm_isymnames): Name of future isym.
969
2ff4f181
MD
970 * version.c: Unmade some changes to my private copy that got
971 committed by mistake.
972
392d2833
MD
9732002-12-11 Mikael Djurfeldt <mdj@kvast.blakulla.net>
974
e200ddee
MD
975 * gc-malloc.c, gc.h, init.c: Reverted gc-malloc change of
976 2002-12-10.
977
392d2833
MD
978 * gc.c (scm_igc): Don't call scm_i_thread_invalidate_freelists.
979
980 * gc.c (scm_gc_sweep): Call it here instead, which is a more
981 logical place.
982
983 * threads.c (create_thread): Remember root object until the handle
984 of the new thread is on all_threads list.
985
986 * root.c (scm_make_root): Moved copying of fluids until after
987 creation of root handle so that the fluids are GC protected. Also
988 removed the critical section.
989
c4c52ebe
MD
9902002-12-10 Mikael Djurfeldt <mdj@kvast.blakulla.net>
991
960c408c
MD
992 * gc-malloc.c, gc.h (scm_gc_malloc_prehistory): New function.
993
3cdde9d6 994 * gc-malloc.c (malloc_mutex): New mutex.
960c408c 995 (scm_gc_malloc_prehistory): Initialize it.
3cdde9d6
MD
996 (scm_realloc): Serialize call to realloc
997 (scm_calloc): Same for calloc.
998 Thanks to Wolfgang Jaehrling!
999 (Now we have to make sure all calls to malloc/realloc are made
1000 through scm_malloc.)
1001
960c408c
MD
1002 * init.c (scm_init_guile_1): Call scm_gc_malloc_prehistory.
1003
c4c52ebe
MD
1004 * threads.c (really_launch): Release heap (to prevent deadlock).
1005 (create_thread): Release heap before locking thread admin mutex.
1006
b0dc3d71
MD
10072002-12-10 Mikael Djurfeldt <mdj@kvast.blakulla.net>
1008
1009 * threads.c (scm_i_thread_invalidate_freelists): New
1010 function.
1011
1012 * gc.c (scm_igc): Call scm_i_thread_invalidate_freelists.
1013
1014 * modules.c (scm_export): Inserted a return statement.
1015
06e80f59
HWN
10162002-12-10 Han-Wen Nienhuys <hanwen@cs.uu.nl>
1017
1018 * modules.c (scm_export): new function
1019
1020 * gc-card.c: add a note about malloc()/free() overhead.
1021
a12611c3
MD
10222002-12-10 Mikael Djurfeldt <mdj@kvast.blakulla.net>
1023
1024 * Makefile.am (c-tokenize.$(OBJEXT)): Don't look for c-tokenize.c
1025 in srcdir.
1026
c7fabadf
MD
10272002-12-10 Mikael Djurfeldt <djurfeldt@nada.kth.se>
1028
1029 These changes remove scm_ints_disabled (which hasn't has any
1030 effect in Guile for quite some time).
1031
1032 * async.c, error.h (scm_ints_disabled): Removed.
1033
1034 * gc.c (scm_gc_for_newcell), init.c (scm_init_guile_1),
1035 root.c (scm_internal_cwdr), gdbint.c (SCM_BEGIN_FOREIGN_BLOCK,
1036 SCM_END_FOREIGN_BLOCK): Don't touch scm_ints_disabled.
1037 (old_ints): Removed.
1038
1039 * __scm.h (SCM_DEFER_INTS, SCM_ALLOW_INTS): Define as a recursive
1040 critical section.
1041 (SCM_REDEFER_INTS, SCM_ALLOW_INTS): Define as SCM_DEFER_INTS and
1042 SCM_ALLOW_INTS.
1043
9bc4701c
MD
10442002-12-09 Mikael Djurfeldt <djurfeldt@nada.kth.se>
1045
52340b65
MD
1046 * threads.c (scm_mutex_lock, scm_cond_wait, scm_cond_timedwait):
1047 Removed accidental #if 0 around these functions.
1048
9bc4701c
MD
1049 These changes are the start of support for preemptive
1050 multithreading. Marius and I have agreed that I commit this code
1051 into the repository although it isn't thoroughly tested and surely
1052 introduces many bugs. The bugs should only be exposed when using
1053 threads, though. Signalling and error handling for threads is
1054 very likely broken. Work on making the implementation cleaner and
1055 more efficient is needed.
1056
1057 * __scm.h (SCM_ALLOW_INTS_ONLY): Removed.
1058 (SCM_NONREC_CRITICAL_SECTION_START,
1059 SCM_NONREC_CRITICAL_SECTION_END, SCM_REC_CRITICAL_SECTION_START,
1060 SCM_REC_CRITICAL_SECTION_END): New macros.
1061 (SCM_CRITICAL_SECTION_START/END): Defined here.
1062
1063 * eval.c: Insert SOURCE_SECTION_START / SOURCE_SECTION_END around
1064 the three calls to scm_m_expand_body.
1065
1066 * gc.h: #include "libguile/pthread-threads.h";
1067 (SCM_FREELIST_CREATE, SCM_FREELIST_LOC): New macros.
1068
1069 * gc.c (scm_i_freelist, scm_i_freelist2): Defined to be of type
1070 scm_t_key;
1071
1072 * gc.c, gc-freelist.c, inline.h: Use SCM_FREELIST_LOC for freelist
1073 access.
1074
1075 * gc-freelist.c (scm_gc_init_freelist): Create freelist keys.
1076
1077 * gc-freelist.c, threads.c (really_launch): Use
1078 SCM_FREELIST_CREATE.
1079
1080 * gc-malloc.c (scm_realloc, scm_gc_register_collectable_memory):
1081
1082 * gc.c (scm_i_expensive_validation_check, scm_gc,
1083 scm_gc_for_newcell): Put threads to sleep before doing GC-related
1084 heap administration so that those pieces of code are executed
1085 single-threaded. We might consider rewriting these code sections
1086 in terms of a "call_gc_code_singly_threaded" construct instead of
1087 calling the pair of scm_i_thread_put_to_sleep () and
1088 scm_i_thread_wake_up (). Also, we would want to have as many of
1089 these sections eleminated.
1090
1091 * init.c (scm_init_guile_1): Call scm_threads_prehistory.
1092
1093 * inline.h: #include "libguile/threads.h"
1094
1095 * pthread-threads.h: Macros now conform more closely to the
1096 pthreads interface. Some of them now take a second argument.
1097
1098 * threads.c, threads.h: Many changes.
1099
11002002-12-09 Mikael Djurfeldt <djurfeldt@nada.kth.se>
1101
1102 * Makefile.am (version.h): Changed $^ --> $< in rule for
1103 version.h.
1104
b2cbe8d8
RB
11052002-12-08 Rob Browning <rlb@defaultvalue.org>
1106
1107 * version.h.in (SCM_MICRO_VERSION): use @--@ substitution now.
1108 (SCM_MINOR_VERSION): use @--@ substitution now.
1109 (SCM_MICRO_VERSION): use @--@ substitution now.
1110 (scm_effective_version): new function prototype.
1111
1112 * version.c (scm_effective_version): new function, also add
1113 effective-version.
1114
1115 * Makefile.am (schemelibdir): VERSION -> GUILE_EFFECTIVE_VERSION.
1116 (libpath.h): use GUILE_EFFECTIVE_VERSION to compute
1117 SCM_LIBRARY_DIR.
1118 (version.h): generate this here rather than configure.in. This
1119 approach tracks source edits better (i.e. more immediately).
1120 Might be worth considering for other .in files too.
1121
5441c65c
MV
11222002-12-02 Marius Vollmer <mvo@zagadka.ping.de>
1123
1124 Reorganized thread package selection. A thread package now only
1125 implements a small set of pthread like functions and Guile
1126 implements the rest on top of that. Guile's implementation is
1127 what the "coop-pthreads" package has been previously. Support for
1128 "coop" threads has been removed until I get time to add it again.
1129
1130 * Makefile.am (libguile_la_SOURCES): Removed iselect.c.
1131 (noinst_HEADERS): Removed coop-threads.c, coop-threads.h, coop.c,
1132 null-threads.c, coop-pthreads.c.
1133 (modinclude_HEADERS): Removed coop-defs.h, coop-pthreads.h. Added
1134 pthread-threads.h.
1135
1136 * validate.h (SCM_VALIDATE_THREAD): Moved to threads.h.
1137
1138 * threads.h: Do not include "libguile/coop-defs.h". Include
1139 "libguile/pthread-threads.h" for USE_COPT_THREADS. Removed
1140 (previously deprecated) C level thread API prototypes. They are
1141 now in the thread package specific headers, "null-threads.h" and
1142 "pthread-threads.h".
1143 (SCM_VALIDATE_THREAD, SCM_VALIDATE_MUTEX, SCM_VALIDATE_CONDVAR):
1144 New.
1145 (scm_threads_init): Removed.
1146 (SCM_CRITICAL_SECTION_START, SCM_CRITICAL_SECTION_END,
1147 SCM_THREAD_SWITCHING_CODE, scm_i_switch_counter,
1148 SCM_I_THREAD_SWITCH_COUNT): Define here.
1149 (scm_single_thread_p): Removed.
1150 (scm_call_with_new_thread): Take two args directly instead of list
1151 of two args.
1152 (scm_i_thread_data, scm_i_set_thread_data, SCM_THREAD_LOCAL_DATA,
1153 SCM_SET_THREAD_LOCAL_DATA): Define here.
1154
1155 * threads.c: Merged with "coop-pthreads.c".
1156
1157 * null-threads.h: Implement pthread-like API as a set of macros.
1158
1159 * pthread-threads.h: New, implement pthread-like API by deferring
1160 to pthread itself.
1161
1162 * init.c (scm_init_guile_1): Do not call scm_init_iselect, which
1163 has been lost in the reorganization.
1164
504d99c5
MD
11652002-12-01 Mikael Djurfeldt <mdj@linnaeus>
1166
1167 The following change makes it possible to move procedure
1168 application dispatch outside inner loops. The motivation was
1169 clean implementation of efficient replacements of R5RS primitives
1170 in SRFI-1.
1171
1172 The semantics is clear: scm_trampoline_N returns an optimized
1173 version of scm_call_N (or NULL if the procedure isn't applicable
1174 on N args).
1175
1176 Applying the optimization to map and for-each increases efficiency
1177 noticeably. For example, (map abs ls) is 8 times faster than
1178 before.
1179
1180 * eval.h (scm_t_trampoline_1, scm_t_trampoline_2): New types.
1181
1182 * eval.c, eval.h (scm_trampoline_1, scm_trampoline_2): New functions.
1183
1184 * eval.c (call_subr2_2, call_lsubr_2, call_closure_2): New functions;
1185 (map, for-each): Handle also application on two args as a special
1186 case; Use trampolines.
1187
1188 Other changes:
1189
1190 * sort.c (scm_cmp_function): Choose subr2less for scm_tc7_subr_2o;
1191 (subr2oless): Removed.
1192 (scm_restricted_vector_sort_x): Use scm_return_first to keep the
1193 vector GC protected.
1194
1195 * eval.c (check_map_args): Use scm_out_of_range_pos instead of
1196 scm_out_of_range.
1197
63dd3413
DH
11982002-11-24 Dirk Herrmann <D.Herrmann@tu-bs.de>
1199
1200 * evalext.[ch] (scm_m_undefine, undefine): Deprecated.
1201
4ba5f279
MD
12022002-11-17 Mikael Djurfeldt <mdj@linnaeus>
1203
1204 * debug.c (scm_make_iloc): Added missing "return".
1205
56ae231f
MV
12062002-11-17 Marius Vollmer <mvo@zagadka.ping.de>
1207
1208 * strports.c (scm_eval_string_in_module): Validate second arg to
1209 be a module. Thanks to Arno Peters!
1210
80b28865
DH
12112002-11-16 Dirk Herrmann <D.Herrmann@tu-bs.de>
1212
1213 * .cvsignore: remove goops.c
1214
c88b1456
DH
12152002-11-16 Dirk Herrmann <D.Herrmann@tu-bs.de>
1216
1217 * modules.c (scm_env_top_level, scm_lookup_closure_module,
1218 module_variable, scm_module_lookup_closure,
1219 scm_module_transformer, scm_sym2var, scm_module_reverse_lookup,
1220 scm_system_module_env_p): Don't compare SCM values with C
1221 operators == or !=. Avoid SCM_IMP predicates. Prefer !SCM_FALSEP
1222 over SCM_NFALSEP.
1223
a8a19efc
DH
12242002-11-16 Dirk Herrmann <D.Herrmann@tu-bs.de>
1225
1226 * eval.h (SCM_MAKE_ILOC): New macro.
1227
1228 * debug.c (scm_make_iloc): Use SCM_MAKE_ILOC instead of computing
1229 the iloc bitpattern here.
1230
76734914
MD
12312002-11-14 Mikael Djurfeldt <mdj@linnaeus>
1232
1233 * coop-pthreads.c, coop-pthreads.h: scm_internal_select should be
1234 part of the API, otherwise it's difficult to write Guile
1235 extensions using non-blocking I/O => moved #include
1236 "libguile/iselect.h" from coop-pthreads.c --> coop-pthreads.h.
1237
1238 * coop-pthreads.c (scm_unlock_mutex): Changed s_lock_mutex -->
1239 s_unlock_mutex.
1240
8b5b4a75
MV
12412002-11-10 Marius Vollmer <mvo@zagadka.ping.de>
1242
1243 * __scm.h (USE_THREADS, GUILE_ISELECT): Do not define here. They
1244 are defined in configure.in.
1245
1246 * threads.c: Removed SCM_API from function definitions. SCM_API
1247 is only for declarations.
1248
e5a83084
MD
12492002-11-07 Mikael Djurfeldt <mdj@linnaeus>
1250
9be8bb45
MD
1251 * coop-pthreads.h: Added support for thread specific data to the
1252 generic C API for the coop-pthreads case.
1253
e5a83084
MD
1254 * threads.c, threads.h (scm_cond_init): Undo unintentional API
1255 change.
6c214b62 1256 (scm_cond_broadcast): Added missing function.
e5a83084 1257
7edf178e
MV
12582002-11-04 Marius Vollmer <marius.vollmer@uni-dortmund.de>
1259
1260 * coop.c (coop_next_runnable_thread): Removed, wich should have
1261 happened when GUILE_ISELECT was hard-wired.
1262
7f5b1b77
MV
12632002-11-03 Marius Vollmer <mvo@zagadka.ping.de>
1264
7caa1b07
MV
1265 * Makefile.am (libguile_la_SOURCES): Added threads.c
1266 (DOT_DOC_FILES): Added threads.doc.
1267 (DOT_X_FILES): Added threads.x.
1268 (EXTRA_libguile_la_SOURCES): Removed threads.c.
1269 (noinst_HEADERS): Added coop-pthreads.c.
1270 (modinclude_HEADERS): Added coop-pthreads.h.
1271
1272 * __scm.h (USE_THREADS, GUILE_ISELECT): Define when
1273 SCM_DEBUG_DEPRECATED. Removed their use thru-out Guile.
1274
bb11cbf4
MV
1275 * iselect.c: Include "_scm.h" before testing HAVE_UNISTD_H.
1276 Thanks to Bill Schottstaedt!
1277
1d4cbbed
MV
1278 * numbers.c (scm_integer_expt): Make 0^z == 0 for z != 0.
1279
7f5b1b77
MV
1280 * _scm.h (HAVE_RESTARTABLE_SYSCALLS): Do define even when
1281 SCM_COPT_THREADS is defined.
1282 (SCM_SYSCALL): Use EINTR-expection version when SCM_COPT_THREADS
1283 is defined.
1284
1285 * coop-pthreads.c: Some harmless renamings of internal stuff.
1286 (create_thread): New, generalized version of
1287 scm_call_with_new_thread.
1288 (scm_call_with_new_thread): Use it.
1289 (scm_spawn_thread): New, use create_thread.
1290
d52f53b1
MV
12912002-11-02 Marius Vollmer <mvo@zagadka.ping.de>
1292
1293 * coop-pthreads.c, coop-pthreads.h: Redone completely, you might
1294 start testing it now.
1295
1296 * _scm.h: Include <errno.h< so that SCM_SYSCALL is correctly
1297 defined when HAVE_RESTARTABLE_SYSCALLS is not defined.
1298 (HAVE_RESTARTABLE_SYSCALLS): Do not define when USE_COPT_THREADS
1299 is defined.
1300
30f920c3
MV
13012002-10-27 Marius Vollmer <mvo@zagadka.ping.de>
1302
1303 * scmsigs.c (signal_cell_handlers, install_handler_data,
1304 scm_delq_spine_x, really_install_handler, install_handler): New
1305 scheme for triggering signal handlers, to simplify take_signal.
1306 (take_signal): Simplified, to avoid race conditions.
1307 (scm_sigaction_for_thread): Use new Scheme. Validate that thread
1308 hasn't exited yet.
1309
1310 * async.c (scm_async_click): Reset pending_asyncs, handle
1311 signal_asyncs. Don't set cdr of a non-signal async to #f.
1312 (scm_i_queue_async_cell): Do not check cdr of cell for #f, queue
1313 always. Set pending_asyncs.
1314 (scm_system_async_mark_for_thread): Check that thread has not
1315 exited.
1316 (scm_unmask_signals, decrease_block): Call scm_async_click after
1317 block_asyncs becomes zero.
1318
1319 * __scm.h (SCM_ASYNC_CLICK): Check pending_asyncs instead of
1320 active_asyncs.
1321
1322 * root.h (scm_root_state): Added pending_asyncs and signal_asyncs
1323 fields.
1324 * root.c (root_mark): Mark them.
1325 (make_root): Initialize them.
1326
1327 * iselect.c, iselect.h: Replaced GUILE_ISELECT with
1328 USE_COOP_THREADS.
1329 (scm_internal_select): Define one version for USE_COOP_THREADS and
1330 one for USE_NULL_THREADS.
1331 (scm_init_iselect): Likewise.
1332
1333 * inline.h (scm_cell, scm_double_cell): Also allow
1334 USE_COPT_THREADS to not protect the slot initializers.
1335
1336 * init.c (scm_init_guile_1): Call scm_init_thread_procs. This is
1337 because threads need to be initialized before the stack, but
1338 gsubrs such as scm_timed_condition_variable_wait can only be
1339 created later.
1340
1341 * threads.h: Include "coop-pthreads.h" when requested.
1342 (scm_threads_make_mutex, scm_threads_lock_mutex,
1343 scm_threads_unlock_mutex, scm_threads_monitor): Removed, they were
1344 not implemented anyway.
1345 (scm_init_thread_procs, scm_try_mutex,
1346 scm_timed_condition_variable_wait,
1347 scm_broadcast_condition_variable, scm_c_thread_exited_p,
1348 scm_thread_exited_p): New prototypes.
1349 (struct timespec): Define if not already defined.
1350 (scm_t_mutex, scm_mutex_init, scm_mutex_lock, scm_mutex_trylock,
1351 scm_mutex_unlock, scm_mutex_destroy, scm_t_cond, scm_cond_init,
1352 scm_cond_wait, scm_cond_timedwait, scm_cond_signal,
1353 scm_cond_broadcast, scm_cond_destroy): Declarations moved here and
1354 deprecated.
1355
1356 * threads.c: Include <errno.h>. Include "coop-pthreads.c" when
1357 requested.
1358 (scm_thread_exited_p): New.
1359 (scm_try_mutex, scm_broadcast_condition_variable): Newly
1360 registered procedures.
1361 (scm_wait_condition_variable, scm_timed_wait_condition_variable):
1362 Use the latter as the procedure for "wait-condition-variable",
1363 thus offering a optional timeout parameter to Scheme.
1364 (scm_wait_condition_variable): Implement in terms of
1365 scm_timed_wait_condition_variable.
1366 (scm_mutex_init, scm_mutex_lock, scm_mutex_trylock,
1367 scm_mutex_unlock, scm_mutex_destroy, scm_cond_init,
1368 scm_cond_wait, scm_cond_timedwait, scm_cond_signal,
1369 scm_cond_broadcast, scm_cond_destroy): Implement in terms of
1370 scm_make_mutex, etc, and deprecate.
1371 (scm_init_threads): Do not create smobs, leave this to
1372 scm_threads_init. Do not include "threads.x" file.
1373 (scm_init_thread_procs): New, include "threads.x" here.
1374
1375 * null-threads.h (scm_null_mutex, scm_null_mutex_init,
1376 scm_null_mutex_lock, scm_null_mutex_unlock,
1377 scm_null_mutex_destroy, scm_null_condvar, scm_null_condvar_init,
1378 scm_null_condvar_wait, scm_null_condvar_signal,
1379 scm_null_condvar_destroy): Removed.
1380 (scm_mutex_init, scm_mutex_lock, scm_mutex_unlock, scm_cond_init,
1381 scm_cond_wait, scm_cond_signal, scm_cond_broadcast,
1382 scm_cond_destory): Do not define, they are now deprecated and
1383 handled by threads.{h,c}.
1384
1385 * null-threads.c (scm_null_mutex, scm_null_cond): Define here.
1386 (scm_threads_init): Create smobs here, using the appropriate
1387 sizes.
1388 (block): Removed, now unused.
1389 (scm_c_thread_exited_p): New.
1390 (scm_null_mutex_init, scm_null_mutex_lock, scm_null_mutex_unlock,
1391 scm_null_mutex_destroy, scm_null_condvar_init,
1392 scm_null_condvar_wait, scm_null_condvar_signal,
1393 scm_null_condvar_destroy): Removed and updated users to do their
1394 task directly.
1395 (scm_try_mutex, timeval_subtract,
1396 scm_timed_wait_condition_variable,
1397 scm_broadcast_condition_variable): New.
1398 (scm_wait_condition_variable): Removed.
1399
1400 * coop-defs.h (coop_m): Added 'level' field.
1401 (scm_t_mutex, scm_mutex_init, scm_mutex_lock, scm_mutex_trylock,
1402 scm_mutex_unlock, scm_mutex_destroy, scm_t_cond, scm_cond_init,
1403 scm_cond_wait, scm_cond_timedwait, scm_cond_signal,
1404 scm_cond_broadcast, scm_cond_destroy, struct timespec): Do not
1405 define.
1406 (coop_condition_variable_broadcast): New.
1407
1408 * coop-threads.c (scm_threads_init): Create smobs here, using the
1409 appropriate sizes.
1410 (scm_c_thread_exited_p, scm_try_mutex,
1411 scm_timed_wait_condition_variable,
1412 scm_broadcast_condition_variable): New.
1413 (scm_wait_condition_variable): Removed.
1414
1415 * coop.c (coop_new_mutex_init): Initialize level.
1416 (coop_mutex_trylock, coop_mutex_lock, coop_mutex_unlock): maintain
1417 level.
1418 (coop_condition_variable_signal): Renamed to
1419 coop_condition_variable_broadcast and reimplemented in terms of
1420 that. Thus...
1421 (coop_condition_variable_broadcast): New.
1422
1423 * goops.c (hell_mutex): Reimplemented using scm_make_mutex, etc.
1424
1425 * coop-pthreads.h, coop-pthreads.c: New, but unfinished.
1426
087ed40d
MV
14272002-10-21 Marius Vollmer <mvo@zagadka.ping.de>
1428
65a23095
MV
1429 * null-threads.c: Include <time.h>. Also, use <...> for inclusion
1430 of system headers.
1431
087ed40d
MV
1432 * async.c, goops.h, modules.h, validate.h (SCM_MAKE_VALIDATE_MSG):
1433 New. Use it instead of SCM_MAKE_VALIDATE in lots of places to
30f920c3 1434 give better error messages. Thanks to Bill Schottstaedt!
087ed40d 1435
5ec1d2c8
DH
14362002-10-19 Dirk Herrmann <D.Herrmann@tu-bs.de>
1437
1438 * evalext.h, evalext.c (scm_definedp, scm_defined_p): Renamed
1439 scm_definedp to scm_defined_p and deprecated scm_definedp.
1440
100ae50d
DH
14412002-10-19 Dirk Herrmann <D.Herrmann@tu-bs.de>
1442
1443 * async.h, async.c (scm_system_async): Fixed deprecation to work
1444 correctly when deprecated features are excluded.
1445
2794cb50
MV
14462002-10-16 Marius Vollmer <marius.vollmer@uni-dortmund.de>
1447
1448 * async.c (scm_system_async_mark_for_thread): Validate thread
1449 argument.
1450
1451 * coop-threads.c (scm_i_thread_root): Do not validate argument.
1452
1453 * feature.c (scm_init_feature): Don't add 'threads' for
1454 USE_NULL_THREADS.
1455
1456 * inline.h (scm_cell, scm_double_cell): Also allow
1457 USE_NULL_THREADS to not protect the slot initializers.
1458
1459 * scmsigs.c (scm_sigaction_for_thread): It's "USE_THREADS" not
1460 "USE_THREAD".
1461
1462 * Makefile.am (noinst_HEADERS): Added null-threads.c.
1463 (modinclude_HEADERS): Added null-threads.h.
1464
1465 * threads.h: Include null-threads.h when !USE_COOP_THREADS.
1466 * threads.c: Include null-threads.c when !USE_COOP_THREADS.
1467 (scm_init_threads): Use generic type names scm_t_mutex and
1468 scm_t_cond instead of coop_m and coop_c.
1469
1470 * null-threads.c, null-threads.h: New files.
1471
ff810d7a
MV
14722002-10-15 Marius Vollmer <mvo@zagadka.ping.de>
1473
1474 * Makefile.am: Replaced "$<" in non-pattern rules with its value.
1475 This is to support makes that know about "$<" only in pattern
1476 rules, like Sun's make.
1477
a90bdb73
MV
14782002-10-13 Marius Vollmer <mvo@zagadka.ping.de>
1479
1480 * Makefile.am (libpath.h): Fixed typo in top_srcdir_absolute
1481 substitution. Thanks to David Allouche!
1482
e71a8bf2
DH
14832002-10-13 Dirk Herrmann <D.Herrmann@tu-bs.de>
1484
1485 * evalext.h: Replaced SCM_DEBUG_DEPRECATED with
1486 !SCM_ENABLE_DEPRECATED.
1487
41f77ff5
MV
14882002-10-11 Marius Vollmer <marius.vollmer@uni-dortmund.de>
1489
504d99c5 1490 * async.c (scm_system_async_mark_for_thread): Only call
41f77ff5
MV
1491 scm_i_thread_root when USE_THREADS is defined. Use scm_root
1492 otherwise.
1493
1494 * scmsigs.c (take_signal): Only call scm_i_thread_root when
1495 USE_THREADS is defined. Use scm_root otherwise.
1496 (scm_sigaction_for_thread): Ignore THREAD argument when
1497 USE_THREADS is not defined. Also, move THREAD argument defaulting
1498 out of HAVE_SIGACTION section, which was a bug.
1499
6d16b125
MV
15002002-10-10 Marius Vollmer <marius.vollmer@uni-dortmund.de>
1501
1502 * scmsigs.c (scm_sigaction_for_thread): Store original handler in
1503 signal_handlers, not the closure that is used as the async.
1504 The closure is stored in signal_handler_cells, as previously.
1505
acfa1f52
MV
15062002-10-10 Marius Vollmer <mvo@zagadka.ping.de>
1507
1508 * root.h (scm_root_state): Added 'block_async' slot.
1509 (scm_active_asyncs): Removed abbrev.
1510 * root.c (scm_make_root): Initialize 'block_asyncs' slot.
1511
1512 * __scm.h (SCM_ASYNC_TICK): Do without the scm_active_asyncs
1513 abbrev.
1514
1515 * async.h (scm_call_with_blocked_asyncs,
1516 scm_call_with_unblocked_asyncs, scm_c_call_with_blocked_asyncs,
1517 scm_c_call_with_unblocked_asyncs): New prototypes.
1518 (scm_mask_signals, scm_unmask_signals): Deprecated.
1519 (scm_mask_ints): Turned into a macro.
1520 * async.c (scm_mask_ints): Removed.
1521 (scm_run_asyncs): Do not set scm_mask_ints while running an async.
1522 this should not be necessary.
1523 (scm_async_click): Test block_asyncs instead of scm_mask_ints.
1524 (scm_mask_signals, scm_unmask_signals): Deprecated. Emit
1525 deprecation warning and check for errornous use. Set block_asyncs
1526 instead of scm_mask_ints.
1527 (increase_block, decrease_block, scm_call_with_blocked_asyncs,
1528 scm_call_with_unblocked_asyncs, scm_c_call_with_blocked_asyncs,
1529 scm_c_call_with_unblocked_asyncs): New.
1530
1531 * script.c (scm_compile_shell_switches): Do not set scm_mask_ints.
1532 Asyncs are enabled by default.
1533
34010f56
NJ
15342002-10-09 Neil Jerram <neil@ossau.uklinux.net>
1535
1536 * vports.c (scm_make_soft_port): Allow vector argument to carry a
1537 6th element: an input waiting thunk.
1538 (sf_input_waiting): New.
1539
9310d6f2
MV
15402002-10-05 Marius Vollmer <mvo@zagadka.ping.de>
1541
1542 * root.c (root_mark): Mark active_asyncs slot.
1543
1544 * async.c (scm_async_click): Set the cdr of a executed handler
1545 cell to SCM_BOOL_F, not SCM_EOL.
1546 (scm_i_queue_async_cell): Queue the cell at the end of the list,
1547 and only if the handler procedure is not already present.
1548 (scm_system_async_mark_for_thread): Initialize cdr of handler cell
1549 with SCM_BOOL_F.
1550 * scmsigs.c (scm_sigaction_for_thread): Likewise.
1551
ac48c719
RB
15522002-10-04 Rob Browning <rlb@defaultvalue.org>
1553
1360a142
RB
1554 * guile.c (main): switch to scm_lt_dlset_preloaded_symbols;
1555
1556 * dynl.c (sysdep_dynl_link): switch to scm_lt_dlhandle,
1557 scm_lt_dlopenext, and scm_lt_dlerror.
1558 (sysdep_dynl_unlink): switch to scm_lt_dlhandle, scm_lt_dlclose,
1559 and scm_lt_dlerror.
1560 (sysdep_dynl_func): switch to scm_lt_dlhandle, scm_lt_dlsym,
1561 and scm_lt_dlerror.
1562 (sysdep_dynl_init): switch to scm_lt_dlinit();
1563
1564 * Makefile.am (libguile_la_LIBADD): switch to use
1565 libguile-ltdl.la.
1566
504d99c5 1567 * numbers.c (scm_integer_expt): (expt 0 1) should be 1.
ac48c719 1568
497092c9
MV
15692002-10-04 Marius Vollmer <mvo@zagadka.ping.de>
1570
1571 * scmsigs.h (scm_sigaction_for_thread): New prototype.
1572 * scmsigs.c (got_signal): Removed.
1573 (signal_handler_cells, signal_handler_threads): New.
1574 (take_signal): Queue the cell of the signal for the specified
1575 thread. Reset the signal handler on systems that don't have
1576 sigaction.
1577 (sys_deliver_signals): Removed.
1578 (close_1): New.
1579 (scm_sigaction_for_thread): Renamed from scm_sigaction and
1580 extended to also set the thread of a signal and allocate a cell
1581 for it. Keep the Scheme name "sigaction". Check that signum is
1582 within range. Also, use SCM_VECTOR_REF instead of SCM_VELTS.
1583 (scm_sigaction): Implement in terms of scm_sigaction_for_thread.
1584 (scm_init_scmsigs): Allocate signal_handler_cells and
1585 signal_handler_threads vectors.
1586
1587 * async.c: Removed GUILE_OLD_ASYNC_CLICK code. Reorganized so
1588 that system asnycs and user asyncs are separated. Reimplemented
1589 system asyncs to work per-thread.
1590
1591 * gc.c (scm_init_gc): Do not use scm_system_async.
1592
1593 * async.h (scm_asyncs_pending, scm_set_tick_rate,
1594 scm_set_switch_rate, scm_system_async_mark_from_signal_handler):
1595 Removed prototypes.
1596 (scm_i_queue_async_cell): New.
1597
1598 * __scm.h (scm_asyncs_pending_p): Removed.
1599 (SCM_ASYNC_CLICK): Check scm_active_asyncs instead of
1600 scm_asyncs_pending_p.
1601
1602 * async.h (scm_system_async_mark_for_thread): New prototype.
1603
1604 * __scm.h: Removed GUILE_OLD_ASYNC_CLICK code.
1605
1606 * root.h (scm_root_state): Added new "active_asyncs" slot.
1607 * root.c (scm_make_root): Initialize it to SCM_EOL.
1608
1609 * coop-defs.h (coop_t): Added new "handle" slot.
1610 * coop-threads.c (all_threads, scm_current_thread,
1611 scm_all_threads, scm_i_thread_root): New.
1612 (scm_threads_init): Add main thread to all_threads.
1613 (scheme_launch_thread): Remove thread from all_threads when it
1614 terminates.
1615 (scm_call_with_new_thread): Initialize handle slot of coop_t
1616 structure and add new thread to all_threads.
1617 (scm_spawn_thread): Likewise.
1618
1619 * threads.h (scm_current_thread, scm_all_threads): New prototypes.
1620 * threads.c (scm_current_thread, scm_all_threads): Register as
1621 primitives.
1622
1623 * dynl.c: Use scm_lt_ prefix for libltdl functions.
1624
480fa28d
NJ
16252002-09-29 Neil Jerram <neil@ossau.uklinux.net>
1626
1627 * script.c (scm_compile_shell_switches): Fix bad spelling of
1628 `explicitly' in comment.
1629
16302002-09-28 Neil Jerram <neil@ossau.uklinux.net>
1631
1632 * posix.c (scm_geteuid, scm_getegid, scm_seteuid, scm_setegid):
1633 Refer to provided? in doc string rather than deprecated feature?.
1634
3553e1d1
GH
16352002-09-24 Gary Houston <ghouston@arglist.com>
1636
1637 * inline.h (scm_double_cell): prevent reordering of statements
1638 with any following code (for GCC 3 strict-aliasing).
1639 * numbers.c (scm_make_real), num2float.i.c (FLOAT2NUM): removed
1640 the earlier version of the reordering prevention.
1641
4ad0814a
HWN
16422002-09-19 Han-Wen Nienhuys <hanwen@cs.uu.nl>
1643
1644 * inline.h (scm_double_cell): move SET_GCMARK set out of if body.
1645
e88e4f2e
HWN
16462002-09-09 Han-Wen Nienhuys <hanwen@cs.uu.nl>
1647
1648 * gc-malloc.c (scm_gc_register_collectable_memory): more overflow
1649 protection.
1650
1e71eafb
HWN
16512002-09-08 Han-Wen Nienhuys <hanwen@cs.uu.nl>
1652
1653 * inline.h: include stdio.h
1654
1655 * smob.c (free_print): abort if scm_debug_cell_accesses_p is set
1656
61ef9c1f
HWN
16572002-09-05 Han-Wen Nienhuys <hanwen@cs.uu.nl>
1658
dac04e9f
HWN
1659 * gc-segment.c (scm_i_make_initial_segment): check user settings
1660 for sanity.
1661
1662 * gc-malloc.c (scm_gc_init_malloc): check user settings for
1663 sanity.
dac04e9f
HWN
1664
1665 * gc-freelist.c (scm_init_freelist): check user settings for sanity.
1666
ffd72400
HWN
1667 * struct.h: change scm_structs_to_free to scm_i_structs_to_free
1668
1669 * gc-malloc.c (scm_gc_register_collectable_memory): use floats;
1e71eafb
HWN
1670 these won't ever wrap around with high memory usage. Thanks to
1671 Sven Hartrumpf for finding this.
ffd72400 1672
5bd4a949
HWN
1673 * gc-freelist.c: include <stdio.h>
1674
61ef9c1f
HWN
1675 * gc-malloc.c: add DEBUGINFO for mtrigger GCs.
1676
ffd0ef3b
MV
16772002-09-01 Marius Vollmer <mvo@zagadka.ping.de>
1678
a27e3d14
MV
1679 * vectors.h (SCM_VECTOR_REF): New.
1680
ffd0ef3b
MV
1681 * snarf.h (SCM_DEFINE_PUBLIC): New.
1682
f8a1712b
MV
16832002-08-30 Marius Vollmer <mvo@zagadka.ping.de>
1684
1685 * socket.c (scm_addr_vector): Added size of address to arguments.
1686 Use it to avoid accessing a non-existent path in a sockaddr_un.
1687 Changed all callers.
1688
7200a36b
HWN
16892002-08-29 Han-Wen Nienhuys <hanwen@cs.uu.nl>
1690
1383773b
HWN
1691 * gc.h: remove DOUBLECELL card flags.
1692
1693 * gc-malloc.c (scm_calloc): try to use calloc() before calling
1694 scm_realloc().
1695
1696 * gc-segment.c (scm_i_initialize_heap_segment_data): remove card
1697 init loop; handle this from scm_init_card_freelist()
1698
1699 * gc-card.c (scm_init_card_freelist): init bit vector here.
1700
7200a36b 1701 * numbers.c (scm_make_real): prevent reordering of statements
8fa5786d 1702 num2float.i.c (FLOAT2NUM): idem
7200a36b 1703
9981de3a
HWN
17042002-08-27 Han-Wen Nienhuys <hanwen@cs.uu.nl>
1705
1706 * eval.h: prepend libguile/ to include path
1707
19647556
MV
17082002-08-26 Marius Vollmer <mvo@zagadka.ping.de>
1709
1710 * script.c (scm_compile_shell_switches): Added "2002" to Copyright
1711