summaryrefslogtreecommitdiffstats
path: root/tcl8.6/compat/dirent2.h
diff options
context:
space:
mode:
authorWilliam Joye <wjoye@cfa.harvard.edu>2017-10-17 19:52:11 (GMT)
committerWilliam Joye <wjoye@cfa.harvard.edu>2017-10-17 19:52:11 (GMT)
commitda0aaf36f00f649cd910b1bcb972b4ad476cd5fd (patch)
tree3d5215355c39587ed375451b86b7f9962f739a5f /tcl8.6/compat/dirent2.h
parent9bfb1e415c87790341c6a3520b081292fcdb058b (diff)
parentc8bc058c566bbcbcd23e732197d64fecc739008f (diff)
downloadblt-da0aaf36f00f649cd910b1bcb972b4ad476cd5fd.zip
blt-da0aaf36f00f649cd910b1bcb972b4ad476cd5fd.tar.gz
blt-da0aaf36f00f649cd910b1bcb972b4ad476cd5fd.tar.bz2
Merge commit 'c8bc058c566bbcbcd23e732197d64fecc739008f' as 'tcl8.6'
Diffstat (limited to 'tcl8.6/compat/dirent2.h')
-rw-r--r--tcl8.6/compat/dirent2.h53
1 files changed, 53 insertions, 0 deletions
diff --git a/tcl8.6/compat/dirent2.h b/tcl8.6/compat/dirent2.h
new file mode 100644
index 0000000..5be08ba
--- /dev/null
+++ b/tcl8.6/compat/dirent2.h
@@ -0,0 +1,53 @@
+/*
+ * dirent.h --
+ *
+ * Declarations of a library of directory-reading procedures
+ * in the POSIX style ("struct dirent").
+ *
+ * Copyright (c) 1991 The Regents of the University of California.
+ * Copyright (c) 1994 Sun Microsystems, Inc.
+ *
+ * See the file "license.terms" for information on usage and redistribution
+ * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ */
+
+#ifndef _DIRENT
+#define _DIRENT
+
+/*
+ * Dirent structure, which holds information about a single
+ * directory entry.
+ */
+
+#define MAXNAMLEN 255
+#define DIRBLKSIZ 512
+
+struct dirent {
+ long d_ino; /* Inode number of entry */
+ short d_reclen; /* Length of this record */
+ short d_namlen; /* Length of string in d_name */
+ char d_name[MAXNAMLEN + 1]; /* Name must be no longer than this */
+};
+
+/*
+ * State that keeps track of the reading of a directory (clients
+ * should never look inside this structure; the fields should
+ * only be accessed by the library procedures).
+ */
+
+typedef struct _dirdesc {
+ int dd_fd;
+ long dd_loc;
+ long dd_size;
+ char dd_buf[DIRBLKSIZ];
+} DIR;
+
+/*
+ * Procedures defined for reading directories:
+ */
+
+extern void closedir (DIR *dirp);
+extern DIR * opendir (char *name);
+extern struct dirent * readdir (DIR *dirp);
+
+#endif /* _DIRENT */