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