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