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