1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-07-03 16:20:39 +02:00
guile/libguile/filesys-internal.h
Andy Wingo 65a265adea Add filesys-internal.h
* libguile/Makefile.am: Add new file.
* libguile/filesys-internal.h: New file.
* libguile/filesys.c:
* libguile/filesys.h:
* libguile/fports.c:
* libguile/finalizers.c:
* libguile/init.c:
* libguile/print.c: Adapt.
2025-06-30 16:05:38 +02:00

68 lines
1.8 KiB
C
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#ifndef SCM_FILESYS_INTERNAL_H
#define SCM_FILESYS_INTERNAL_H
/* Copyright 1995,1997-2001,2006,2008-2011,2013,2018,2021,2025
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/>. */
#include <dirent.h>
#include <libguile/filesys.h>
#include <libguile/threads-internal.h>
#define SCM_DIR_FLAG_OPEN (1L << 16)
struct scm_directory
{
scm_t_bits tag_and_flags;
DIR *ds;
scm_i_pthread_mutex_t mutex;
};
static inline int
scm_is_directory (SCM x)
{
return SCM_HAS_TYP16 (x, scm_tc16_directory);
}
static inline struct scm_directory*
scm_to_directory (SCM x)
{
if (!scm_is_directory (x))
abort ();
return (struct scm_directory*) SCM_UNPACK_POINTER (x);
}
static inline SCM
scm_from_directory (struct scm_directory *dir)
{
return SCM_PACK_POINTER (dir);
}
SCM_INTERNAL SCM scm_copy_file2 (SCM oldfile, SCM newfile, SCM rest);
SCM_INTERNAL SCM scm_i_relativize_path (SCM path, SCM in_path);
SCM_INTERNAL int scm_i_print_directory (SCM exp, SCM port, scm_print_state *pstate);
SCM_INTERNAL void scm_i_finalize_directory (struct scm_thread*, SCM);
SCM_INTERNAL void scm_init_filesys (void);
#endif /* SCM_FILESYS_INTERNAL_H */