For C functions that are part of Tcl's
documented public interface, a
#include <tcl.h> should be all
that's needed to make use of them.
However, several of the filesystem
routines require additional #include's.
Tcl_FSAccess() needs the values
F_OK, R_OK, etc. for passing in as
the "mode" argument. tcl.h does not
define them; callers are required to
either #include <tclPort.h> or figure
out for themselves what system header
(if any) will fill the gap.
Tcl_FSSeek() needs the values
SEEK_SET, etc. tcl.h does not
define them (see Tcl Bug 926486);
callers are required to #include <stdio.h>
or figure out configure for the platform.
Tcl_FSStat() takes a (Tcl_StatBuf *)
argument, and then the caller needs
declarations about the struct and its
fields to do anything with the result.
This may include the time_t and mode_t
types, and various values and macros
like S_IFREG and S_ISREG(). This
all requires extra configuration to be sure
suitable header files (such as
sys/stat.h and/or sys/types.h) are included.
The Tcl_FSOpenFileChannelProc() of
a Tcl_FIlesystem is passed a "mode"
argument that requires values like
O_RDONLY, O_EXCL, etc for
decoding. tcl.h does not #define these
values; callers are required to
either #include <fcntl.h> or figure
out for themselves what system
header to use.
It appears that a better solution for all
these interfaces would be for tcl.h
itself to #define the values needed
by its public interfaces.