* m4/gnulib-cache.m4: Use `dirfd'.
* libguile/filesys.c: Include Gnulib's <dirent.h> directly.
(dirfd): Remove. Suggested by Bruno Haible <bruno@clisp.org>.
* libguile/ports.c (scm_putc, scm_puts):
* libguile/ports.h (scm_putc_unlocked, scm_puts_unlocked): Separate into
_unlocked and locked variants. Change all callers to use the
_unlocked versions.
* libguile/arrays.c (scm_i_read_array):
* libguile/backtrace.c (display_backtrace_body):
* libguile/filesys.c (scm_readdir)
* libguile/i18n.c (chr_to_case):
* libguile/ports.c (register_finalizer_for_port):
* libguile/posix.c (scm_nice):
* libguile/stacks.c (scm_make_stack): Clean up a number of
set-but-unused vars. Thanks to Douglas Mencken for the report.
* libguile/numbers.c (scm_log, scm_exp): Fix a few #if cases that should
be #ifdef.
* libguile/filesys.h:
* libguile/filesys.c (scm_i_relativize_path): New function, moved here
from fports.c. Internal for now; we can make it external though if
people like its interface.
* libguile/fports.c (fport_canonicalize_filename): Move all of the
tricky bits to filesys.c. Also fixes a bug in which a delimiter wasn't
stripped.
* libguile/posix.h:
* libguile/posix.c (scm_utime): Add optional nanosecond arguments. This
is an incompatible change on the C level, but it's unlikely people are
using this POSIX wrapper function, because they would just use the
POSIX function directly. Hopefully, anyway.
* module/system/base/compile.scm (call-with-output-file/atomic):
Propagate source timestamps to targets with nanosecond precision, if
available. Fixes build on systems with ext4 filesystems.
* libguile/filesys.c (scm_stat2scm):
* module/ice-9/posix.scm (stat:atimensec, stat:mtimensec)
(stat:ctimensec): Add three new elements to Scheme stat structures,
for nanosecond-level timestamps.
* configure.ac: Add checks for utimensat, and for nanosecond fields in
struct stat. We should switch to using Gnulib things for these,
though.
* doc/ref/posix.texi (File System): Add documentation for utime's
additional arguments, and nanosecond stat timestamp accessors.
* m4/gnulib-cache.m4: Add `inet_ntop' and `inet_pton'.
* configure.ac: Don't check for `inet_ntop' and `inet_pton'.
* libguile/socket.c (scm_inet_pton, scm_inet_ntop): Compile regardless
of `HAVE_INET_PTON' and `HAVE_INET_NTOP' respectively.
* libguile/filesys.c: Use <stdlib.h> instead of <canonicalize.h>.
* libguile/filesys.h:
* libguile/filesys.c (scm_canonicalize_path): New function,
canonicalize-path.
* module/system/base/compile.scm (compiled-file-name): Canonicalize the
filename so that compiling e.g. ../foo.scm doesn't compile to
~/.guile-ccache/1.9/../foo.scm.
* libguile/filesys.h:
* libguile/filesys.c (scm_stat): Add optional arg, exception-on-error,
which if #f (not the default) will just return #f instead of raising an
exception if the stat fails.
print.c, ports.c, mallocs.c, hooks.c, hashtab.c, fports.c,
guardians.c, filesys.c, coop-pthreads.c, continuations.c: Use
scm_uintprint to print unsigned integers, raw heap words, and
adresses, using a cast to scm_t_bits to turn pointers into
integers.
* configure.in (isinf): Let configure find the isinf() function
on MinGW32 systems.
2004-09-03 Stefan Jahn <stefan@lkcc.org>
* threads.c (scm_threads_mark_stacks): Fixed local variable
definitions.
* strings.c (scm_i_substring_copy, s_scm_string_append): Fixed
local variable definitions.
* stime.c (_POSIX_C_SOURCE): Do not define this item on
MinGW32 because it conflicts with its pthread headers.
(s_scm_mktime): Consider the HAVE_STRUCT_TM_TM_ZONE define.
(s_scm_strftime): Using scm_from_locale_string() instead of
scm_makfrom0str().
* posix.c (s_scm_putenv): Fixed typo in the !HAVE_UNSETENV
part.
* numbers.c (scm_init_numbers): Removed check_sanity() call
inside GUILE_DEBUG. The function has been removed somewhen...
* filesys.c (_POSIX_C_SOURCE): Do not define this item on
MinGW32 because it conflicts with its pthread headers.
2004-09-03 Stefan Jahn <stefan@lkcc.org>
* srfi-1.c, srfi-1.h: Renamed any 'lst1' into 'list1' because
lst1 is a #define on Win32 systems.
Use them instead of SCM_SYSCALL when one or two strings need to be
converted into locale strings.
(my_rename): New, gathers platform dependent code for renaming.
(scm_rename): Use it.
(scm_readlink, scm_copy_file): Convert SCM strings to locale
strings instead of accessing their internals.
(scm_basename, scm_dirname): Use SCM_I_STRING_CHARS and
SCM_I_STRING_LENGTH instead of SCM_STRING_CHARS and
SCM_STRING_LENGTH.
net_db.c, fports.c, filesys.c, eval.c, deprecation.c, dynl.c:
Replaced uses of SCM_STRING_CHARS with proper uses of
scm_to_locale_string. Replaced SCM_STRINGP with scm_is_string.
Replaced scm_mem2string with scm_from_locale_string.
* simpos.c, posix.c (allocate_string_pointers, environ_list_to_c):
Removed, replaced all uses with scm_i_allocate_string_pointers.
stat on the filename, to be certain a file rename can't mean we get
info on one filesystem object but open another. This fstat usage is
similar to Emacs copy-file.
Discouraged by moving to discouraged.h and discouraged.c.
Replaced all uses with scm_from_double.
(scm_num2float, scm_num2double): Discouraged by moving prototype
to discouraged.h and rewriting in terms of scm_to_double.
Replaced all uses with scm_to_double.
scm_ushort2num, scm_int2num, scm_uint2num, scm_long2num,
scm_ulong2num, scm_size2num, scm_ptrdiff2num, scm_num2short,
scm_num2ushort, scm_num2int, scm_num2uint, scm_num2long,
scm_num2ulong, scm_num2size, scm_num2ptrdiff, scm_long_long2num,
scm_ulong_long2num, scm_num2long_long, scm_num2ulong_long):
Discouraged by moving to discouraged.h and discouraged.c and
reimplementing in terms of scm_from_* and scm_to_*. Changed all uses
to the new scm_from_* and scm_to_* functions.
it's not thread safe.
(scm_syserror): Use scm_strerror rather than SCM_I_STRERROR, to take
advantage of this.
* fports.c (scm_open_file): Use scm_strerror likewise.
* filesys.c (scm_stat, scm_lstat): Ditto.