Files
RedBear-OS/src/header/sys_stat/cbindgen.toml
T

34 lines
1.3 KiB
TOML

# POSIX header spec: https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/sys_stat.h.html
#
# Spec quotations relating to includes:
# - "The <sys/stat.h> header shall define the blkcnt_t, blksize_t, dev_t, ino_t, mode_t, nlink_t, uid_t, gid_t, off_t, and time_t types as described in <sys/types.h>."
# - "The <sys/stat.h> header shall define the timespec structure as described in <time.h>. Times shall be given in seconds since the Epoch."
# - "Inclusion of the <sys/stat.h> header may make visible all symbols from the <time.h> header."
sys_includes = ["sys/types.h"]
include_guard = "_RELIBC_SYS_STAT_H"
after_includes = """
#include <bits/timespec.h> // for timespec from time.h
#define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR)
#define S_ISCHR(mode) (((mode) & S_IFMT) == S_IFCHR)
#define S_ISBLK(mode) (((mode) & S_IFMT) == S_IFBLK)
#define S_ISREG(mode) (((mode) & S_IFMT) == S_IFREG)
#define S_ISFIFO(mode) (((mode) & S_IFMT) == S_IFIFO)
#define S_ISLNK(mode) (((mode) & S_IFMT) == S_IFLNK)
#define S_ISSOCK(mode) (((mode) & S_IFMT) == S_IFSOCK)
#define st_atime st_atim.tv_sec
#define st_mtime st_mtim.tv_sec
#define st_ctime st_ctim.tv_sec
"""
language = "C"
style = "Tag"
no_includes = true
cpp_compat = true
[enum]
prefix_with_name = true
[export.rename]
"timespec" = "struct timespec"