2001-08-31 11:17:06 +00:00
|
|
|
|
#ifndef SCM_FILESYS_H
|
|
|
|
|
|
#define SCM_FILESYS_H
|
|
|
|
|
|
|
2018-06-20 19:17:06 +02:00
|
|
|
|
/* Copyright 1995,1997-2001,2006,2008-2011,2013,2018
|
2018-06-20 20:01:49 +02:00
|
|
|
|
Free Software Foundation, Inc.
|
|
|
|
|
|
|
|
|
|
|
|
This file is part of Guile.
|
|
|
|
|
|
|
|
|
|
|
|
Guile is free software: you can redistribute it and/or modify it
|
|
|
|
|
|
under the terms of the GNU Lesser General Public License as published
|
|
|
|
|
|
by the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
|
|
|
|
Guile is distributed in the hope that it will be useful, but WITHOUT
|
|
|
|
|
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
|
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
|
|
|
|
|
|
License for more details.
|
|
|
|
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Lesser General Public
|
|
|
|
|
|
License along with Guile. If not, see
|
|
|
|
|
|
<https://www.gnu.org/licenses/>. */
|
1999-12-16 03:46:42 +00:00
|
|
|
|
|
1996-07-25 22:56:11 +00:00
|
|
|
|
|
|
|
|
|
|
|
2018-06-18 10:23:04 +02:00
|
|
|
|
#include <libguile/error.h>
|
1996-07-25 22:56:11 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2001-11-02 00:19:12 +00:00
|
|
|
|
SCM_API scm_t_bits scm_tc16_dir;
|
2001-01-24 00:02:43 +00:00
|
|
|
|
|
2009-12-08 21:31:42 +01:00
|
|
|
|
#define SCM_DIR_FLAG_OPEN (1L << 0)
|
2001-01-24 00:02:43 +00:00
|
|
|
|
|
refactor tc7 and tc16 checks
* libguile/tags.h (SCM_HAS_TYP7, SCM_HAS_TYP7S, SCM_HAS_TYP16): New
macros.
* libguile/bytevectors.h (SCM_BYTEVECTOR_P):
* libguile/control.h (SCM_PROMPT_P):
* libguile/filesys.h (SCM_DIRP):
* libguile/fluids.h (SCM_WITH_FLUIDS_P, SCM_FLUID_P)
(SCM_I_DYNAMIC_STATE_P):
* libguile/foreign.h (SCM_POINTER_P):
* libguile/fports.h (SCM_FPORTP):
* libguile/frames.h (SCM_VM_FRAME_P):
* libguile/hashtab.h (SCM_HASHTABLE_P):
* libguile/inline.h (scm_get_byte_or_eof):
* libguile/numbers.h (SCM_REALP, SCM_BIGP, SCM_COMPLEXP, SCM_FRACTIONP):
* libguile/objcodes.h (SCM_OBJCODE_P):
* libguile/ports.h (SCM_OUTPUT_PORT_P):
* libguile/programs.h (SCM_PROGRAM_P):
* libguile/smob.h (SCM_SMOB_PREDICATE):
* libguile/srfi-14.h (SCM_CHARSETP):
* libguile/strings.c (IS_STRING):
* libguile/strports.h (SCM_STRPORTP):
* libguile/symbols.h (scm_is_symbol):
* libguile/variable.h (SCM_VARIABLEP):
* libguile/vectors.h (SCM_I_IS_VECTOR, SCM_I_IS_NONWEAK_VECTOR):
* libguile/vm-i-system.c (call, tail-call, mv-call)
* libguile/vm.h (SCM_VM_P, SCM_VM_CONT_P):
* libguile/weak-set.c (SCM_WEAK_SET_P):
* libguile/weak-table.c (SCM_WEAK_TABLE_P):
* libguile/weak-vector.h (SCM_I_WVECTP): Use them.
2011-10-24 17:34:47 +02:00
|
|
|
|
#define SCM_DIRP(x) (SCM_HAS_TYP16 (x, scm_tc16_dir))
|
2009-12-08 21:31:42 +01:00
|
|
|
|
#define SCM_DIR_OPEN_P(x) (SCM_SMOB_FLAGS (x) & SCM_DIR_FLAG_OPEN)
|
2000-05-25 09:21:06 +00:00
|
|
|
|
|
2018-06-18 10:23:04 +02:00
|
|
|
|
#define SCM_VALIDATE_DIR(pos, port) \
|
|
|
|
|
|
SCM_MAKE_VALIDATE_MSG (pos, port, DIRP, "directory port")
|
|
|
|
|
|
|
1996-07-25 22:56:11 +00:00
|
|
|
|
|
|
|
|
|
|
|
2001-11-02 00:19:12 +00:00
|
|
|
|
SCM_API SCM scm_chown (SCM object, SCM owner, SCM group);
|
|
|
|
|
|
SCM_API SCM scm_chmod (SCM object, SCM mode);
|
|
|
|
|
|
SCM_API SCM scm_umask (SCM mode);
|
|
|
|
|
|
SCM_API SCM scm_open_fdes (SCM path, SCM flags, SCM mode);
|
|
|
|
|
|
SCM_API SCM scm_open (SCM path, SCM flags, SCM mode);
|
|
|
|
|
|
SCM_API SCM scm_close (SCM fd_or_port);
|
|
|
|
|
|
SCM_API SCM scm_close_fdes (SCM fd);
|
2009-06-02 22:20:21 +02:00
|
|
|
|
SCM_API SCM scm_stat (SCM object, SCM exception_on_error);
|
2001-11-02 00:19:12 +00:00
|
|
|
|
SCM_API SCM scm_link (SCM oldpath, SCM newpath);
|
|
|
|
|
|
SCM_API SCM scm_rename (SCM oldname, SCM newname);
|
|
|
|
|
|
SCM_API SCM scm_delete_file (SCM str);
|
|
|
|
|
|
SCM_API SCM scm_mkdir (SCM path, SCM mode);
|
|
|
|
|
|
SCM_API SCM scm_rmdir (SCM path);
|
|
|
|
|
|
SCM_API SCM scm_directory_stream_p (SCM obj);
|
|
|
|
|
|
SCM_API SCM scm_opendir (SCM dirname);
|
|
|
|
|
|
SCM_API SCM scm_readdir (SCM port);
|
|
|
|
|
|
SCM_API SCM scm_rewinddir (SCM port);
|
|
|
|
|
|
SCM_API SCM scm_closedir (SCM port);
|
|
|
|
|
|
SCM_API SCM scm_chdir (SCM str);
|
|
|
|
|
|
SCM_API SCM scm_getcwd (void);
|
|
|
|
|
|
SCM_API SCM scm_select (SCM reads, SCM writes, SCM excepts, SCM secs, SCM msecs);
|
|
|
|
|
|
SCM_API SCM scm_fcntl (SCM object, SCM cmd, SCM value);
|
|
|
|
|
|
SCM_API SCM scm_fsync (SCM object);
|
|
|
|
|
|
SCM_API SCM scm_symlink (SCM oldpath, SCM newpath);
|
|
|
|
|
|
SCM_API SCM scm_readlink (SCM path);
|
|
|
|
|
|
SCM_API SCM scm_lstat (SCM str);
|
|
|
|
|
|
SCM_API SCM scm_copy_file (SCM oldfile, SCM newfile);
|
|
|
|
|
|
SCM_API SCM scm_dirname (SCM filename);
|
|
|
|
|
|
SCM_API SCM scm_basename (SCM filename, SCM suffix);
|
2009-06-19 14:26:47 +02:00
|
|
|
|
SCM_API SCM scm_canonicalize_path (SCM path);
|
2013-03-20 23:04:11 +01:00
|
|
|
|
SCM_API SCM scm_sendfile (SCM out, SCM in, SCM count, SCM offset);
|
2010-04-19 16:39:11 +02:00
|
|
|
|
SCM_INTERNAL SCM scm_i_relativize_path (SCM path, SCM in_path);
|
1998-07-30 14:44:09 +00:00
|
|
|
|
|
2008-05-14 05:20:47 +02:00
|
|
|
|
SCM_INTERNAL void scm_init_filesys (void);
|
1996-07-25 22:56:11 +00:00
|
|
|
|
|
2001-08-31 11:17:06 +00:00
|
|
|
|
#endif /* SCM_FILESYS_H */
|