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