1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 11:50:28 +02:00
Commit graph

181 commits

Author SHA1 Message Date
Andy Wingo
2aed2667fc Merge remote-tracking branch 'origin/stable-2.0'
Conflicts:
	libguile/expand.c
	libguile/hashtab.c
	libguile/ports.c
	libguile/vectors.c
	libguile/weaks.c
	module/language/ecmascript/compile-tree-il.scm
	module/language/tree-il/effects.scm
	module/language/tree-il/fix-letrec.scm
	module/language/tree-il/peval.scm
	test-suite/tests/peval.test
2012-07-06 16:52:54 +02:00
Andy Wingo
5558cdaa30 add check for fchmod
* configure.ac: Add a check for fchmod.

* libguile/filesys.c (scm_chmod): Guard the fchmod case with
  HAVE_FCHMOD.
2012-07-06 11:01:51 +02:00
Andy Wingo
fc30e14ffe remove mkdir alias in filesys.c for mingw
* libguile/filesys.c (mkdir): Remove alias, as gnulib handles this for
  us.
2012-07-06 10:56:02 +02:00
Andy Wingo
74bbb99457 Merge remote-tracking branch 'origin/stable-2.0'
Conflicts:
	module/language/tree-il/analyze.scm
	module/language/tree-il/effects.scm
	module/language/tree-il/fix-letrec.scm
	module/language/tree-il/peval.scm
	test-suite/tests/cse.test
	test-suite/tests/peval.test
2012-05-21 19:20:27 +02:00
Ludovic Courtès
2ae7b7b6c3 Fix relative file name canonicalization with empty %LOAD-PATH entries.
* libguile/filesys.c (scm_i_relativize_path): Don't attempt to
  canonicalize when encountering an entry of IN_PATH that is the empty
  string.

* test-suite/tests/ports.test (with-load-path): New macro.
  ("%file-port-name-canonicalization"): New test prefix.
2012-05-15 19:05:37 +02:00
Andy Wingo
0858753e82 Merge remote-tracking branch 'origin/stable-2.0'
Conflicts:
	GUILE-VERSION
	libguile/gc-malloc.c
	libguile/ports.c
2012-02-08 11:48:08 +01:00
Bake Timmons
b7e64f8b26 Improve the usage of variable names in C docstrings.
* libguile/alist.c:
* libguile/array-map.c:
* libguile/arrays.c:
* libguile/bitvectors.c:
* libguile/filesys.c:
* libguile/foreign.c:
* libguile/generalized-arrays.c:
* libguile/hashtab.c:
* libguile/ioext.c:
* libguile/load.c:
* libguile/numbers.c:
* libguile/ports.c:
* libguile/posix.c:
* libguile/print.c:
* libguile/procprop.c:
* libguile/promises.c:
* libguile/simpos.c:
* libguile/socket.c:
* libguile/srfi-1.c:
* libguile/srfi-13.c:
* libguile/srfi-14.c:
* libguile/stacks.c:
* libguile/stime.c:
* libguile/strings.c:
* libguile/struct.c:
* libguile/symbols.c:
* libguile/threads.c:
* libguile/weak-table.c:
* libguile/weak-vector.c: Make the variable names in the C docstrings more
  consistent.  Replace a few instances of @var with @code when appropriate.
2012-02-02 12:22:10 +01:00
Andy Wingo
855db1905d Merge commit '9b0975f1dc'
Conflicts:
	libguile/foreign.c
	module/ice-9/psyntax-pp.scm
	module/ice-9/psyntax.scm
2012-01-30 18:25:07 +01:00
Ludovic Courtès
f0007cade0 Update Gnulib to v0.0-6827-g39c3009; use the `dirfd' module.
* m4/gnulib-cache.m4: Use `dirfd'.

* libguile/filesys.c: Include Gnulib's <dirent.h> directly.
  (dirfd): Remove.  Suggested by Bruno Haible <bruno@clisp.org>.
2012-01-16 23:49:21 +01:00
Andy Wingo
0607ebbfcf locking for putc, puts
* 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.
2011-11-08 00:55:05 +01:00
Andy Wingo
4251ae2e28 locking on port buffering operations
* libguile/ports.c (scm_fill_input_unlocked, scm_fill_input)
  (scm_end_input, scm_end_input_unlocked, scm_flush)
  (scm_flush_unlocked): Add locking and _unlocked variants.

* libguile/filesys.c:
* libguile/fports.c:
* libguile/gdbint.c:
* libguile/r6rs-ports.c:
* libguile/read.c:
* libguile/rw.c: Adapt callers to use _unlocked variants.
2011-11-08 00:55:01 +01:00
Ludovic Courtès
126a322431 Fix `open' mode bits on GNU/Hurd.
* libguile/filesys.c (scm_open): Fix check for read-write flags for
  systems such as GNU/Hurd, where O_RDWR == (O_WRONLY | O_RDONLY)
  and O_RDONLY != 0.
2011-07-13 00:02:00 +02:00
Ludovic Courtès
3565df4546 Define `O_NOTRANS' on GNU/Hurd.
* libguile/filesys.c (scm_init_filesys): Define `O_NOTRANS' when
  available.
2011-07-13 00:02:00 +02:00
Andy Wingo
1fa542989a HAVE_POSIX warning fix
* libguile/filesys.c (scm_dir_free, scm_dir_print): Don't compile when
  not HAVE_POSIX.
2011-06-30 11:32:09 +02:00
Andy Wingo
95643853d7 remove win32-dirent.[ch]
* libguile/win32-dirent.c:
* libguile/win32-dirent.h: Remove these files.  MinGW has opendir and
  readdir support, I hear.

* configure.ac:
* libguile/filesys.c:
* libguile/Makefile.am: Adapt.
2011-06-17 00:20:56 +02:00
Andy Wingo
19761af161 fix compile error in mingw fstat socket detection
* libguile/filesys.c (fstat_Win32) [__MINGW32__]: Apparently there is no
  _S_IFSOCK on mingw32.  Thanks to Volker Grabsch for the report.
2011-05-20 12:50:08 +02:00
Ludovic Courtès
d0476fa2b0 Compile more file system related procedures when `--disable-posix'.
* libguile/filesys.c (scm_tc16_dir, scm_directory_stream_p, scm_opendir,
  scm_readdir, scm_rewinddir, scm_closedir, scm_dir_print,
  scm_dir_free, scm_lstat): Compile unconditionally.
2011-04-25 22:52:00 +02:00
Ludovic Courtès
073167ef7b Allow compilation with `--disable-posix'.
Reported by Dmitry Dzhus <dima@dzhus.org>.

* configure.ac: Remove `AC_LIBOBJ([filesys])'.  Document
  `--disable-posix' as omitting non-essential POSIX interfaces.

* libguile/Makefile.am (libguile_@GUILE_EFFECTIVE_VERSION@_la_SOURCES):
  Add `filesys.c'.
  (DOT_DOC_FILES): Add `filesys.doc'.
  (EXTRA_libguile_@GUILE_EFFECTIVE_VERSION@_la_SOURCES): Remove
  `filesys.c'.

* libguile/posix.c (scm_mkstemp, scm_access): Move to `filesys.c'.
  (scm_init_posix): Move `R_OK' etc. to `filesys.c'.

* libguile/filesys.c (scm_chown, scm_chmod, scm_umask, scm_open_fdes,
  scm_open, scm_close, scm_close_fdes, scm_link, scm_tc16_dir,
  scm_directory_stream_p, scm_opendir, scm_readdir, scm_rewinddir,
  scm_closedir, scm_dir_print, scm_dir_free, scm_chdir, scm_getcwd,
  set_element, fill_select_type, get_element, retrieve_select_type,
  scm_select, scm_fcntl, scm_fsync, scm_symlink, scm_readlink,
  scm_lstat, scm_copy_file): Conditionalize on HAVE_POSIX.
  (scm_mkstemp, scm_access): New functions.
  (scm_init_filesys): Conditionalize `scm_tc16_dir', `O_RDONLY', etc. on
  HAVE_POSIX.  Define `R_OK', `W_OK', etc.

* libguile/fports.c (fport_print): Use `scm_ttyname' only when
  HAVE_POSIX.

* libguile/i18n.c (lock_locale_mutex, unlock_locale_mutex): New
  functions.  Update users of `scm_i_locale_mutex' to use them.

* libguile/init.c (scm_i_init_guile): Always call `scm_init_filesys'.

* meta/guile-tools.in (main): Use `setlocale' only when it is defined.

* module/ice-9/boot-9.scm: Always load `ice-9/posix'.
2011-04-15 00:09:16 +02:00
Andy Wingo
03976fee3b fix code that causes warnings on gcc 4.6
* 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.
2011-03-17 12:39:53 +01:00
Andy Wingo
22457d5730 filesystem trickery to scm_i_relativize_path in filesys.c; bugfix.
* 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.
2010-04-19 16:39:11 +02:00
Andy Wingo
427c73b9ca formatting fix
* libguile/filesys.c (scm_canonicalize_path): Format fix.
2010-04-19 13:12:26 +02:00
Andy Wingo
cd038da546 remove libguile/lang.h, deprecate %nil (in favor of #nil)
* libguile/Makefile.am:
* libguile/init.c:
* libguile/lang.c:
* libguile/lang.h: Remove lang.c and lang.h.

* libguile/pairs.h (SCM_NIL_P, SCM_NULL_OR_NIL_P): Moved here.

* module/ice-9/deprecated.scm (%nil): %nil definition moved here.

* libguile/alist.c:
* libguile/async.c:
* libguile/backtrace.c:
* libguile/boolean.c:
* libguile/dynl.c:
* libguile/eval.c:
* libguile/filesys.c:
* libguile/fluids.c:
* libguile/list.c:
* libguile/load.c:
* libguile/options.c:
* libguile/posix.c:
* libguile/print.c:
* libguile/promises.c:
* libguile/sort.c:
* libguile/throw.c:
* libguile/trees.c:
* libguile/vectors.c:
* libguile/vm.c:
* libguile/weaks.c:
* srfi/srfi-1.c: <libguile/lang.h> references removed.
2010-04-09 14:26:31 +02:00
Andy Wingo
06bfe276c8 nanosecond timestamp support in stat and utime
* 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.
2010-01-17 16:56:34 +01:00
Ludovic Courtès
1cd4fffcde Use Gnulib's `sys_stat' module; update Gnulib.
* .x-sc_prohibit_S_IS_definition: New file.

* m4/gnulib-cache.m4: Add `sys_stat'.

* libguile/filesys.c: Remove `S_IS*' macro definitions for Ultrix and
  MinGW.
2009-12-15 20:14:19 +01:00
Andy Wingo
b9ef8e66ee SCM_CELL in filesys.[ch]
* libguile/filesys.h (SCM_DIR_FLAG_OPEN, SCM_DIR_OPEN_P)
* libguile/filesys.c (scm_readdir, scm_rewinddir, scm_closedir)
  (scm_dir_print, scm_dir_free): Fix SCM_CELL macro usage.
2009-12-08 23:13:07 +01:00
Andy Wingo
f39448c5a3 remove a bunch of needless scm_permanent_object calls
* libguile/array-handle.c:
* libguile/bytevectors.c:
* libguile/deprecated.c:
* libguile/eval.c:
* libguile/feature.c:
* libguile/filesys.c:
* libguile/gc.c:
* libguile/gdbint.c:
* libguile/goops.c:
* libguile/instructions.c:
* libguile/load.c:
* libguile/modules.c:
* libguile/numbers.c:
* libguile/options.c:
* libguile/ports.c:
* libguile/scmsigs.c:
* libguile/srcprop.c:
* libguile/srfi-4.c:
* libguile/stacks.c:
* libguile/threads.c:
* libguile/vm.c: Remove calls to scm_permanent_object, as they are no
  longer needed with the BDW GC.
2009-12-05 11:32:50 +01:00
Ludovic Courtès
8912421cf3 Use Gnulib's inet_ntop' and inet_pton' modules.
* 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>.
2009-11-16 09:23:46 +01:00
Michael Gran
832bbc95a2 Use string accessors in scm_basename and scm_dirname
* libguile/filesys.c (basename, dirname): don't unpack strings.
  Use string accessor functions.
2009-08-20 22:40:15 -07:00
Andy Wingo
25b82b3485 new function: canonicalize-path. use when autocompiling
* 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.
2009-06-19 14:26:47 +02:00
Neil Jerram
53befeb700 Change Guile license to LGPLv3+
(Not quite finished, the following will be done tomorrow.
   module/srfi/*.scm
   module/rnrs/*.scm
   module/scripts/*.scm
   testsuite/*.scm
   guile-readline/*
)
2009-06-17 00:22:09 +01:00
Andy Wingo
fcb6f5ff33 add exception-on-error optional arg to `stat' in scheme
* 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.
2009-06-03 22:20:55 +02:00
Ludovic Courtès
dbb605f575 Include <config.h> in all C files; use #ifdef HAVE_CONFIG_H' rather than #if'. 2008-09-13 15:35:27 +02:00
Ludovic Courtès
417566ebc9 Never define _GNU_SOURCE' explicitly since AC_USE_SYSTEM_EXTENSIONS'
takes care of it.

Conflicts:

	ChangeLog
	configure.in
	libguile/eval.c
	libguile/srfi-14.c
	libguile/threads.c
2008-08-20 19:31:46 +02:00
Ludovic Courtès
f743909974 Changes from arch/CVS synchronization 2007-07-29 15:16:46 +00:00
Kevin Ryde
23d7256628 merge from 1.8 2007-01-15 23:42:45 +00:00
Kevin Ryde
8ab3d8a068 merge from 1.8 branch 2006-10-09 23:40:48 +00:00
Kevin Ryde
23f2b9a3de merge from 1.8 branch 2006-06-17 23:15:59 +00:00
Kevin Ryde
2b829bbb3d merge from 1.8 branch 2006-04-17 00:05:42 +00:00
Marius Vollmer
661ae7ab6b Renamed the "frames" that are related to dynamic-wind to "dynamic
contexts.  Renamed all functions from scm_frame_ to scm_dynwind_.
Updated documentation.
2006-01-29 00:23:28 +00:00
Marius Vollmer
92205699d0 The FSF has a new address. 2005-05-23 19:57:22 +00:00
Marius Vollmer
9de87eea47 See ChangeLog from 2005-03-02. 2005-03-02 20:42:01 +00:00
Marius Vollmer
4057a3e05a Use new vector elements API or simple vector API, as appropriate.
Removed SCM_HAVE_ARRAYS ifdefery.  Replaced all uses of
SCM_HASHTABLE_BUCKETS with SCM_HASHTABLE_BUCKET.
2005-01-02 20:49:04 +00:00
Marius Vollmer
0345e278f4 * variable.c, threads.c, struct.c, stackchk.c, smob.c, root.c,
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.
2004-10-22 15:13:12 +00:00
Marius Vollmer
d2e53ed6f8 *** empty log message *** 2004-09-22 17:41:37 +00:00
Kevin Ryde
464ee095ff (_POSIX_C_SOURCE): Use this only on hpux, it
causes too many problems elsewhere (glibc, freebsd, mingw).  Reported
by Andreas Vögele.
2004-09-08 22:14:59 +00:00
Stefan Jahn
edea856ce5 2004-09-03 Stefan Jahn <stefan@lkcc.org>
* 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.
2004-09-03 19:45:37 +00:00
Marius Vollmer
cc95e00ac6 * strings.h, strings.c: (scm_i_string_chars, scm_i_string_length,
scm_i_string_writable_chars, scm_i_string_stop_writing): New, to
replace SCM_I_STRING_CHARS and SCM_I_STRING_LENGTH.  Updated all
uses.
(scm_i_make_string, scm_c_make_string): New, to replace
scm_allocate_string.  Updated all uses.
(SCM_STRINGP, SCM_STRING_CHARS, SCM_STRING_UCHARS,
SCM_STRING_LENGTH): Deprecated.
(scm_allocate_string, scm_take_str, scm_take0str, scm_mem2string,
scm_str2string, scm_makfrom0str, scm_makfrom0str_opt):
Discouraged.  Replaced all uses with scm_from_locale_string or
similar, as appropriate.
(scm_c_string_length, scm_c_string_ref, scm_c_string_set_x,
scm_c_substring, scm_c_substring_shared, scm_c_substring_copy,
scm_substring_shared, scm_substring_copy): New.

* symbols.c, symbols.h (SCM_SYMBOLP, SCM_SYMBOL_FUNC,
SCM_SET_SYMBOL_FUNC, SCM_SYMBOL_PROPS, SCM_SET_SYMBOL_PROPS,
SCM_SYMBOL_HASH, SCM_SYMBOL_INTERNED_P, scm_mem2symbol,
scm_str2symbol, scm_mem2uninterned_symbol): Discouraged.
(SCM_SYMBOL_LENGTH, SCM_SYMBOL_CHARS, scm_c_symbol2str):
Deprecated.
(SCM_MAKE_SYMBOL_TAG, SCM_SET_SYMBOL_LENGTH, SCM_SET_SYMBOL_CHARS,
SCM_PROP_SLOTS, SCM_SET_PROP_SLOTS): Removed.
(scm_is_symbol, scm_from_locale_symbol, scm_from_locale_symboln):
New, to replace scm_str2symbol and scm_mem2symbol, respectively.
Updated all uses.
(scm_gensym): Generate only the number suffix in the buffer, just
string-append the prefix.
2004-08-19 17:19:44 +00:00
Marius Vollmer
1299a0f17b (STRING_SYSCALL, STRING2_SYSCALL): New helper macros.
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.
2004-08-12 17:32:07 +00:00
Marius Vollmer
7f9994d904 * stime.c, socket.c, simpos.c, procs.c, posix.c, ports.c,
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.
2004-08-10 14:08:02 +00:00
Kevin Ryde
37eb673bc6 (scm_copy_file): Use fstat on the input fd rather than
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.
2004-08-05 01:02:58 +00:00