(scm_copy_file): Use fstat on the input fd rather than
[bpt/guile.git] / libguile / ChangeLog
CommitLineData
29e61124
KR
12004-08-05 Kevin Ryde <user42@zip.com.au>
2
3 * arbiters.c (scm_try_arbiter): Use scm_i_misc_mutex instead of
4 SCM_DEFER_INTS.
5 (scm_release_arbiter): Use scm_i_misc_mutex so return value can be
6 guaranteed if multiple threads compete to unlock.
7 Update docstrings per doc/ref/api-scheduling.texi.
8
9 * posix.c (scm_setgroups): Enhance docstring, per doc/ref/posix.texi.
10
11 * simpos.c (scm_system_star): Change scm_from_long to scm_from_int on
12 SIGINT and SIGQUIT, since those values are ints.
13
759aa8f9
MV
142004-08-03 Marius Vollmer <marius.vollmer@uni-dortmund.de>
15
7241f213
MV
16 * num2integral.i.c, num2float.i.c: Removed.
17 * Makefile.am (noinst_HEADERS): Updated.
18
f9656a9f
MV
19 * numbers.h. numbers.c (scm_make_ratio): Renamed to
20 scm_i_make_ratio and made static, replaced uses with scm_divide.
96d8c217
MV
21 (scm_complex_p): New, export as "complex?" to Scheme.
22 (scm_number_p): Export as "number?" to Scheme.
23 (scm_is_complex, scm_is_number): New.
24 (scm_c_make_rectangular, scm_c_make_polar): New.
25 (scm_make_rectangular, scm_make_polar): Use above.
26 (scm_c_real_part, scm_c_imag_part, scm_c_magnitude, scm_c_angle):
27 New.
28 (scm_make_complex): Discouraged by moving to discouraged.h and
29 discouraged.c. Replaced all uses with scm_c_make_rectangular.
30
759aa8f9
MV
31 * discouraged.h, discouraged.c, numbers.c, numbers.h
32 (scm_is_rational): New.
33 (scm_i_short2big, scm_i_int2big, scm_i_uint2big, scm_i_size2big,
34 scm_i_ptrdiff2big, scm_i_long_long2big, scm_i_ulong_long2big):
35 Removed prototypes.
36 (scm_make_real, scm_num2dbl, scm_float2num, scm_double2num):
37 Discouraged by moving to discouraged.h and discouraged.c.
38 Replaced all uses with scm_from_double.
39 (scm_num2float, scm_num2double): Discouraged by moving prototype
40 to discouraged.h and rewriting in terms of scm_to_double.
41 Replaced all uses with scm_to_double.
42 (scm_to_double): Do not implement in terms of scm_num2dbl, use
43 explicit code.
44 (scm_from_double): Do not implement in terms of scm_make_real, use
45 explicit code.
46
531bf3e6
MV
472004-08-02 Marius Vollmer <marius.vollmer@uni-dortmund.de>
48
759aa8f9
MV
49 * init.c (scm_init_guile_1): Call scm_i_init_discouraged.
50
531bf3e6
MV
51 * gen-scmconfig.h.in (SCM_I_GSC_ENABLE_DISCOURAGED): New.
52 * gen-scmconfig.c (SCM_ENABLE_DISCOURAGED): Emit based on above.
53
54 * eval.c (SCM_EVALIM, SCM_EVALIM2, SCM_XEVAL, SCM_XEVALCAR):
55 Renamed to SCM_I_* in order to avoid collisions with the versions
56 defined in deprecated.h.
57
58 * discouraged.h, discouraged.c: New files.
59
60 * deprecated.h (SCM_FALSEP, SCM_NFALSEP, SCM_BOOLP, SCM_EQ_P,
61 SCM_NEGATE_BOOL, SCM_BOOL, SCM_BOOT_NOT): Promoted from being
62 deprecated to being discouraged by moving to discouraged.h.
63
64 * numbers.h, numbers.c, discouraged.h, discouraged.c
65 (scm_short2num, scm_ushort2num, scm_int2num, scm_uint2num,
66 scm_long2num, scm_ulong2num, scm_size2num, scm_ptrdiff2num,
67 scm_num2short, scm_num2ushort, scm_num2int, scm_num2uint,
68 scm_num2long, scm_num2ulong, scm_num2size, scm_num2ptrdiff,
69 scm_long_long2num, scm_ulong_long2num, scm_num2long_long,
70 scm_num2ulong_long): Discouraged by moving to discouraged.h and
71 discouraged.c and reimplementing in terms of scm_from_* and
72 scm_to_*. Changed all uses to the new scm_from_* and scm_to_*
73 functions.
74
75 * numbers.h, numbers.c: Removed GUILE_DEBUG code.
76 (scm_i_short2big, scm_i_ushort2big, scm_i_int2big, scm_i_uint2big,
77 scm_i_size2big, scm_i_ptrdiff2big): Removed.
78 (scm_i_long2big, scm_i_ulong2big): New, explicit definitions.
79 * conv-integer.i.c, conv-uinteger.i.c: Use them instead of
80 explicit code.
81
5ec82e96
KR
822004-08-02 Kevin Ryde <user42@zip.com.au>
83
84 * __scm.h (SCM_DEFER_INTS, SCM_ALLOW_INTS): Add comments about past
85 and current usage and migration.
86
58f28989
KR
872004-07-31 Kevin Ryde <user42@zip.com.au>
88
89 * error.c (scm_strerror): Use scm_i_misc_mutex around strerror since
90 it's not thread safe.
91 (scm_syserror): Use scm_strerror rather than SCM_I_STRERROR, to take
92 advantage of this.
93 * fports.c (scm_open_file): Use scm_strerror likewise.
94 * filesys.c (scm_stat, scm_lstat): Ditto.
95
96 * filesys.c (scm_copy_file): Avoid fd leak when destination file
97 cannot be opened.
98
99 * symbols.c (scm_gensym): Use scm_i_misc_mutex around gensym_counter
100 update, for thread safety.
101 (gensym_counter): Move into scm_gensym which is its only user.
102 (scm_init_symbols): No need to explicitly initialize gensym_counter.
103
03696aab
MV
1042004-07-29 Marius Vollmer <marius.vollmer@uni-dortmund.de>
105
51fdb325
MV
106 * numbers.h (scm_to_schar, scm_to_uchar, scm_to_char,
107 scm_to_short, scm_to_ushort, scm_to_int, scm_to_uint, scm_to_long,
108 scm_to_ulong, scm_to_long_long, scm_to_ulong_long, scm_to_intmax,
109 scm_to_uintmax, scm_to_size_t, scm_to_ssize_t scm_from_schar,
110 scm_from_uchar, scm_from_char, scm_from_short, scm_from_ushort,
111 scm_from_int, scm_from_uint, scm_from_long, scm_from_ulong,
112 scm_from_long_long, scm_from_ulong_long, scm_from_intmax,
113 scm_from_uintmax, scm_from_size_t, scm_from_ssize_t): No longer
114 defined in terms of scm_to_signed_integer, etc, but in terms of
115 scm_to_int8, etc.
116
117 * gen-scmconfig.c (SCM_SIZEOF_INTMAX, SCM_SIZEOF_SIZE_T): New.
118
03696aab
MV
119 * gen-scmconfig.h.in: Removed SCM_I_GSC_*_LIMITS macros, they are
120 no longer used.
121
122 * __scm.h (SCM_I_UTYPE_MAX, SCM_I_TYPE_MAX, SCM_I_TYPE_MIN,
123 SCM_I_SIZE_MAX, SCM_I_SSIZE_MIN, SCM_I_SSIZE_MAX): New.
124
125 * __scm.h, gen-scmconfig.c (SCM_I_LLONG_MAX, SCM_I_LLONG_MIN,
126 SCM_I_ULLONG_MAX, SCM_T_INT8_MIN, SCM_T_INT8_MAX, SCM_T_UINT8_MAX,
127 SCM_T_INT16_MIN, SCM_T_INT16_MAX, SCM_T_UINT16_MAX,
128 SCM_T_INT32_MIN, SCM_T_INT32_MAX, SCM_T_UINT32_MAX,
129 SCM_T_INT64_MIN, SCM_T_INT64_MAX, SCM_T_UINT64_MAX,
130 SCM_T_INTMAX_MIN, SCM_T_INTMAX_MAX, SCM_T_UINTMAX_MAX): Moved
131 definition into __scm.h, using new SCM_I_TYPE_MIN, etc.
132
133 * conv-integer.i.c, conv-uinteger.i.c: New files, used to generate
134 the functions below.
135
136 * Makefile.am (noinst_HEADERS): Added conv-integer.i.c and
137 conv-uinteger.i.c.
138
139 * numbers.c, numbers.h (scm_to_int8, scm_to_uint8, scm_to_int16,
140 scm_to_uint16, scm_to_int32, scm_to_uint32, scm_to_int64,
141 scm_to_uint64, scm_from_int8, scm_from_uint8, scm_from_int16,
142 scm_from_uint16, scm_from_int32, scm_from_uint32, scm_from_int64,
143 scm_from_uint64): Turned from macros into proper functions.
144 (scm_to_signed_integer, scm_to_unsigned_integer,
145 scm_from_signed_integer, scm_from_unsigned_integer): Generate via
146 conv-integer.i.c and conv-uinteger.i.c, as well.
147
148 * number.h (scm_to_ssize_t, scm_to_size_t): Use the new
149 SCM_I_SSIZE_MIN, SCM_I_SSIZE_MAX, and SCM_I_SIZE_MAX macros for
150 the limits. Those are always defined.
151
1f15779e
KR
1522004-07-29 Kevin Ryde <user42@zip.com.au>
153
154 * posix.c (scm_ttyname): Use scm_i_misc_mutex for thread safety.
155
48360eb3
KR
1562004-07-28 Kevin Ryde <user42@zip.com.au>
157
158 * posix.c (scm_ctermid): Use an L_ctermid buf on the stack, for thread
159 safety.
160
c3f3c841
KR
161 * unif.c (scm_array_set_x): For svect, use scm_num2short for
162 consistency with other vector types and to get arg and func name into
163 error message.
164
c82f8ed6
MV
1652004-07-27 Marius Vollmer <marius.vollmer@uni-dortmund.de>
166
167 * deprecated.h (SCM_FALSEP, SCM_NFALSEP, SCM_BOOLP, SCM_BOOL):
168 Reimplement using scm_is_false, scm_is_true, scm_is_bool, and
169 scm_from_bool, respectively.
170 (SCM_NINUMP): Added.
171
172 * tags.h, deprecated.h (SCM_EQ_P): Deprecated by moving it into
173 deprecated.h. Replaced all uses with scm_is_eq.
174
317b4c4a
KR
1752004-07-24 Kevin Ryde <user42@zip.com.au>
176
177 * threads.c, threads.h (scm_i_misc_mutex): New SCM_GLOBAL_MUTEX.
178 * posix.c (scm_crypt): Use it to protect static data in crypt().
179
e11e83f3
MV
1802004-07-23 Marius Vollmer <marius.vollmer@uni-dortmund.de>
181
182 * deprecated.h, deprecated.c, numbers.h (SCM_INUMP, SCM_NINUMP,
c82f8ed6 183 SCM_INUM): Deprecated by renaming them to SCM_I_INUMP,
e11e83f3
MV
184 SCM_I_NINUMP and SCM_I_INUM, respectively and adding deprecated
185 versions to deprecated.h and deprecated.c. Changed all uses to
186 either use the SCM_I_ variants or scm_is_*, scm_to_*, or
187 scm_from_*, as appropriate.
188
189 * dynwind.c (scm_i_dowinds): Removed unused code that would call
190 the unexisting scm_cross_dynwind_binding_scope for inums on the
191 windlist.
192
a55c2b68
MV
1932004-07-10 Marius Vollmer <marius.vollmer@uni-dortmund.de>
194
195 * socket.c (ipv6_net_to_num, scm_from_ipv6): Renamed
e11e83f3 196 ipv6_net_to_num to scm_from_ipv6, for converting from an IPv6
a55c2b68
MV
197 byte-wise address to a SCM integer. Changed all uses.
198 (ipv6_num_to_net, scm_to_ipv6): Renamed ipv6_num_to_net to
199 scm_to_ipv6 and added type and range checking, for converting from
200 an IPv& byte-wise address to a SCM integer. Changed all uses.
201 (bignum_in_ipv6_range_p, VALIDATE_INET6): Removed, their function
202 is now done by scm_to_ipv6.
203
204 * numbers.c (scm_to_signed_integer, scm_to_unsigned_integer): dot
205 not accept inexact integers.
206
207 * validate.h, deprecated.h (SCM_VALIDATE_INUM,
208 SCM_VALIDATE_INUM_COPY, SCM_VALIDATE_BIGINT,
209 SCM_VALIDATE_INUM_MIN, SCM_VALIDATE_INUM_MIN_COPY,
210 SCM_VALIDATE_INUM_MIN_DEF_COPY,SCM_VALIDATE_INUM_DEF,
211 SCM_VALIDATE_INUM_DEF_COPY, SCM_VALIDATE_INUM_RANGE,
212 SCM_VALIDATE_INUM_RANGE_COPY): Deprecated because they make the
213 fixnum/bignum distinction visible. Changed all uses to
214 scm_to_size_t or similar.
215
2162004-07-09 Marius Vollmer <marius.vollmer@uni-dortmund.de>
217
218 * cpp_cnvt.awk: Use scm_from_int instead of SCM_MAKINUM.
219
48a06bd5
KR
2202004-07-10 Kevin Ryde <user42@zip.com.au>
221
222 * hash.c (scm_hashq, scm_hashv, scm_hash): Restrict to size>=1 rather
223 than size>=0, since 0<=hash<size cannot be satisfied for size==0, and
224 such a size causes divide-by-zeros in scm_hasher.
225
052fbfd9
KR
226 * regex-posix.c (scm_make_regexp): Free rx on error, to avoid memory
227 leak.
228
43240c9c
MV
2292004-07-08 Marius Vollmer <marius.vollmer@uni-dortmund.de>
230
231 * numbers.c (scm_is_signed_integer, scm_is_unsigned_integer):
232 Rewritten using the same logic as scm_to_signed_integer and
233 scm_to_unsigned_integer, respectively, which is better(tm). Also,
234 use CHAR_BIT instead of hardcoding 8.
235 (LLONG_MIN, LLONG_MAX, ULLONG_MAX): Removed and used
236 SCM_I_LLONG_MIN etc. instead.
237
238 * numbers.h (SCM_MAKINUM, SCM_I_MAKINUM): Renamed SCM_MAKINUM to
239 SCM_I_MAKINUM and changed all uses.
240 * deprecated.h, deprecated.c (SCM_MAKINUM): Newly deprecated.
241
a3de8e7b
MV
242 * gen-scmconfig.c (SCM_I_LLONG_MIN, SCM_I_LLONG_MAX,
243 SCM_I_ULLONG_MAX): Instead of hard-coding the numbers, compute
43240c9c
MV
244 them by assuming twos-complement.
245
c9eb03bb
MV
2462004-07-07 Marius Vollmer <marius.vollmer@uni-dortmund.de>
247
248 * gen-scmconfig.h.in: Added all the new SCM_I_GSC_*_LIMITS that
249 configure now produces.
250 * gen-scmconfig.c: Use them to output SCM_T_INT8_MIN, etc
251 definitions, giving the limits of the integer types defined by
252 Guile. Also, output a hard coded SCM_I_LLONG_MIN, etc since
253 LLONG_MIN or LONG_LONG_MIN is hard to get at.
254
255 * numbers.h (scm_to_short, scm_to_ushort): It's SHRT_MIN, etc, not
256 SHORT_MIN.
257 (scm_to_size_t): Use SIZE_MAX instead of cooking our own.
258 (scm_to_long_long, scm_to_ulong_long, scm_to_int8, scm_to_uint8,
259 scm_to_int16, scm_to_uint16, scm_to_int32, scm_to_uint32,
260 scm_to_int64, scm_to_uint64, scm_to_intmax, scm_to_uintmax,
261 scm_from_long_long, scm_from_ulong_long, scm_from_int8,
262 scm_from_uint8, scm_from_int16, scm_from_uint16, scm_from_int32,
263 scm_from_uint32, scm_from_int64, scm_from_uint64, scm_from_intmax,
264 scm_from_uintmax): New.
265
7888309b
MV
2662004-07-06 Marius Vollmer <marius.vollmer@uni-dortmund.de>
267
268 * tags.h (scm_is_eq): New.
269
270 * deprecated.h, boolean.h (SCM_FALSEP, SCM_NFALSEP, SCM_BOOL,
271 SCM_NEGATE_BOOL, SCM_BOOLP): Deprecated by moving into
272 "deprecated.h". Replaced all uses with scm_is_false, scm_is_true,
273 scm_from_bool, and scm_is_bool, respectively.
274
275 * boolean.h (scm_is_bool): Fix bug in prototype.
276 (scm_from_bool): The argument is "x" not "f", stupid.
277
278 * boolean.c (scm_is_bool): Fix typo.
279
280 * numbers.h, numbers.c (scm_is_integer, scm_is_signed_integer,
281 scm_is_unsigned_integer, scm_to_signed_integer,
282 scm_to_unsigned_integer, scm_to_schar, scm_to_uchar, scm_to_char,
283 scm_to_short, scm_to_ushort, scm_to_long, scm_to_ulong,
284 scm_to_size_t, scm_to_ssize_t, scm_from_schar, scm_from_uchar,
285 scm_from_char, scm_from_short, scm_from_ushort, scm_from_int,
286 scm_from_uint, scm_from_long, scm_from_ulong, scm_from_size_t,
287 scm_from_ssize_t, scm_is_real, scm_to_double, scm_from_double):
288 New.
289
800570a6
MV
2902004-07-05 Marius Vollmer <marius.vollmer@uni-dortmund.de>
291
292 * boolean.h, boolean.c (scm_is_true, scm_is_false, scm_from_bool,
293 scm_to_bool): New.
294
9fcf3cbb
DH
2952004-06-27 Dirk Herrmann <dirk@dirk-herrmanns-seiten.de>
296
297 * backtrace.c (display_expression, display_frame): Call
298 scm_i_unmemoize_expr for unmemoizing a memoized object holding a
299 single memoized expression.
300
301 * debug.c (memoized_print): Don't try to unmemoize the memoized
302 object, since we can't know whether it holds a single expression
303 or a body.
304
305 (scm_mem_to_proc): Removed check for lambda expression, since it
306 was moot anyway. Whoever uses these functions for debugging
307 purposes should know what they do: Creating invalid memoized code
308 will cause crashes, independent of whether this check is present
309 or not.
310
311 (scm_proc_to_mem): Take the closure's code as it is and don't
312 append a SCM_IM_LAMBDA isym. To allow easier debugging, the
313 memoized code should not be modified.
314
315 * debug.[ch] (scm_unmemoize, scm_i_unmemoize_expr): Removed
316 scm_unmemoize from public use, but made scm_i_unmemoize_expr
317 available as a guile internal function instead. However,
318 scm_i_unmemoize_expr will only work on memoized objects that hold
319 a single memoized expression. It won't work with bodies.
320
321 * debug.c (scm_procedure_source), macros.c (macro_print), print.c
322 (scm_iprin1): Call scm_i_unmemocopy_body for unmemoizing a body,
323 i. e. a list of expressions.
324
325 * eval.c (unmemoize_exprs): Drop internal body markers from the
326 output during unmemoization.
327
328 * eval.[ch] (scm_unmemocopy, scm_i_unmemocopy_expr,
329 scm_i_unmemocopy_body): Removed scm_unmemocopy from public use,
330 but made scm_i_unmemocopy_expr and scm_i_unmemocopy_body available
331 as guile internal functions instead. scm_i_unmemoize_expr will
332 only work on a single memoized expression, while
333 scm_i_unmemocopy_body will only work on bodies.
334
90df793f
DH
3352004-06-21 Dirk Herrmann <dirk@dirk-herrmanns-seiten.de>
336
337 * eval.c (unmemoize_exprs): Handle semi-memoized code.
338
339 (scm_cons_source, scm_primitive_eval): Prefer higher level
340 predicate SCM_FALSEP over SCM_IMP.
341
8048c00b
RB
3422004-06-15 Rob Browning <rlb@defaultvalue.org>
343
344 * script.c (scm_shell_usage): minor phrasing change.
345
346 * gc_os_dep.c: update ifdefery for macosx.
347 (scm_get_stack_base): separate result initialization from
348 declaration to slience warnings with macosx and hp-ux using gcc
349