sl@0: /* sl@0: * dirent.h -- sl@0: * sl@0: * Declarations of a library of directory-reading procedures sl@0: * in the POSIX style ("struct dirent"). sl@0: * sl@0: * Copyright (c) 1991 The Regents of the University of California. sl@0: * Copyright (c) 1994 Sun Microsystems, Inc. sl@0: * sl@0: * See the file "license.terms" for information on usage and redistribution sl@0: * of this file, and for a DISCLAIMER OF ALL WARRANTIES. sl@0: * sl@0: * RCS: @(#) $Id: dirent2.h,v 1.2 1998/09/14 18:39:44 stanton Exp $ sl@0: */ sl@0: sl@0: #ifndef _DIRENT sl@0: #define _DIRENT sl@0: sl@0: #ifndef _TCL sl@0: #include "tcl.h" sl@0: #endif sl@0: sl@0: /* sl@0: * Dirent structure, which holds information about a single sl@0: * directory entry. sl@0: */ sl@0: sl@0: #define MAXNAMLEN 255 sl@0: #define DIRBLKSIZ 512 sl@0: sl@0: struct dirent { sl@0: long d_ino; /* Inode number of entry */ sl@0: short d_reclen; /* Length of this record */ sl@0: short d_namlen; /* Length of string in d_name */ sl@0: char d_name[MAXNAMLEN + 1]; /* Name must be no longer than this */ sl@0: }; sl@0: sl@0: /* sl@0: * State that keeps track of the reading of a directory (clients sl@0: * should never look inside this structure; the fields should sl@0: * only be accessed by the library procedures). sl@0: */ sl@0: sl@0: typedef struct _dirdesc { sl@0: int dd_fd; sl@0: long dd_loc; sl@0: long dd_size; sl@0: char dd_buf[DIRBLKSIZ]; sl@0: } DIR; sl@0: sl@0: /* sl@0: * Procedures defined for reading directories: sl@0: */ sl@0: sl@0: extern void closedir _ANSI_ARGS_((DIR *dirp)); sl@0: extern DIR * opendir _ANSI_ARGS_((char *name)); sl@0: extern struct dirent * readdir _ANSI_ARGS_((DIR *dirp)); sl@0: sl@0: #endif /* _DIRENT */