Annotation of researchv9/include/ndir.h, revision 1.1.1.1

1.1       root        1: /* Copyright (c) 1982 Regents of the University of California */
                      2: /* and modified by pjw in 1986 */
                      3: 
                      4: /*
                      5:  * this must be a power of 2 and a multiple of all the ones in the system
                      6:  */
                      7: #define DIRBLKSIZ 512
                      8: 
                      9: /*
                     10:  * This limits the directory name length. Its main constraint
                     11:  * is that it appears twice in the user structure. (u. area) in bsd systems
                     12:  */
                     13: #define MAXNAMLEN 255
                     14: 
                     15: struct direct {
                     16:        unsigned long   d_ino;
                     17:        short   d_reclen;
                     18:        short   d_namlen;
                     19:        char    d_name[MAXNAMLEN + 1];
                     20:        /* typically shorter */
                     21: };
                     22: 
                     23: struct _dirdesc {
                     24:        int     dd_fd;
                     25:        long    dd_loc;
                     26:        long    dd_size;
                     27:        char    dd_buf[DIRBLKSIZ];
                     28:        char    dd_type;
                     29: };
                     30: /* directory types */
                     31: #define TUNK 0
                     32: #define TOLD 1
                     33: #define TCRAY          2
                     34: #define TBSDSWAP       3       /* bsd style on other-endian */
                     35: #define TBSD           4       /* bsd style */
                     36: #define TOLDSWAP       5       /* Old on other-endian, i.e. vax from sun */
                     37: 
                     38: /*
                     39:  * useful macros.
                     40:  */
                     41: #undef DIRSIZ
                     42: #define DIRSIZ(dp) \
                     43:     ((sizeof(struct direct) - MAXNAMLEN + (dp)->d_namlen + sizeof(ino_t) - 1) &\
                     44:     ~(sizeof(ino_t) - 1))
                     45: typedef        struct _dirdesc DIR;
                     46: #ifndef        NULL
                     47: #define        NULL    0
                     48: #endif
                     49: 
                     50: /*
                     51:  * functions defined on directories
                     52:  */
                     53: extern DIR *opendir();
                     54: extern struct direct *readdir();
                     55: extern long telldir();
                     56: extern void seekdir();
                     57: #define rewinddir(dirp)        seekdir((dirp), 0)
                     58: extern void closedir();

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.