(scm_flush_ws): Detect "#!"-style comments here.
[bpt/guile.git] / libguile / ChangeLog
CommitLineData
5de12658
KR
12004-09-07 Kevin Ryde <user42@zip.com.au>
2
3 * numbers.c (scm_integer_expt): Reject exponent +/-inf.
4 (scm_integer_p): +/-inf is not an integer.
5 Bug report by Bill Schottstaedt.
6
7 * ports.c (scm_getc, scm_lfwrite): Recognise \a \b and \r for port
8 column.
9 * ports.h (SCM_ZEROCOL, SCM_DECCOL): New macros.
10
11 * posix.c (scm_access): Update docstring per manual.
12
13 * posix.c (scm_nice): Correction to error detection. Reported by
14 Matthias Koeppe.
15
16 * stime.c (scm_current_time, scm_gettimeofday, scm_strptime): Don't
17 throw error before unlocking mutex with SCM_ALLOW_INTS.
18
e227addf
KR
192004-09-06 Kevin Ryde <user42@zip.com.au>
20
21 * stime.h (SCM_TIME_UNITS_PER_SECOND): Use sysconf(_SC_CLK_TCK) when
22 available. This also gets around CLK_TCK being absent when
23 _GNU_SOURCE and _POSIX_C_SOURCE are defined in stime.c.
24
edea856c
SJ
252004-09-03 Stefan Jahn <stefan@lkcc.org>
26
27 * threads.c (scm_threads_mark_stacks): Fixed local variable
28 definitions.
29
30 * strings.c (scm_i_substring_copy, s_scm_string_append): Fixed
31 local variable definitions.
32
33 * stime.c (_POSIX_C_SOURCE): Do not define this item on
34 MinGW32 because it conflicts with its pthread headers.
35 (s_scm_mktime): Consider the HAVE_STRUCT_TM_TM_ZONE define.
36 (s_scm_strftime): Using scm_from_locale_string() instead of
37 scm_makfrom0str().
38
39 * posix.c (s_scm_putenv): Fixed typo in the !HAVE_UNSETENV
40 part.
41
42 * numbers.c (scm_init_numbers): Removed check_sanity() call
43 inside GUILE_DEBUG. The function has been removed somewhen...
44
45 * filesys.c (_POSIX_C_SOURCE): Do not define this item on
46 MinGW32 because it conflicts with its pthread headers.
47
d9eb2d67
MV
482004-08-27 Marius Vollmer <marius.vollmer@uni-dortmund.de>
49
50 * strings.c (SCM_STRINGP): Accept all strings.
51 (SCM_STRING_CHARS): Reject shared substrings here.
52
53 * script.c (scm_compile_shell_switches): Added 2003 and 2004 to
54 the Copyright years.
55
c495c342
KR
562004-08-27 Kevin Ryde <user42@zip.com.au>
57
58 * socket.c (scm_fill_sockaddr): Use HAVE_STRUCT_SOCKADDR_SIN_LEN and
59 HAVE_STRUCT_SOCKADDR_IN6_SIN6_LEN for sockaddr fields, SIN_LEN and
60 SIN_LEN6 are not defined on all systems. Reported by Michael Tuexen.
61
57aa5515
MV
622004-08-26 Marius Vollmer <marius.vollmer@uni-dortmund.de>
63
64 * strings.h, strings.c (scm_i_make_symbol): Added FLAGS parameter.
65 * symbols.h, symbols.c (SCM_I_F_SYMBOL_UNINTERNED,
66 scm_i_symbol_is_interned, scm_i_mem2symbol,
67 scm_i_mem2uninternedsymbol): Use it to store uninternedness flag.
68
ce25760f
MV
692004-08-25 Marius Vollmer <marius.vollmer@uni-dortmund.de>
70
19ff6ffc
MV
71 * srfi-13.c: First cut at thread-safeness and proper use of
72 scm_i_string_chars et al. Copious scm_remember_upto_heres have
73 been inserted. Made sure that no internal string pointer is used
74 across a SCM_TICK or a possible GC.
75
ce25760f
MV
76 * script.c (scm_compile_shell_switches): Use
77 scm_from_locale_string instead of scm_makfrom0str.
78
79 * srfi-13.c (scm_string_rindex): Export to Scheme, as it has
80 always been.
81
c5080b51
MV
822004-08-25 Marius Vollmer <mvo@zagadka.de>
83
84 Moved SRFI-13 and SRFI-14 into the core, taking over the role of
85 strop.c.
86
87 * srfi-13.c, srfi-13.h, srfi-14.c, srfi-14.h: New files.
88 * strop.h, strop.c: Removed, they are now empty.
89 * Makefile.am: Updated for new and removed files.
90
91 * symbols.h, symbols.c (scm_string_ci_to_symbol): Moved here, next
92 to scm_string_to_symbol.
93
94 * chars.c (scm_char_alphabetic_p, scm_char_numeric_p,
95 scm_char_whitespace_p, scm_upper_case_p, scm_lower_case_p,
96 scm_char_is_both_p): Use scm_char_set_contains_p with the proper
97 charset instead of libc functions.
98
99 * strorder.c (scm_string_equal_p, scm_string_ci_equal_p,
100 scm_string_less_p, scm_string_leq_p, scm_string_gr_p,
101 scm_string_geq_p, scm_string_ci_less_p, scm_string_ci_leq_p,
102 scm_string_ci_gr_p, scm_string_ci_geq_p): Use scm_string_eq, etc
103 instead of explicit code.
104
105 * deprecated.c, load.c, posix.c, unif.c, symbols.c: Include
106 "srfi-13.h" instead of "strop.h".
107
108 * init.c (scm_init_guile_1): Call scm_init_srfi_13 and
109 scm_init_srfi_14. Do not call scm_init_strop.
110
4b0d27f2
MV
1112004-08-24 Marius Vollmer <marius.vollmer@uni-dortmund.de>
112
113 * numbers.c (scm_inf_p): Synced docstring back from manual.
114
3ece39d6
MV
1152004-08-22 Marius Vollmer <mvo@zagadka.de>
116
117 * strings.c (get_str_buf_start): New helper function.
118 (scm_i_substring, scm_i_substring_copy, scm_i_substring_shared,
119 scm_i_string_char, scm_i_string_writable_chars): Use it.
120 (scm_i_substring_copy): Make START argument optional for C
121 callers, for upcoming SRFI-13 integration.
122
1232004-08-21 Marius Vollmer <mvo@zagadka.de>
124
125 From Richard Todd, Thanks!
126
127 * script.c (scm_compile_shell_switches): added '-L' switch to add
128 to the %load-path.
129
5fa0939c
DH
1302004-08-21 Dirk Herrmann <dirk@dirk-herrmanns-seiten.de>
131
132 * eval.c (unmemoize_exprs): When dropping internal body markers
133 from the output during unmemoization, also drop those that are not
134 immediately at the beginning of a body.
135
2146fdeb
MV
1362004-08-20 Marius Vollmer <marius.vollmer@uni-dortmund.de>
137
c1f54b3d
MV
138 * eval.c (scm_lookupcar1): Report "Variable used before given a
139 value" insetad of an "Unbound" one for variables that are found
140 but still contain SCM_UNDEFINED.
2146fdeb
MV
141
142 * posix.c (scm_mkstemp): Correction to the correction, mkstemp
143 expects a null-terminated string in the locale encoding, but
144 scm_i_string_writable_chars doesn't give that. Fixed by letting
145 mkstemp modify a locale version of the tmpl argument and copying
146 the result back into tmpl.
147
148 * strop.c (scm_substring_move_x): Store into str2, not str1.
149
d4f76919
KR
1502004-08-20 Kevin Ryde <user42@zip.com.au>
151
152 * posix.c (scm_mkstemp): Correction to new locale_string stuff, need
153 to modify the input string.
154
b5247a6b
MV
1552004-08-19 Marius Vollmer <mvo@zagadka.de>
156
157 * deprecated.c (SCM_SYMBOL_CHARS): Cast away const in return.
158 (SCM_SYMBOL_LENGTH): It's scm_i_symbol_length, not
159 scm_c_symbol_length.
160
f26b9395
MV
1612004-08-19 Marius Vollmer <marius.vollmer@uni-dortmund.de>
162
163 New string implementation, with copy-on-write strings and
164 mutation-sharing substrings, and a new internal string API.
165 Symbols can now share memory with strings.
166
167 * tags.h (scm_tc7_stringbuf): New tag.
168
169 * strings.h, strings.c: (scm_i_string_chars, scm_i_string_length,
170 scm_i_string_writable_chars, scm_i_string_stop_writing): New, to
171 replace SCM_I_STRING_CHARS and SCM_I_STRING_LENGTH. Updated all
172 uses.
173 (scm_i_make_string, scm_c_make_string): New, to replace
174 scm_allocate_string. Updated all uses.
175 (SCM_STRINGP, SCM_STRING_CHARS, SCM_STRING_UCHARS,
176 SCM_STRING_LENGTH): Deprecated.
177 (scm_allocate_string, scm_take_str, scm_take0str, scm_mem2string,
178 scm_str2string, scm_makfrom0str, scm_makfrom0str_opt):
179 Discouraged. Replaced all uses with scm_from_locale_string or
180 similar, as appropriate.
181 (scm_c_string_length, scm_c_string_ref, scm_c_string_set_x,
182 scm_c_substring, scm_c_substring_shared, scm_c_substring_copy,
183 scm_substring_shared, scm_substring_copy): New.
184
185 * symbols.c, symbols.h (SCM_SYMBOLP, SCM_SYMBOL_FUNC,
186 SCM_SET_SYMBOL_FUNC, SCM_SYMBOL_PROPS, SCM_SET_SYMBOL_PROPS,
187 SCM_SYMBOL_HASH, SCM_SYMBOL_INTERNED_P, scm_mem2symbol,
188 scm_str2symbol, scm_mem2uninterned_symbol): Discouraged.
189 (SCM_SYMBOL_LENGTH, SCM_SYMBOL_CHARS, scm_c_symbol2str):
190 Deprecated.
191 (SCM_MAKE_SYMBOL_TAG, SCM_SET_SYMBOL_LENGTH, SCM_SET_SYMBOL_CHARS,
192 SCM_PROP_SLOTS, SCM_SET_PROP_SLOTS): Removed.
193 (scm_is_symbol, scm_from_locale_symbol, scm_from_locale_symboln):
194 New, to replace scm_str2symbol and scm_mem2symbol, respectively.
195 Updated all uses.
196 (scm_gensym): Generate only the number suffix in the buffer, just
197 string-append the prefix.
198
199 * error.c (scm_memory_error): Do not try to throw, just abort.
200 Throwing will not work anyway.
201
202 * gh.h, gh-data.c (gh_set_substr): Made src const.
203
204 * ports.c (scm_i_mode_bits_n): New, for counted strings.
205 (scm_mode_bits): Use it.
206 (scm_c_port_for_each): Blocking GC does not seem to work, allocate
207 a vector normally and fill that instead of consing a list with a
208 blocked GC.
209
210 * read.c (scm_i_casei_streq): New, for counted strings.
211
212 * threads.c (gc_section_count): Removed, thread-sleeping can not
213 be nested.
214 (scm_i_thread_put_to_sleep): Call scm_i_leave_guile before locking
215 admin mutex so that we can be put to sleep by other threads while
216 blocking on that mutex. Lock all the heap mutex of all threads,
217 including ourselves.
218 (scm_i_thread_wake_up): Unlock all threads, including ourselves,
219 call scm_i_enter_guile.
220 (scm_thread_mark_stacks): Expect all threads to be suspended.
221
222 * gc.h, gc.c (scm_i_gc_admin_mutex): New, to protect
223 scm_gc_mallocated, for now.
224 (scm_init_storage): Initialize it.
225 * gc-malloc.c (descrease_mtrigger, increase_mtrigger): Use it.
226
227 * gc-mark.c (scm_gc_mark_dependencies): Call scm_i_string_mark,
228 scm_i_stringbuf_mark and scm_i_symbol_mark, as appropriate.
229 * gc-card.c (scm_i_sweep_card): Call scm_i_string_free,
230 scm_i_stringbuf_free and scm_i_symbol_free, as appropriate.
231
cd505b38
MV
232 * strop.c (scm_string_copy): Use scm_c_substring to get a
233 copy-on-write string.
234
8a807b26
KR
2352004-08-18 Kevin Ryde <user42@zip.com.au>
236
237 * arbiters.c (FETCH_STORE): New macro.
238 (SCM_LOCK_VAL, SCM_UNLOCK_VAL): New constants.
239 (SCM_LOCK_ARB, SCM_UNLOCK_ARB): Remove, effectively absorbed into
240 scm_try_arbiter and scm_release_arbiter.
241 (scm_try_arbiter, scm_release_arbiter): Use FETCH_STORE to get xchg
242 for speed on i386, otherwise using mutex.
243
244 * eq.c (scm_equal_p): Remove real==fraction and fraction==real, they
245 must be #f according to R5RS. (equal? follows eqv?, and for eqv? an
246 exact and inexact is #f.)
247
248 * fports.c (fport_print): Use scm_ttyname instead of ttyname directly,
249 to get thread safety of scm_ttyname.
250
251 * ports.c (ttyname): Remove prototype, unused.
252
d6cd4c36 253 * socket.c (scm_init_socket): Add SOCK_SEQPACKET and SOCK_RDM.
1f3cc0d3 254 Reported by Michael Tuexen.
d6cd4c36 255
fa0c0a4b
MV
2562004-08-13 Marius Vollmer <marius.vollmer@uni-dortmund.de>
257
258 * load.c (scm_init_load_path): Do not pass NULL to
259 scm_to_locale_string, which would happen when GUILE_LOAD_PATH is
260 not set. Thanks to Bill Schottstaedt.
261
70f7ee41
MV
2622004-08-12 Marius Vollmer <marius.vollmer@uni-dortmund.de>
263
264 * socket.c (scm_inet_aton, scm_inet_pton): Convert SCM strings to
265 locale strings instead of accessing their internals.
266 (scm_recv, scm_send, scm_recvfrom, scm_sendto): Use
267 SCM_I_STRING_CHARS and SCM_I_STRING_LENGTH instead of
268 SCM_STRING_CHARS and SCM_STRING_LENGTH.
269
270 * simpos.c (scm_system): Convert SCM strings to locale strings
271 instead of accessing their internals.
272
273 * script.c (scm_compile_shell_switches): Convert version to locale
274 string before printing it.
275
276 * rdelim.c (scm_read_delimited_x): Avoid
277 SCM_VALIDATE_SUBSTRING_SPEC_COPY and use scm_from_size_t instead
278 of scm_from_long for the returned number of read characters.
279
280 * ioext.c (scm_fdopen): Use scm_i_fdes_to_port together with
281 scm_i_mode_bits to avoid accessing internals of SCM string from C.
282
283 * filesys.c (STRING_SYSCALL, STRING2_SYSCALL): New helper macros.
284 Use them instead of SCM_SYSCALL when one or two strings need to be
285 converted into locale strings.
286 (my_rename): New, gathers platform dependent code for renaming.
287 (scm_rename): Use it.
288 (scm_readlink, scm_copy_file): Convert SCM strings to locale
289 strings instead of accessing their internals.
290 (scm_basename, scm_dirname): Use SCM_I_STRING_CHARS and
291 SCM_I_STRING_LENGTH instead of SCM_STRING_CHARS and
292 SCM_STRING_LENGTH.
293
294 * extensions.c (load_extension): Convert lib and init to locale
295 strings instead of accessing the internals directly.
296 (scm_c_load_extension): Use scm_from_locale_string instead of
297 scm_makfrom0str.
298
299 * fports.h, fports.c (scm_i_fdes_to_port): New, like
300 scm_fdes_to_port, but take mode bits directly instead of as a C
301 string.
302 (scm_i_fdes_to_port): Implement using above.
303 (scm_open_file): Use scm_i_fdes_to_port together with
304 scm_i_mode_bits to avoid accessing internals of SCM string from C.
305 * vports.c (scm_make_soft_port): Use scm_i_fdes_to_port together
306 with scm_i_mode_bits to avoid accessing internals of SCM string
307 from C.
308
309 * ports.h (scm_i_mode_bits): New, same as scm_mode_bits but with a
310 SCM string as argument.
311
312 * ports.c (scm_i_void_port): New, like scm_void_port but take mode
313 bits directly instead of C string.
314 (scm_void_port): Implement using above.
315 (scm_sys_make_void_port): Use scm_i_void_port together with
316 scm_i_mode_bits to avoid accessing internals of SCM string.
317
318 * strings.h, strings.c (scm_i_get_substring_spec): New.
319
320 * socket.c, rw.c, deprecated.h, validate.h
321 (SCM_VALIDATE_STRING_COPY): Deprecated. Replaced all uses with
322 SCM_VALIDATE_STRING plus SCM_I_STRING_CHARS or
323 scm_to_locale_string, etc.
324 (SCM_VALIDATE_SUBSTRING_SPEC_COPY): Deprecated. Replaced as
325 above, plus scm_i_get_substring_spec.
326
327 * regex-posix.c, read.c, random.c, ramap.c, print.c, numbers.c,
328 hash.c, gc.c, gc-card.c, convert.i.c, backtrace.c, strop.c,
329 strorder.c, strports.c, struct.c, symbols.c, unif.c, ports.c: Use
330 SCM_I_STRING_CHARS, SCM_I_STRING_UCHARS, and SCM_I_STRING_LENGTH
331 instead of SCM_STRING_CHARS, SCM_STRING_UCHARS, and
332 SCM_STRING_LENGTH, respectively. Also, replaced scm_return_first
333 with more explicit scm_remember_upto_here_1, etc, or introduced
334 them in the first place.
335
336 * posix.c (WITH_STRING): New helper macro. Use it where one
337 locale string is needed for a short piece of code.
338 (STRING_SYSCALL): New helper macro. Use it instead of SCM_SYSCALL
339 when one locale string is needed.
340 (scm_mkstemp): Convert tmpl to a locale string.
341 (scm_putenv): Rewritten to use only C strings.
342 (scm_setlocale, scm_crpt): Convert argument strings to locale
343 strings.
344
3452004-08-11 Marius Vollmer <marius.vollmer@uni-dortmund.de>
346
347 * load.c (scm_primitive_load_path): Do not check for absolute
348 filenames when scm_sys_search_load_path returns false, which will
349 return absolute filenames unchanged.
350
bb26cc2d
MV
3512004-08-11 Marius Vollmer <mvo@zagadka.de>
352
353 * gc.c, procprop.c (scm_init_storage, scm_stand_in_procs,
354 scm_stand_in_proc): Use a hastable for scm_stand_in_procs instead
355 of an alist. Thanks to Matthias Koeppe!
356
02573e4c
MV
3572004-08-10 Marius Vollmer <marius.vollmer@uni-dortmund.de>
358
359 * strings.h, deprecated.h (SCM_STRING_COERCE_0TERMINATION_X):
360 Moved from string.h to deprecated.h.
361
362 * deprecated.c, deprecated.h (SCM_CHARS, SCM_LENGTH): Removed.
363
f9751e86 364 * strings.h, strings.c (SCM_MAKE_STRING_TAG): Renamed to
02573e4c
MV
365 SCM_I_MAKE_STRING_TAG, changed all uses.
366 (SCM_STRING_CHARS, SCM_STRING_UCHARS, SCM_STRING_LENGTH): Renamed
367 to SCM_I_STRING_CHARS, SCM_I_STRING_UCHARS, and SCM_I_LENGTH
368 respectively. For a short time, the old names are still there as
369 aliases. Not all uses have been changed yet, but the ones in
370 strings.c have.
371 (SCM_STRING_MAX_LEN): Do not hardcode to 24 bits, compute from
372 SCM_T_BITS_MAX.
373 (scm_is_string, scm_from_locale_string, scm_from_locale_stringn,
374 scm_take_locale_string, scm_take_locale_stringn,
375 scm_to_locale_string, scm_to_locale_stringn,
376 scm_to_locale_stringbuf): New.
377 (scm_c_string2str, scm_c_substring2str): Deprecated by moving to
378 deprecated.[hc]. Implemented in terms of the new functions above.
379 (scm_take_str, scm_take0str, scm_mem2string, scm_str2string,
380 scm_makfrom0str): Reimplemented in terms of the new functions from
381 above. They will be discouraged shortly.
382 (scm_substring): Do not use scm_mem2string.
383 (scm_i_allocate_string_pointers, scm_i_free_string_pointers): New,
384 to replace similar code from posix.c, simpos.c, and dynl.c.
385 (scm_string_append): Use memcpy instead of explicit loop. Do not
386 use register keyword. Use plain 'char' instead of 'unsigned
387 char'.
388
389 * strports.c (scm_mkstrport): Use SCM_I_STRING_UCHARS instead of
390 SCM_STRING_UCHARS. Use SCM_I_STRINGP instead of SCM_STRINGP.
391
392 * strop.c (scm_i_index): Replaced SCM_STRINGP, SCM_STRING_CHARS,
393 and SCM_STRING_LENGTH with SCM_I_STRINGP, SCM_I_STRING_CHARS, and
394 SCM_I_STRING_LENGTH, respectively. Pass string object directly,
395 not as a pointer. Use scm_remember_upto_here_1 to protect it.
396
397 * read.c (scm_input_error): Use a SCM value for 'fn', not a C
398 string. This avoids a conversion round-trip.
399
400 * gh_data.c: Replaced SCM_STRINGP, SCM_STRING_CHARS, and
401 SCM_STRING_LENGTH with SCM_I_STRINGP, SCM_I_STRING_CHARS, and
402 SCM_I_STRING_LENGTH, respectively.
403 (gh_scm2newstr): Implement in terms of scm_to_locale_string.
404
405 * environments.c: Instead calling scm_puts on the SCM_STRING_CHARS
406 of a string, call scm_display on the string itself.
407
408 * dynwind.c, dynwind.h (scm_frame_free): New.
409
410 * stime.c, socket.c, simpos.c, procs.c, posix.c, ports.c,
411 net_db.c, fports.c, filesys.c, eval.c, deprecation.c, dynl.c:
412 Replaced uses of SCM_STRING_CHARS with proper uses of
413 scm_to_locale_string. Replaced SCM_STRINGP with scm_is_string.
414 Replaced scm_mem2string with scm_from_locale_string.
415
416 * simpos.c, posix.c (allocate_string_pointers, environ_list_to_c):
417 Removed, replaced all uses with scm_i_allocate_string_pointers.
418
419 * load.h, load.c (scm_internal_parse_path): Removed.
420 (scm_parse_path): Use scm_string_split to do the work.
421 (scm_init_load_path): Use scm_parse_path instead of
422 scm_internal_parse_path.
423 (scm_search_path): Rewritten string handling part of the code in
424 terms of scm_to_locale_stringbuf and so that it is thread safe.
425
426 * error.c (scm_error_scm): Throw directly instead of calling
427 scm_error, this avoids the back and forth conversion of SUBR and
428 MESSAGE and also plugs a memory leak.
429 (scm_error): Call scm_error_scm.
430
431 * backtrace.c: Replaced SCM_STRINGP with scm_is_string.
432 (display_header): Print FNAME when it is true, not
433 merely when it is a string.
434
435 * strings.h (SCM_SET_STRING_LENGTH, SCM_SET_STRING_CHARS): Removed
436 unceremoniously. They were unused by Guile itself, and external
437 use should stop immediately.
438
439
409eb4e5
MV
4402004-08-10 Marius Vollmer <mvo@zagadka.de>
441
442 * numbers.h, number.c, deprecated.h, deprecated.c (scm_round,
443 scm_truncate): Renamed to scm_c_round and scm_c_truncate;
444 deprecated versions installed in deprecated.h and deprecated.c.
445 Changed all uses.
446
a00eaf19
RB
4472004-08-06 Rob Browning <rlb@defaultvalue.org>
448
449 * net_db.c (scm_resolv_error): don't cause an exception while
450 trying to throw an exception -- call scm_misc_error with correct
451 arguments. The previous arguments needed a format escape that
452 wasn't in any of the format strings.
453
bcb88c93
KR
4542004-08-06 Kevin Ryde <user42@zip.com.au>
455
8f094b97
KR
456 * ramap.c (scm_array_fill_x): For byvect char fill, force signed char
457 so as not to depend on signedness of plain char. For byvect range
458 check, throw out-of-range rather than wrong-type-arg.
459
bcb88c93
KR
460 * unif.c (scm_uniform_vector_ref, scm_array_set_x): For byvect, force
461 signed byte range checks by using scm_to_schar and scm_from_schar,
462 don't want to depend on signedness of C char.
463
29e61124
KR
4642004-08-05 Kevin Ryde <user42@zip.com.au>
465
466 * arbiters.c (scm_try_arbiter): Use scm_i_misc_mutex instead of
467 SCM_DEFER_INTS.
468 (scm_release_arbiter): Use scm_i_misc_mutex so return value can be
469 guaranteed if multiple threads compete to unlock.
470 Update docstrings per doc/ref/api-scheduling.texi.
471
99de794f
KR
472 * filesys.c (scm_copy_file): Use fstat on the input fd rather than
473 stat on the filename, to be certain a file rename can't mean we get
474 info on one filesystem object but open another. This fstat usage is
475 similar to Emacs copy-file.
476
29e61124
KR
477 * posix.c (scm_setgroups): Enhance docstring, per doc/ref/posix.texi.
478
479 * simpos.c (scm_system_star): Change scm_from_long to scm_from_int on
480 SIGINT and SIGQUIT, since those values are ints.
481
759aa8f9
MV
4822004-08-03 Marius Vollmer <marius.vollmer@uni-dortmund.de>
483
7241f213
MV
484 * num2integral.i.c, num2float.i.c: Removed.
485 * Makefile.am (noinst_HEADERS): Updated.
486
f9656a9f
MV
487 * numbers.h. numbers.c (scm_make_ratio): Renamed to
488 scm_i_make_ratio and made static, replaced uses with scm_divide.
96d8c217
MV
489 (scm_complex_p): New, export as "complex?" to Scheme.
490 (scm_number_p): Export as "number?" to Scheme.
491 (scm_is_complex, scm_is_number): New.
492 (scm_c_make_rectangular, scm_c_make_polar): New.
493 (scm_make_rectangular, scm_make_polar): Use above.
494 (scm_c_real_part, scm_c_imag_part, scm_c_magnitude, scm_c_angle):
495 New.
496 (scm_make_complex): Discouraged by moving to discouraged.h and
497 discouraged.c. Replaced all uses with scm_c_make_rectangular.
498
759aa8f9
MV
499 * discouraged.h, discouraged.c, numbers.c, numbers.h
500 (scm_is_rational): New.
501 (scm_i_short2big, scm_i_int2big, scm_i_uint2big, scm_i_size2big,
502 scm_i_ptrdiff2big, scm_i_long_long2big, scm_i_ulong_long2big):
503 Removed prototypes.
504 (scm_make_real, scm_num2dbl, scm_float2num, scm_double2num):
505 Discouraged by moving to discouraged.h and discouraged.c.
506 Replaced all uses with scm_from_double.
507 (scm_num2float, scm_num2double): Discouraged by moving prototype
508 to discouraged.h and rewriting in terms of scm_to_double.
509 Replaced all uses with scm_to_double.
510 (scm_to_double): Do not implement in terms of scm_num2dbl, use
511 explicit code.
512 (scm_from_double): Do not implement in terms of scm_make_real, use
513 explicit code.
514
531bf3e6
MV
5152004-08-02 Marius Vollmer <marius.vollmer@uni-dortmund.de>
516
759aa8f9
MV
517 * init.c (scm_init_guile_1): Call scm_i_init_discouraged.
518
531bf3e6
MV
519 * gen-scmconfig.h.in (SCM_I_GSC_ENABLE_DISCOURAGED): New.
520 * gen-scmconfig.c (SCM_ENABLE_DISCOURAGED): Emit based on above.
521
522 * eval.c (SCM_EVALIM, SCM_EVALIM2, SCM_XEVAL, SCM_XEVALCAR):
523 Renamed to SCM_I_* in order to avoid collisions with the versions
524 defined in deprecated.h.
525
526 * discouraged.h, discouraged.c: New files.
527
528 * deprecated.h (SCM_FALSEP, SCM_NFALSEP, SCM_BOOLP, SCM_EQ_P,
529 SCM_NEGATE_BOOL, SCM_BOOL, SCM_BOOT_NOT): Promoted from being
530 deprecated to being discouraged by moving to discouraged.h.
531
532 * numbers.h, numbers.c, discouraged.h, discouraged.c
533 (scm_short2num, scm_ushort2num, scm_int2num, scm_uint2num,
534 scm_long2num, scm_ulong2num, scm_size2num, scm_ptrdiff2num,
535 scm_num2short, scm_num2ushort, scm_num2int, scm_num2uint,
536 scm_num2long, scm_num2ulong, scm_num2size, scm_num2ptrdiff,
537 scm_long_long2num, scm_ulong_long2num, scm_num2long_long,
538 scm_num2ulong_long): Discouraged by moving to discouraged.h and
539 discouraged.c and reimplementing in terms of scm_from_* and
540 scm_to_*. Changed all uses to the new scm_from_* and scm_to_*
541 functions.
542
543 * numbers.h, numbers.c: Removed GUILE_DEBUG code.
544 (scm_i_short2big, scm_i_ushort2big, scm_i_int2big, scm_i_uint2big,
545 scm_i_size2big, scm_i_ptrdiff2big): Removed.
546 (scm_i_long2big, scm_i_ulong2big): New, explicit definitions.
547 * conv-integer.i.c, conv-uinteger.i.c: Use them instead of
548 explicit code.
549
5ec82e96
KR
5502004-08-02 Kevin Ryde <user42@zip.com.au>
551
552 * __scm.h (SCM_DEFER_INTS, SCM_ALLOW_INTS): Add comments about past
553 and current usage and migration.
554
58f28989
KR
5552004-07-31 Kevin Ryde <user42@zip.com.au>
556
557 * error.c (scm_strerror): Use scm_i_misc_mutex around strerror since
558 it's not thread safe.
559 (scm_syserror): Use scm_strerror rather than SCM_I_STRERROR, to take
560 advantage of this.
561 * fports.c (scm_open_file): Use scm_strerror likewise.
562 * filesys.c (scm_stat, scm_lstat): Ditto.
563
564 * filesys.c (scm_copy_file): Avoid fd leak when destination file
565 cannot be opened.
566
567 * symbols.c (scm_gensym): Use scm_i_misc_mutex around gensym_counter
568 update, for thread safety.
569 (gensym_counter): Move into scm_gensym which is its only user.
570 (scm_init_symbols): No need to explicitly initialize gensym_counter.
571
03696aab
MV
5722004-07-29 Marius Vollmer <marius.vollmer@uni-dortmund.de>
573
51fdb325
MV
574 * numbers.h (scm_to_schar, scm_to_uchar, scm_to_char,
575 scm_to_short, scm_to_ushort, scm_to_int, scm_to_uint, scm_to_long,
576 scm_to_ulong, scm_to_long_long, scm_to_ulong_long, scm_to_intmax,
577 scm_to_uintmax, scm_to_size_t, scm_to_ssize_t scm_from_schar,
578 scm_from_uchar, scm_from_char, scm_from_short, scm_from_ushort,
579 scm_from_int, scm_from_uint, scm_from_long, scm_from_ulong,
580 scm_from_long_long, scm_from_ulong_long, scm_from_intmax,
581 scm_from_uintmax, scm_from_size_t, scm_from_ssize_t): No longer
582 defined in terms of scm_to_signed_integer, etc, but in terms of
583 scm_to_int8, etc.
584
585 * gen-scmconfig.c (SCM_SIZEOF_INTMAX, SCM_SIZEOF_SIZE_T): New.
586
03696aab
MV
587 * gen-scmconfig.h.in: Removed SCM_I_GSC_*_LIMITS macros, they are
588 no longer used.
589
590 * __scm.h (SCM_I_UTYPE_MAX, SCM_I_TYPE_MAX, SCM_I_TYPE_MIN,
591 SCM_I_SIZE_MAX, SCM_I_SSIZE_MIN, SCM_I_SSIZE_MAX): New.
592
593 * __scm.h, gen-scmconfig.c (SCM_I_LLONG_MAX, SCM_I_LLONG_MIN,
594 SCM_I_ULLONG_MAX, SCM_T_INT8_MIN, SCM_T_INT8_MAX, SCM_T_UINT8_MAX,
595 SCM_T_INT16_MIN, SCM_T_INT16_MAX, SCM_T_UINT16_MAX,
596 SCM_T_INT32_MIN, SCM_T_INT32_MAX, SCM_T_UINT32_MAX,
597 SCM_T_INT64_MIN, SCM_T_INT64_MAX, SCM_T_UINT64_MAX,
598 SCM_T_INTMAX_MIN, SCM_T_INTMAX_MAX, SCM_T_UINTMAX_MAX): Moved
599 definition into __scm.h, using new SCM_I_TYPE_MIN, etc.
600
601 * conv-integer.i.c, conv-uinteger.i.c: New files, used to generate
602 the functions below.
603
604 * Makefile.am (noinst_HEADERS): Added conv-integer.i.c and
605 conv-uinteger.i.c.
606
607 * numbers.c, numbers.h (scm_to_int8, scm_to_uint8, scm_to_int16,
608 scm_to_uint16, scm_to_int32, scm_to_uint32, scm_to_int64,
609 scm_to_uint64, scm_from_int8, scm_from_uint8, scm_from_int16,
610 scm_from_uint16, scm_from_int32, scm_from_uint32, scm_from_int64,
611 scm_from_uint64): Turned from macros into proper functions.
612 (scm_to_signed_integer, scm_to_unsigned_integer,
613 scm_from_signed_integer, scm_from_unsigned_integer): Generate via
614 conv-integer.i.c and conv-uinteger.i.c, as well.
615
616 * number.h (scm_to_ssize_t, scm_to_size_t): Use the new
617 SCM_I_SSIZE_MIN, SCM_I_SSIZE_MAX, and SCM_I_SIZE_MAX macros for
618 the limits. Those are always defined.
619
1f15779e
KR
6202004-07-29 Kevin Ryde <user42@zip.com.au>
621
622 * posix.c (scm_ttyname): Use scm_i_misc_mutex for thread safety.
623
48360eb3
KR
6242004-07-28 Kevin Ryde <user42@zip.com.au>
625
626 * posix.c (scm_ctermid): Use an L_ctermid buf on the stack, for thread
627 safety.
628
c3f3c841
KR
629 * unif.c (scm_array_set_x): For svect, use scm_num2short for
630 consistency with other vector types and to get arg and func name into
631 error message.
632
c82f8ed6
MV
6332004-07-27 Marius Vollmer <marius.vollmer@uni-dortmund.de>
634
635 * deprecated.h (SCM_FALSEP, SCM_NFALSEP, SCM_BOOLP, SCM_BOOL):
636 Reimplement using scm_is_false, scm_is_true, scm_is_bool, and
637 scm_from_bool, respectively.
638 (SCM_NINUMP): Added.
639
640 * tags.h, deprecated.h (SCM_EQ_P): Deprecated by moving it into
641 deprecated.h. Replaced all uses with scm_is_eq.
642
317b4c4a
KR
6432004-07-24 Kevin Ryde <user42@zip.com.au>
644
645 * threads.c, threads.h (scm_i_misc_mutex): New SCM_GLOBAL_MUTEX.
646 * posix.c (scm_crypt): Use it to protect static data in crypt().
647
e11e83f3
MV
6482004-07-23 Marius Vollmer <marius.vollmer@uni-dortmund.de>
649
650 * deprecated.h, deprecated.c, numbers.h (SCM_INUMP, SCM_NINUMP,
c82f8ed6 651 SCM_INUM): Deprecated by renaming them to SCM_I_INUMP,
e11e83f3
MV
652 SCM_I_NINUMP and SCM_I_INUM, respectively and adding deprecated
653 versions to deprecated.h and deprecated.c. Changed all uses to
654 either use the SCM_I_ variants or scm_is_*, scm_to_*, or
655 scm_from_*, as appropriate.
656
657 * dynwind.c (scm_i_dowinds): Removed unused code that would call
658 the unexisting scm_cross_dynwind_binding_scope for inums on the
659 windlist.
660
a55c2b68
MV
6612004-07-10 Marius Vollmer <marius.vollmer@uni-dortmund.de>
662
663 * socket.c (ipv6_net_to_num, scm_from_ipv6): Renamed
e11e83f3 664 ipv6_net_to_num to scm_from_ipv6, for converting from an IPv6
a55c2b68
MV
665 byte-wise address to a SCM integer. Changed all uses.
666 (ipv6_num_to_net, scm_to_ipv6): Renamed ipv6_num_to_net to
667 scm_to_ipv6 and added type and range checking, for converting from
668 an IPv& byte-wise address to a SCM integer. Changed all uses.
669 (bignum_in_ipv6_range_p, VALIDATE_INET6): Removed, their function
670 is now done by scm_to_ipv6.
671
672 * numbers.c (scm_to_signed_integer, scm_to_unsigned_integer): dot
673 not accept inexact integers.
674
675 * validate.h, deprecated.h (SCM_VALIDATE_INUM,
676 SCM_VALIDATE_INUM_COPY, SCM_VALIDATE_BIGINT,
677 SCM_VALIDATE_INUM_MIN, SCM_VALIDATE_INUM_MIN_COPY,
678 SCM_VALIDATE_INUM_MIN_DEF_COPY,SCM_VALIDATE_INUM_DEF,
679 SCM_VALIDATE_INUM_DEF_COPY, SCM_VALIDATE_INUM_RANGE,
680 SCM_VALIDATE_INUM_RANGE_COPY): Deprecated because they make the
681 fixnum/bignum distinction visible. Changed all uses to
682 scm_to_size_t or similar.
683
6842004-07-09 Marius Vollmer <marius.vollmer@uni-dortmund.de>
685
686 * cpp_cnvt.awk: Use scm_from_int instead of SCM_MAKINUM.
687
48a06bd5
KR
6882004-07-10 Kevin Ryde <user42@zip.com.au>
689
690 * hash.c (scm_hashq, scm_hashv, scm_hash): Restrict to size>=1 rather
691 than size>=0, since 0<=hash<size cannot be satisfied for size==0, and
692 such a size causes divide-by-zeros in scm_hasher.
693
052fbfd9
KR
694 * regex-posix.c (scm_make_regexp): Free rx on error, to avoid memory
695 leak.
696
43240c9c
MV
6972004-07-08 Marius Vollmer <marius.vollmer@uni-dortmund.de>
698
699 * numbers.c (scm_is_signed_integer, scm_is_unsigned_integer):
700 Rewritten using the same logic as scm_to_signed_integer and
701 scm_to_unsigned_integer, respectively, which is better(tm). Also,
702 use CHAR_BIT instead of hardcoding 8.
703 (LLONG_MIN, LLONG_MAX, ULLONG_MAX): Removed and used
704 SCM_I_LLONG_MIN etc. instead.
705
706 * numbers.h (SCM_MAKINUM, SCM_I_MAKINUM): Renamed SCM_MAKINUM to
707 SCM_I_MAKINUM and changed all uses.
708 * deprecated.h, deprecated.c (SCM_MAKINUM): Newly deprecated.
709
a3de8e7b
MV
710 * gen-scmconfig.c (SCM_I_LLONG_MIN, SCM_I_LLONG_MAX,
711 SCM_I_ULLONG_MAX): Instead of hard-coding the numbers, compute
43240c9c
MV
712 them by assuming twos-complement.
713
c9eb03bb
MV
7142004-07-07 Marius Vollmer <marius.vollmer@uni-dortmund.de>
715
716 * gen-scmconfig.h.in: Added all the new SCM_I_GSC_*_LIMITS that
717 configure now produces.
718 * gen-scmconfig.c: Use them to output SCM_T_INT8_MIN, etc
719 definitions, giving the limits of the integer types defined by
720 Guile. Also, output a hard coded SCM_I_LLONG_MIN, etc since
721 LLONG_MIN or LONG_LONG_MIN is hard to get at.
722
723 * numbers.h (scm_to_short, scm_to_ushort): It's SHRT_MIN, etc, not
724 SHORT_MIN.
725 (scm_to_size_t): Use SIZE_MAX instead of cooking our own.
726 (scm_to_long_long, scm_to_ulong_long, scm_to_int8, scm_to_uint8,
727 scm_to_int16, scm_to_uint16, scm_to_int32, scm_to_uint32,
728 scm_to_int64, scm_to_uint64, scm_to_intmax, scm_to_uintmax,
729 scm_from_long_long, scm_from_ulong_long, scm_from_int8,
730 scm_from_uint8, scm_from_int16, scm_from_uint16, scm_from_int32,
731 scm_from_uint32, scm_from_int64, scm_from_uint64, scm_from_intmax,
732 scm_from_uintmax): New.
733
7888309b
MV
7342004-07-06 Marius Vollmer <marius.vollmer@uni-dortmund.de>
735
736 * tags.h (scm_is_eq): New.
737
738 * deprecated.h, boolean.h (SCM_FALSEP, SCM_NFALSEP, SCM_BOOL,
739 SCM_NEGATE_BOOL, SCM_BOOLP): Deprecated by moving into
740 "deprecated.h". Replaced all uses with scm_is_false, scm_is_true,
741 scm_from_bool, and scm_is_bool, respectively.
742
743 * boolean.h (scm_is_bool): Fix bug in prototype.
744 (scm_from_bool): The argument is "x" not "f", stupid.
745
746 * boolean.c (scm_is_bool): Fix typo.
747
748 * numbers.h, numbers.c (scm_is_integer, scm_is_signed_integer,
749 scm_is_unsigned_integer, scm_to_signed_integer,
750 scm_to_unsigned_integer, scm_to_schar, scm_to_uchar, scm_to_char,
751 scm_to_short, scm_to_ushort, scm_to_long, scm_to_ulong,
752 scm_to_size_t, scm_to_ssize_t, scm_from_schar, scm_from_uchar,
753 scm_from_char, scm_from_short, scm_from_ushort, scm_from_int,
754 scm_from_uint, scm_from_long, scm_from_ulong, scm_from_size_t,
755 scm_from_ssize_t, scm_is_real, scm_to_double, scm_from_double):
756 New.
757
800570a6
MV
7582004-07-05 Marius Vollmer <marius.vollmer@uni-dortmund.de>
759
760 * boolean.h, boolean.c (scm_is_true, scm_is_false, scm_from_bool,
761 scm_to_bool): New.
762
9fcf3cbb
DH
7632004-06-27 Dirk Herrmann <dirk@dirk-herrmanns-seiten.de>
764
765 * backtrace.c (display_expression, display_frame): Call
766 scm_i_unmemoize_expr for unmemoizing a memoized object holding a
767 single memoized expression.
768
769 * debug.c (memoized_print): Don't try to unmemoize the memoized
770 object, since we can't know whether it holds a single expression
771 or a body.
772
773 (scm_mem_to_proc): Removed check for lambda expression, since it
774 was moot anyway. Whoever uses these functions for debugging
775 purposes should know what they do: Creating invalid memoized code
776 will cause crashes, independent of whether this check is present
777 or not.
778
779 (scm_proc_to_mem): Take the closure's code as it is and don't
780 append a SCM_IM_LAMBDA isym. To allow easier debugging, the
781 memoized code should not be modified.
782
783 * debug.[ch] (scm_unmemoize, scm_i_unmemoize_expr): Removed
784 scm_unmemoize from public use, but made scm_i_unmemoize_expr
785 available as a guile internal function instead. However,
786 scm_i_unmemoize_expr will only work on memoized objects that hold
787 a single memoized expression. It won't work with bodies.
788
789 * debug.c (scm_procedure_source), macros.c (macro_print), print.c
790 (scm_iprin1): Call scm_i_unmemocopy_body for unmemoizing a body,
791 i. e. a list of expressions.
792
793 * eval.c (unmemoize_exprs): Drop internal body markers from the
794 output during unmemoization.
795
796 * eval.[ch] (scm_unmemocopy, scm_i_unmemocopy_expr,
797 scm_i_unmemocopy_body): Removed scm_unmemocopy from public use,
798 but made scm_i_unmemocopy_expr and scm_i_unmemocopy_body available
799 as guile internal functions instead. scm_i_unmemoize_expr will
800 only work on a single memoized expression, while
801 scm_i_unmemocopy_body will only work on bodies.
802
90df793f
DH
8032004-06-21 Dirk Herrmann <dirk@dirk-herrmanns-seiten.de>
804
805 * eval.c (unmemoize_exprs): Handle semi-memoized code.
806
807 (scm_cons_source, scm_primitive_eval): Prefer higher level
808 predicate SCM_FALSEP over SCM_IMP.
809
8048c00b
RB
8102004-06-15 Rob Browning <rlb@defaultvalue.org>
811
812 * script.c (scm_shell_usage): minor phrasing change.
813
814 * gc_os_dep.c: update ifdefery for macosx.
815 (scm_get_stack_base): separate result initialization from
816 declaration to slience warnings with macosx and hp-ux using gcc
817