Headers and library sources from all versions of Lightspeed C and THINK C
1
2/*
3 * stat.h
4 *
5 * Copyright (c) 1993 Symantec Corporation. All rights reserved.
6 *
7 */
8
9#include "time.h"
10
11#pragma once
12
13#ifdef __cplusplus
14extern "C" {
15#endif
16
17typedef short dev_t; // these would be in <sys/types.h>
18typedef long ino_t;
19typedef long off_t;
20typedef short mode_t;
21
22struct stat { /* "inode" information returned by stat/fstat */
23 dev_t st_dev; // device of the inode
24 ino_t st_ito; // inode number
25 short st_mode; // mode bits
26 short st_nlink; // number of links to file
27 int st_uid; // owner's user id
28 int st_gid; // owner's group id
29 dev_t st_rdev; // for special files [ignored]
30 off_t st_size; // file size in characters
31 time_t st_atime; // time last accessed
32 time_t st_mtime; // time last modified
33 time_t st_ctime; // time originally created
34};
35
36#define S_IFMT 0xFFFF // type of file:
37#define S_IFDIR 0x0000 // directory
38#define S_IFCHR 0x0001 // character special [n/a]
39#define S_IFBLK 0x0002 // block special [n/a]
40#define S_IFREG 0x0003 // regular
41
42#define S_ISDIR(m) (((m)&(S_IFMT)) == (S_IFDIR))
43#define S_ISREG(m) (((m)&(S_IFMT)) == (S_IFREG))
44
45#ifdef __cplusplus
46}
47#endif