As the FSF advises, 'There is no legal significance to using the
three-character sequence “(C)”, but it does no harm.' It does take up
space though! For that reason, we remove it here from our C files.
* libguile/stime.h (SCM_TIME_UNITS_PER_SECOND): Redefine to point to a C
variable instead of being a pure preprocessor thing. This has the
possibility to break existing compiled C extensions' interpretation of
the internal-time-units-per-second, but hopefully there's no too much
of that code out there, and in the worst case they can just
recompile. Scheme code will get it right without the need to
recompile.
* libguile/stime.c (TIME_UNITS_PER_SECOND): New local define, and
increase to nanosecond resolution if we are on a system in which this
is useful and practical.
(time_from_seconds_and_nanoseconds): New helper.
(get_internal_real_time, get_internal_run_time): New global vars:
function pointers.
(get_internal_real_time_posix_timer):
(get_internal_run_time_posix_timer):
(get_internal_real_time_gettimeofday):
(get_internal_run_time_times):
(get_internal_real_time_fallback): Various implementations.
(scm_get_internal_real_time): Return the get_internal_real_time()
result.
(scm_c_get_internal_run_time): Likewise.
(scm_gettimeofday): No need for a critical section, and remove
obsolete ftime block.
(scm_init_stime): Init all of the new time bases, and decide on
implementations of real time and run time accessors.
scm_get_internal_run_time but returns a long. it's used by the GC
for timekeeping, since with scm_get_internal_run_time there is a
(extremely theoretical) possibility of consing.
(scm_get_internal_run_time): redefined in terms of
scm_c_get_internal_run_time.
* stime.h: added prototype for scm_c_get_internal_run_time.
added append docs from R4RS.
* strings.c: Docstring typo fix, + eliminate unneeded IMP tests.
Thanks Dirk Hermann!
* chars.h: Provide SCM_CHARP, SCM_CHAR, SCM_MAKE_CHAR and
deprecate SCM_ICHRP, SCM_ICHR, SCM_MAKICHR. Thanks Dirk Hermann!
* *.h, *.c: Use SCM_CHARP, SCM_CHAR, SCM_MAKE_CHAR throughout.
Drop use of SCM_P for function prototypes... assume an ANSI C
compiler. Thanks Dirk Hermann!
* stime.c (scm_times): new procedure.
* ioext.c (scm_fseek): if the first argument is a file descriptor
call lseek.
(scm_ftell): if the first argument is a file descriptor call lseek
(sic).
* filesys.h: prototypes for scm_open_fdes, scm_fsync.
* filesys.c (scm_chmod): if the first argument is a file descriptor,
call fchmod.
(scm_chown): if the first argument is a port or file descriptor,
call fchown.
(scm_truncate_file): new procedure.
Add DEFER/ALLOW INTS to a few other procedures.
(scm_fsync): new procedure.
(scm_open_fdes): new procedure.
(scm_open): use scm_open_fdes. If mode isn't specified, 666 will
now be used.
(scm_fcntl): the first argument can now be a file descriptor. The
third argument is now optional.
* posix.c (scm_execl, scm_execlp): make the filename argument
compulsory, since omitting it causes SEGV.
(scm_sync): return unspecified instead of #f.
(scm_execle): new procedure.
(environ_list_to_c): new procedure.
(scm_environ): use environ_list_to_c. disable interrupts.
(scm_convert_exec_args): take pos and subr arguments and
improve error checking.
* boot-9.scm: define tms accessors: clock, utime, stime, cutime,
cstime.
* Makefile.am (EXTRA_libguile_la_SOURCES): add putenv.c.
* configure.in: move putenv from AC_CHECK_FUNCS to AC_REPLACE_FUNCS.
* putenv.c: new file, from sh-utils 1.12.
* posix.c (scm_environ): use malloc in place of scm_must_malloc
since allocation isn't for Scheme objects.
(scm_putenv): copy strings before placing in the environment.
* stime.c (scm_current_time): throw an error if time returns -1,
instead of returning #f.
(scm_get_internal_real_time, scm_get_internal_real_time): use
scm_long2num for return value instead of SCM_MAKINUM.
* stime.h: prototypes updated.
* stime.c (scm_time_in_msec): apparently unused, deleted.
* configure.in: check for gettimeofday.
* stime.c (scm_time_plus_ticks): new procedure, an scsh interface
which may be more usefully portable than a gettimeofday interface.
* stime.c (filltime): recovered static procedure.
(scm_localtime, scm_gmtime, scm_mktime, scm_tzset): recovered from
an earlier Guile.
* posix.h: add prototype for scm_close_pipe, remove prototypes for
scm_open_input_pipe, scm_open_output_pipe, change scm_mknod prototype.
* * posix.c (scm_mknod): split the mode argument into type and perms
arguments, like the extra fields returned by stat.
* fports.c (scm_pipob): set the close, free and print procedures.
(scm_close_pipe): new procedure.
* posix.c (scm_open_input_pipe, scm_open_output_pipe): deleted,
define them in boot-9.scm
main #include path; put most of them in a subdirectory called
'libguile'. This avoids naming conflicts between Guile header
files and system header files (of which there were a few).
* Makefile.in (pkgincludedir): Deleted.
(innerincludedir): New variable; this and $(includedir) are enough.
(INCLUDE_CFLAGS): Search for headers in "-I$(srcdir)/..".
(installed_h_files): Divide this up. Now this variable lists
those header files which should go into $(includedir) (i.e. appear
directly in the #include path), and ...
(inner_h_files): ... this new variable says which files appear in
a subdirectory, and are referred to as <libguile/mumble.h>.
(h_files): List them both.
(install): Create innerincludedir, not pkgincludedir. Put
the installed_h_files and inner_h_files in their proper places.
(uninstall): Corresponding changes.
* alist.h, append.h, arbiters.h, async.h, boolean.h, chars.h,
continuations.h, debug.h, dynwind.h, error.h, eval.h, fdsocket.h,
feature.h, fports.h, gc.h, genio.h, gsubr.h, hash.h, init.h,
ioext.h, kw.h, libguile.h, list.h, markers.h, marksweep.h,
mbstrings.h, numbers.h, options.h, pairs.h, ports.h, posix.h,
print.h, procprop.h, procs.h, ramap.h, read.h, root.h,
sequences.h, smob.h, socket.h, srcprop.h, stackchk.h, stime.h,
strings.h, strop.h, strorder.h, strports.h, struct.h, symbols.h,
tag.h, throw.h, unif.h, variable.h, vectors.h, version.h,
vports.h, weaks.h: Find __scm.h in its new location.
* __scm.h: Find scmconfig.h and tags.h in their new locations
(they're both "inner" files).