1 /*
2   Copyright (c) 1990-1999 Info-ZIP.  All rights reserved.
3 
4   See the accompanying file LICENSE, version 1999-Oct-05 or later
5   (the contents of which are also included in zip.h) for terms of use.
6   If, for some reason, both of these files are missing, the Info-ZIP license
7   also may be found at:  ftp://ftp.cdrom.com/pub/infozip/license.html
8 */
9 /*  cstat.h
10 
11     Definitions used for file status functions
12 
13 */
14 
15 #ifndef __STAT_H
16 #define __STAT_H
17 
18 #include <stdio.h>
19 
20 #define S_IFMT  0xF000  /* file type mask */
21 #define S_IFDIR 0x4000  /* directory */
22 #define S_IFIFO 0x1000  /* FIFO special */
23 #define S_IFCHR 0x2000  /* character special */
24 #define S_IFBLK 0x3000  /* block special */
25 #define S_IFREG 0x8000  /* or just 0x0000, regular */
26 #define S_IREAD 0x0100  /* owner may read */
27 #define S_IWRITE 0x0080 /* owner may write */
28 #define S_IEXEC 0x0040  /* owner may execute <directory search> */
29 
30 struct  stat
31 {
32     short st_dev;      /* Drive number of disk containing the  */
33                        /* file or file handle if the file is   */
34                        /* on device                            */
35     short st_ino;      /* Not meaningfull for VM/CMS           */
36     short st_mode;     /* Bit mask giving information about    */
37                        /* the file's mode                      */
38     short st_nlink;    /* Set to the integer constant 1        */
39     int   st_uid;      /* Not meaningfull for VM/CMS           */
40     int   st_gid;      /* Not meaningfull for VM/CMS           */
41     short st_rdev;     /* Same as st_dev                       */
42     long  st_size;     /* Size of the file in bytes            */
43     long  st_atime;    /* Most recent access                   */
44     long  st_mtime;    /* Same as st_atime                     */
45     long  st_ctime;    /* Same as st_atime                     */
46     FILE  *fp;
47     char  fname[FILENAME_MAX];
48 };
49 
50 int stat(const char *path, struct stat *sb);
51 int fstat(int fd, struct stat *sb);
52 
53 #endif  /* __STAT_H */
54