filesys.h 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. #ifndef SCM_FILESYS_H
  2. #define SCM_FILESYS_H
  3. /* Copyright 1995,1997-2001,2006,2008-2011,2013,2018
  4. Free Software Foundation, Inc.
  5. This file is part of Guile.
  6. Guile is free software: you can redistribute it and/or modify it
  7. under the terms of the GNU Lesser General Public License as published
  8. by the Free Software Foundation, either version 3 of the License, or
  9. (at your option) any later version.
  10. Guile is distributed in the hope that it will be useful, but WITHOUT
  11. ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  12. FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
  13. License for more details.
  14. You should have received a copy of the GNU Lesser General Public
  15. License along with Guile. If not, see
  16. <https://www.gnu.org/licenses/>. */
  17. #include <libguile/error.h>
  18. SCM_API scm_t_bits scm_tc16_dir;
  19. #define SCM_DIR_FLAG_OPEN (1L << 0)
  20. #define SCM_DIRP(x) (SCM_HAS_TYP16 (x, scm_tc16_dir))
  21. #define SCM_DIR_OPEN_P(x) (SCM_SMOB_FLAGS (x) & SCM_DIR_FLAG_OPEN)
  22. #define SCM_VALIDATE_DIR(pos, port) \
  23. SCM_MAKE_VALIDATE_MSG (pos, port, DIRP, "directory port")
  24. SCM_API SCM scm_chown (SCM object, SCM owner, SCM group);
  25. SCM_API SCM scm_chmod (SCM object, SCM mode);
  26. SCM_API SCM scm_umask (SCM mode);
  27. SCM_API SCM scm_open_fdes (SCM path, SCM flags, SCM mode);
  28. SCM_API SCM scm_open (SCM path, SCM flags, SCM mode);
  29. SCM_API SCM scm_close (SCM fd_or_port);
  30. SCM_API SCM scm_close_fdes (SCM fd);
  31. SCM_API SCM scm_stat (SCM object, SCM exception_on_error);
  32. SCM_API SCM scm_link (SCM oldpath, SCM newpath);
  33. SCM_API SCM scm_rename (SCM oldname, SCM newname);
  34. SCM_API SCM scm_delete_file (SCM str);
  35. SCM_API SCM scm_mkdir (SCM path, SCM mode);
  36. SCM_API SCM scm_rmdir (SCM path);
  37. SCM_API SCM scm_directory_stream_p (SCM obj);
  38. SCM_API SCM scm_opendir (SCM dirname);
  39. SCM_API SCM scm_readdir (SCM port);
  40. SCM_API SCM scm_rewinddir (SCM port);
  41. SCM_API SCM scm_closedir (SCM port);
  42. SCM_API SCM scm_chdir (SCM str);
  43. SCM_API SCM scm_getcwd (void);
  44. SCM_API SCM scm_select (SCM reads, SCM writes, SCM excepts, SCM secs, SCM msecs);
  45. SCM_API SCM scm_fcntl (SCM object, SCM cmd, SCM value);
  46. SCM_API SCM scm_fsync (SCM object);
  47. SCM_API SCM scm_symlink (SCM oldpath, SCM newpath);
  48. SCM_API SCM scm_readlink (SCM path);
  49. SCM_API SCM scm_lstat (SCM str);
  50. SCM_API SCM scm_copy_file (SCM oldfile, SCM newfile);
  51. SCM_API SCM scm_dirname (SCM filename);
  52. SCM_API SCM scm_basename (SCM filename, SCM suffix);
  53. SCM_API SCM scm_canonicalize_path (SCM path);
  54. SCM_API SCM scm_sendfile (SCM out, SCM in, SCM count, SCM offset);
  55. SCM_INTERNAL SCM scm_i_relativize_path (SCM path, SCM in_path);
  56. SCM_INTERNAL void scm_init_filesys (void);
  57. #endif /* SCM_FILESYS_H */