w32tex
About: TeX Live provides a comprehensive TeX system including all the major TeX-related programs, macro packages, and fonts that are free software. Windows sources.
  Fossies Dox: w32tex-src.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

dirent.h
Go to the documentation of this file.
1 /* <sys/dirent.h> -- file system independent directory entry (SVR3) */
2 #ifndef _SYS_DIRENT_H
3 #define _SYS_DIRENT_H
4 
5 #if defined (MSDOS) || defined (__OS2__) || defined (__TURBOC__) || defined (WIN32)
6 # if defined (OS2) || defined (__OS2__) || defined (WIN32)
7 # define MAXNAMLEN 255 /* maximum filename length */
8 # else
9 # define MAXNAMLEN 13 /* maximum filename length */
10 # endif
11 #else
12 # define MAXNAMLEN 512 /* maximum filename length */
13 #endif
14 
15 #ifndef NAME_MAX
16 #define NAME_MAX (MAXNAMLEN - 1)
17 #endif
18 
19 struct dirent /* data from getdents()/readdir() */
20 {
21  ino_t d_ino; /* inode number of entry */
22  off_t d_off; /* offset of disk directory entry */
23  ushort d_reclen; /* length of this record */
24 #if defined (MSDOS) || defined (__OS2__) || defined (__TURBOC__) || defined (WIN32)
25  char d_name[MAXNAMLEN + 1];
26 #else
27  char d_name[1]; /* name of file */
28 #endif
29 };
30 
31 #ifdef BSD_SYSV /* (e.g., when compiling getdents.c) */
32 extern struct dirent __dirent; /* (not actually used) */
33 
34  /* The following is portable, although */
35  /* rather silly. */
36 #define DIRENTBASESIZ (__dirent.d_name - (char *)&__dirent.d_ino)
37 
38 #else
39 
40 /* The following nonportable ugliness could have been avoided by defining
41  * DIRENTSIZ and DIRENTBASESIZ to also have (struct dirent *) arguments.
42  * There shouldn't be any problem if you avoid using the DIRENTSIZ() macro.
43  */
44 
45 #define DIRENTBASESIZ (((struct dirent *)0)->d_name \
46  - (char *)&((struct dirent *)0)->d_ino)
47 #endif
48 
49 #define DIRENTSIZ(namlen) ((DIRENTBASESIZ + sizeof(long) + (namlen)) \
50  / sizeof(long) * sizeof(long))
51 
52 #endif
#define MAXNAMLEN
Definition: dirent.h:12
unsigned short ino_t
Definition: types.h:10
unsigned short ushort
Definition: types.h:70
long off_t
Definition: types.h:34
Definition: dirent.h:34
ushort d_reclen
Definition: dirent.h:23
char d_name[260]
Definition: dirent.h:37
ino_t d_ino
Definition: DIRENT.H:24
off_t d_off
Definition: DIRENT.H:25