summaryrefslogtreecommitdiff
path: root/libguile/filesys.c
AgeCommit message (Collapse)AuthorFilesLines
2001-04-10* Avoid redundant casting of argument numbers to char* and vice versa.Dirk Herrmann1-4/+4
2001-04-03Correct, update, improve and clean up a lot of docstrings in order to makeMartin Grabmüller1-27/+32
the documentation much more consistent.
2001-03-11Use SCM_LISTn instead of scm_listify.Keisuke Nishida1-12/+7
2001-03-10* _scm.h: Removed #include <errno.h>.Mikael Djurfeldt1-1/+3
* error.c, net_db.c, putenv.c, stime.c: Removed declaration of errno variable (can be a macro on some systems, for example when using linux libc with threads). * error.c, filesys.c, gc.c, ioext.c, iselect.c, net_db.c, ports.c, posix.c, print.c, putenv.c, scmsigs.c, script.c, simpos.c, smob.c, socket.c, srcprop.c, stime.c, strop.c, unif.c, vports.c: Added #include <errno.h> in these 20 out of 100 files.
2001-02-16(scm_dirname, scm_basename): Added docstrings.Martin Grabmüller1-2/+7
2001-02-02New functions: scm_c_make_vector, scm_c_make_hash_table.Keisuke Nishida1-1/+1
2001-01-24 * boot-9.scm: don't import (ice-9 rdelim) here. it's doneGary Houston1-5/+7
in C for now. * rdelim.scm: export the C primitives too. * documentation.scm: use (ice-9 rdelim). * filesys.c (scm_link): docstring fix. * fports.h (scm_setfileno): obsolete declaration removed. * posix.c: bogus popen declaration removed. * rdelim.c: new file, split from ioext.c with new proc scm_init_rdelim. * rdelim.h: new file. * Makefile.am: add rdelim.c and related files. * init.c: call scm_init_rdelim. include rdelim.h.
2001-01-24* Separate the handling of OPEN flags between ports and directories.Dirk Herrmann1-18/+28
2000-12-08Smob-related creanup.Keisuke Nishida1-3/+4
2000-11-22* Deprecated macros SCM_ROCHARS and SCM_ROUCHARS.Dirk Herrmann1-3/+3
2000-11-17* alist.c, arbiters.c, async.c, backtrace.c, boolean.c, chars.c,Marius Vollmer1-0/+2
continuations.c, debug-malloc.c, debug.c, dynl.c, dynwind.c, environments.c, eq.c, error.c, eval.c, evalext.c, feature.c, filesys.c, fluids.c, fports.c, gc.c, goops.c, guardians.c, hash.c, hashtab.c, hooks.c, ioext.c, iselect.c, keywords.c, lang.c, list.c, load.c, macros.c, modules.c, net_db.c, numbers.c, objects.c, objprop.c, options.c, pairs.c, ports.c, posix.c, print.c, procprop.c, procs.c, properties.c, ramap.c, random.c, read.c, regex-posix.c, root.c, scmsigs.c, script.c, simpos.c, socket.c, sort.c, srcprop.c, stackchk.c, stacks.c, stime.c, strings.c, strop.c, strorder.c, strports.c, struct.c, symbols.c, tag.c, threads.c, throw.c, unif.c, variable.c, vectors.c, version.c, vports.c, weaks.c: Makes sure the snarfer output inclusion is disabled when the snarfer is run on the file. Thanks to Lars J. Aas! * Makefile.am: Install guile-procedures.txt in version-specific directory to enable multiple installed guile versions. Suggested by Karl M. Hegbloom <karlheg@debian.org, patch by Matthias Koeppe.
2000-11-072000-11-07 Gary Houston <ghouston@arglist.com>Gary Houston1-0/+20
* ports.c (scm_port_for_each): new proc. implements port-for-each, which applies a procedure to each port in the port table. ports.h: declare scm_port_for_each. * ioext.c (scm_dup2): new proc. implements "dup2" which is a simple wrapper for the dup2 system call (unlike dup->fdes or primitive-move->fdes). * ioext.h: declare scm_dup2. * filesys.c (scm_close_fdes): new proc. implements "close-fdes" which is a simple wrapper for close system call (unlike scm_close). * filesys.h: declare for scm_close_fdes.
2000-10-30* Change a couple of functions to accept either symbols or strings only.Dirk Herrmann1-65/+59
* Get rid of remainig uses of SCM_LENGTH etc.
2000-10-25* Some more work to get rid of SCM_LENGTHDirk Herrmann1-10/+8
* Eliminated some cell type bit fiddling * Various minor changes
2000-10-09* Made some functions not accept symbols as input parameters any more.Dirk Herrmann1-16/+18
* Replaced some calls to SCM_LENGTH.
2000-09-30 * filesys.c (scm_stat2scm), posix.c (s_scm_mknod): don't useGary Houston1-0/+2
S_ISSOCK or S_IFSOCK if not defined. thanks to Bruce Korb.
2000-08-18* filesys.c (scm_fcntl): Docstring fix - missing newlines inserted.Neil Jerram1-2/+2
2000-05-18* Unified some rest argument checking and handling.Dirk Herrmann1-7/+7
2000-04-21* Makefile.am (DEFS): Added. automake adds -I options to DEFS,Mikael Djurfeldt1-10/+10
and we don't want that. (INCLUDES): Removed all -I options except for the root source directory and the root build directory. * *.*: Change includes so that they always use the "prefixes" libguile/, qt/, guile-readline/, or libltdl/. (Thanks to Tim Mooney.)
2000-04-04Lots of fixes with respect to strict typing.Dirk Herrmann1-9/+9
2000-03-19 * *.[hc]: add Emacs magic at the end of file, to ensure GNUMichael Livshin1-0/+6
indentation style.
2000-03-17Only include strings.h where it is actually needed.Dirk Herrmann1-0/+1
2000-03-17Only include vectors.h in those files, where it is actually needed.Dirk Herrmann1-0/+1
2000-03-17Removed empty file genio.h and references to it.Dirk Herrmann1-1/+0
2000-03-09*.[ch]: make a distinction between SCM as a genericGreg J. Badros1-1/+1
name for a Scheme object (now a void*), and SCM as 32 bit word for storing tags and immediates (now a long int). Introduced SCM_ASWORD and SCM_ASSCM for conversion. Fixed various dubious code in the process: arbiter.c (use macros), unif.c (scm_array_p),
2000-03-03* error.h, error.c: Added `scm_wrong_type_arg_msg' to supportGreg J. Badros1-1/+1
displaying the expected type. Use SCM_LISTn in a couple places instead of scm_cons-ing by hand. * __scm.h: Added SCM_ASSERT_TYPE macro. * validate.h, scm_validate.h: Added the former, as a renamed version of the latter with SCM_ASSERT_TYPE used in SCM_MAKE_VALIDATE (instead of just SCM_ASSERT) * Makefile.am: Rename scm_validate.h to validate.h. * *.c, *.h: Include validate.h, not scm_validate.h (old name's prefix was superfluous).
2000-01-31 * strings.h: don't use SCM_P. don't include <string.h>.Gary Houston1-2/+2
* error.c, gh_data.c, ports.c, script.c, strop.c: include <string.h>. * strings.c (scm_string_ref): make the 2nd argument compulsory. previously it defaulted to zero for no good reason that I can see. use a local variable for SCM_INUM (k). replace SCM_VALIDATE_INUM_DEF with SCM_VALIDATE_INUM_COPY. (scm_makfromstr): cosmetic changes. (scm_string): Accept only chars in the list, not strings, for conformance to R5RS (particularly for list->string, which is supposed to be the inverse of string->list.) remove SCM_DEFER_INTS/SCM_ALLOW_INTS, which is unnecessary since scm_makstr handles the cell allocation. when reporting wrong-type arg, don't report the position as 1. * posix.c (scm_init_posix): intern PIPE_BUF if it's defined. * boot-9.scm (find-and-link-dynamic-module): pass strings, not symbols, to string-append.
2000-01-29 * posix.c (scm_pipe): rewrote the docstring.Gary Houston1-9/+10
(and fixed a bug in the scm_select change)
2000-01-29 * filesys.c (scm_select, retrieve_select_type, get_element,Gary Houston1-91/+189
fill_select_type, set_element): modified so that Scheme "select" tests port buffers for the ability to provide input or accept output. Previously only the underlying file descriptors were checked. Rewrote the docstring. * expect.scm (expect): don't call char-ready? before expect-select, since select now checks port buffers itself. don't bother to check the time first either, since expect-select does it.
2000-01-23 * filesys.c (scm_chown): omit port/fdes support if HAVE_FCHOWN isGary Houston1-11/+12
not defined (thanks to Richard Y. Kim).
2000-01-18* strports.c (st_end_input): Inserted parenthesis to get operatorMikael Djurfeldt1-3/+3
grouping correct. * fports.c, list.c, numbers.c, ports.c, stime.c, symbols.c, filesys.c, posix.c: Converted docstrings to ANSI C format and escaped " occurring inside string literals.
2000-01-18* alist.c, chars.c, debug.c, dynl.c, dynwind.c, error.c, eval.c,Mikael Djurfeldt1-200/+186
evalext.c, filesys.c, gc.c, hash.c, hashtab.c, ioext.c, keywords.c, list.c, load.c, macros.c, net_db.c, numbers.c, objprop.c, ports.c, posix.c, print.c, procprop.c, procs.c, ramap.c, regex-posix.c, root.c, scmsigs.c, simpos.c, socket.c, stacks.c, stime.c, strings.c, strop.c, strports.c, struct.c, symbols.c, throw.c, unif.c, vectors.c, version.c, vports.c, weaks.c: Converted docstrings to ANSI C format. * filesys.c (scm_chmod), simpos.c (s_scm_system), version (scm_version), vports (scm_make_soft_port): Escape " occuring inside docstring.
2000-01-12* scm_validate.h: Added SCM_NUM2LONG_DEF macro. MakeGreg J. Badros1-8/+7
SCM_OUT_OF_RANGE use SCM_MAKINUM, not scm_long2num. Added SCM_COERCE_ROSTRING macro. Added SCM_VALIDATE_NONEMPTYLIST macro. Fix SCM_VALIDATE_STRINGORSUBSTR macro to not use SLOPPY variants. * ports.c (scm_port_closed_p): Validate that the arg is a PORT, then return whether it's an open port (was validating that it was an open port -- this was a bug I introduced back in December, but my careful reading of diffs caught it). * numbers.c: Recombine the two conditional-compilation paths for all the log* primitives -- they were split based on #ifndef scm_long2num; factored out a SCM_LOGOP_RETURN macro, and fixed some bugs and inconsistencies in the two sets of implementations. (scm_lognot) Fixed *atrocious* re-use of a SCM as an integer! * ioext.c: Use SCM_ASSERT_RANGE in a couple places, and SCM_VALIDATE_INUM_COPY once where it should've been used. * fluids.c (scm_internal_with_fluids): Use SCM_VALIDATE_LIST_COPYLEN. * filesys.c: Use SCM_NUM2LONG instead of SCM_VALIDATE_INUM_COPY; this is questionable as it relaxes type safety, but other changes were useful and all SCM_NUM2LONG's should probably be revisited. Use SCM_OUT_OF_RANGE, SCM_WRONG_TYPE_ARG. * evalext.c: line-break change on 1 line. * eval.c (nconc2last): Takes a non-empty list as its first argument, not just a list. * dynl.c: Use new SCM_COERCE_ROSTRING macro.
2000-01-11* dynl.c, feature.c, filesys.c, fports.c, list.c, load.c,Greg J. Badros1-6/+4
net_db.c, sort.c, stacks.c, unif.c: Use SCM_WTA, SCM_MISC_ERROR where possible. * symbols.c (scm_sysintern0): Fixed the function name in a scm_misc_error invocation. * print.c (scm_simple_format): Do not need SCM_COERCE_SUBSTR, and use scm_return_first to ward off latent GC bug that Mikael caught. * async.c: Use SCM_VALIDATE_ASYNC_COPY one place where it wasn't used before but should've been.
2000-01-11* dynl.c, error.c, eval.c, feature.c, filesys.c, fports.c, list.c, load.c,Greg J. Badros1-2/+2
net_db.c, read.c, socket.c: Update error messages to use ~A for %s, ~S for %S to work with new `simple-format' format and be standardized better. * print.h, print.c (scm_simple_format): Added `simple-format' primitive. It's the old scm_display_error, with ARGS now a rest parameter, and the destination first instead of last (and a couple new capabilities inspired by `format' -- #t as destination means current-output-port, #f means return the formatted text as a string. * gh.h, gh_data.c, ports.h, ports.c: Added some missing const specifications. * backtrace.c (scm_display_error_message): Rewrote to use scm_simple_format() procedure. * __scm.h: Added commented-out #define of GUILE_DEBUG_FREELIST
2000-01-09 * eval.c: define scm_unbound_variable_key ('unbound-variable).Gary Houston1-48/+14
scm_lookupcar1: throw an error with key 'unbound-variable instead of 'misc-error when an unbound variable is encountered. * filesys.c (scm_mkdir, scm_rmdir, scm_getcwd, scm_select, scm_symlink, scm_readlink, scm_lstat), posix.c (scm_setpgid, scm_setsid, scm_ctermid, scm_tcgetpgrp, scm_tcsetpgrp, scm_uname, scm_setlocale, scm_mknod, scm_nice, scm_sync), simpos.c (scm_system), stime.c (scm_times, scm_strptime): move the HAVE_XXX feature tests out of the procedure bodies. don't use SCM_SYSMISSING. scm_validate.h (SCM_SYSMISSING): removed. error.h, error.c (scm_sysmissing): comment that this is deprecated. see ChangeLog entry for 1999-12-28.
2000-01-05* *.[ch]: Whitespace changes -- added space after SCM_VALIDATE_*Greg J. Badros1-36/+36
macros and SCM_DEFINE macros to match GNU coding standards.
2000-01-05*.[ch]: Replace GUILE_PROC w/ SCM_DEFINE.Greg J. Badros1-28/+28
2000-01-05* *.[ch]: Replace SCM_VALIDATE_INT w/ SCM_VALIDATE_INUM forGreg J. Badros1-13/+13
better consistency with the names of other SCM_VALIDATE_ macros and better conformance to guile naming policy.
1999-12-16* coop-threads.c: Remove K&R function headers.Greg J. Badros1-13/+13
* scm_validate.h: Added SCM_VALIDATE_THREAD. * *.c: Remove SCM_NIMP(X) when it is an extraneous pre-test given that SCM_FOOP macros all now include SCM_NIMP in their expansion. This simplifies lots of code, making it far more readable.
1999-12-13* Makefile.am: Fix ETAGS_ARGS to recognize GUILE_PROC,Greg J. Badros1-26/+200
GUILE_PROC1. Build guile-procedures.txt, and add that file to pkgdata_DATA. * load.c: Added `pkgdata-dir', `site-dir', `library-dir' primitives. * guile-doc-snarf.awk: Drop trailing space when no arguments: e.g., "(foo )" is now "(foo)". * *.c: moved all the documentation for primitives from guile-doc/ref/{appendices,posix,scheme}.texi into the source code. This leaves about half of the primitives undocumented. Also, all the markup is currently still texinfo. I don't have a problem with texinfo per se, but the markup is not very descriptive or accurate.
1999-12-12* *.c, scm_validate.h: Use SCM_VALIDATE_NIM, not SCM_VALIDATE_NIMPGreg J. Badros1-1/+1
(none of the other validate macros have the trailing P).
1999-12-12* *.c: Pervasive software-engineering-motivated rewrite ofGreg J. Badros1-262/+233
function headers and argument checking. Switched SCM_PROC, SCM_PROC1 macros to be GUILE_PROC, GUILE_PROC1 (may change names later, but was useful to keep old versions around while migrate) that has docstrings and argument lists embedded in the GUILE_PROC macro invocations that expand into a function header. Use lots of new SCM_VALIDATE_* macros to simplify error checking and reduce tons of redundancy. This is very similar to what I did for Scwm. Note that none of the extraction of the docstrings, nor software engineering checks of Scwm is yet added to Guile. I'll work on that tomorrow, I expect. * Makefile.am: Added scm_validate.h to modinclude_HEADERS. * chars.c: Added docstrings for the primitives defined in here. * snarf.h: Added GUILE_PROC, GUILE_PROC1. Added SCM_REGISTER_PROC to be like old SCM_PROC, though old SCM_PROC still remains for now. Changed naming convention for the s_foo string name of the primitive to be s_scm_foo for ease of use with the macro. * scm_validate.h: Lots of new SCM_VALIDATE macros to simplify argument checking through guile. Maybe some of these should be folded into the header file for the types they check, but for now it was easiest to just stick them all in one place.
1999-09-26support new configure options: --disable-posix, --disable-netGary Houston1-2/+0
and --disable-regex.
1999-09-12Change the name of the objects returned by OPENDIR fromJim Blandy1-3/+3
"directory" to "directory stream". A predicate named "directory?" would be confusing. * filesys.c (scm_directory_stream_p): Renamed from scm_directory_p. At the Scheme level, "directory?" -> "directory-stream?". (scm_dir_print): Use the phrase "directory stream" in printed form. * filesys.h (scm_directory_stream_p): Prototype renamed accordingly.
1999-09-111999-09-11 Gary Houston <ghouston@easynet.co.uk>Gary Houston1-0/+7
* filesys.c (scm_directory_p): new procedure "directory?" Returns a boolean indicating whether its argument is a directory port as returned by opendir (thanks to Dirk Herrmann for the suggestion.)
1999-08-29* filesys.c (scm_stat2scm): Conditionally use S_ISLNK.Mikael Djurfeldt1-0/+4
1999-08-111999-08-11 Gary Houston <ghouston@easynet.co.uk>Gary Houston1-1/+1
* fports.c (fport_input_waiting): if select is used, return 1 instead of whatever FD_ISSET expands to. maybe it will be useful to interpret the value from the input_waiting ptob procedure as a lower bound on the number of bytes available. * Mikael asked for a few names to be changed... * ports.c (scm_make_port_type): take the write procedure as the second argument instead of the flush procedure. * ports.h (scm_ptob_descriptor): rename the ptob procedures: fflush -> flush, read_flush -> end_input, fclose -> close, fill_buffer -> fill_input, ftruncate -> truncate, input_waiting_p -> input_waiting. * ports.c (end_input_void_port): was read_flush_void_port. (scm_set_port_end_input): was scm_set_port_flush_input. (scm_set_port_flush): was scm_set_port_write. (scm_set_port_input_waiting): was scm_set_port_input_waiting_p (scm_end_input): was scm_read_flush. (scm_fill_input): was scm_fill_buffer. (scm_flush): was scm_fflush. * fports.c (fport_input_waiting): renamed from fport_input_waiting_p. (fport_end_input): was local_read_flush. (fport_flush): was local_fflush. (fport_close): was local_fclose. (fport_truncate): was local_ftruncate. (fport_seek): was local_seek. (fport_free): was local_free. (fport_fill_input): was fport_fill_buffer. * strports.c (st_end_input): was st_read_flush. (st_truncate): was st_ftruncate. * vports.c: (sf_flush): was sfflush. (sf_close): was sfclose. (sf_fill_input): was sf_fill_buffer. * ports.c, fports.c, strports, vports.c, ioext.c, unif.c, filesys.c: change callers.
1999-07-24* filesys.c (scm_dir_print): Don't use the port printing code.Mikael Djurfeldt1-5/+7
Instead provide specific directory printer.
1999-07-241999-07-24 Gary Houston <ghouston@easynet.co.uk>Gary Houston1-31/+0
* gdbint.c (gdb_print, gdb_read): call scm_truncate_file. * ports.c (scm_truncate_file): renamed from scm_ftruncate. allow the 1st argument to be a fdes or filename as well as a port (as in the filesys.c version). * filesys.c (scm_truncate_file): removed.