2020-03-02 16:47:21 +08:00
|
|
|
def SigSetType : NamedType<"sigset_t">;
|
|
|
|
def SigSetPtrType : PtrType<SigSetType>;
|
|
|
|
def ConstSigSetPtrType : ConstType<SigSetPtrType>;
|
2020-08-15 03:38:52 +08:00
|
|
|
def RestrictedSigSetType : RestrictedPtrType<SigSetType>;
|
|
|
|
def ConstRestrictedSigSetType : ConstType<RestrictedSigSetType>;
|
2020-03-02 16:47:21 +08:00
|
|
|
|
2020-03-18 13:08:59 +08:00
|
|
|
def StructSigaction : NamedType<"struct sigaction">;
|
|
|
|
def StructSigactionPtr : PtrType<StructSigaction>;
|
|
|
|
def ConstStructSigactionPtr : ConstType<StructSigactionPtr>;
|
2020-08-15 03:38:52 +08:00
|
|
|
def RestrictedStructSigactionPtr : RestrictedPtrType<StructSigaction>;
|
|
|
|
def ConstRestrictedStructSigactionPtr : ConstType<RestrictedStructSigactionPtr>;
|
2020-03-18 13:08:59 +08:00
|
|
|
|
2019-12-06 04:09:24 +08:00
|
|
|
def POSIX : StandardSpec<"POSIX"> {
|
2020-07-23 06:21:00 +08:00
|
|
|
PtrType CharPtr = PtrType<CharType>;
|
2020-08-14 03:51:16 +08:00
|
|
|
RestrictedPtrType RestrictedCharPtr = RestrictedPtrType<CharType>;
|
|
|
|
RestrictedPtrType CharRestrictedDoublePtr = RestrictedPtrType<CharPtr>;
|
2020-08-15 03:38:52 +08:00
|
|
|
ConstType ConstCharPtr = ConstType<CharPtr>;
|
|
|
|
ConstType ConstRestrictedCharPtr = ConstType<RestrictedCharPtr>;
|
|
|
|
|
2019-12-05 15:17:14 +08:00
|
|
|
NamedType OffTType = NamedType<"off_t">;
|
2020-04-18 01:21:05 +08:00
|
|
|
NamedType SSizeTType = NamedType<"ssize_t">;
|
2019-12-05 15:17:14 +08:00
|
|
|
|
2019-12-06 04:09:24 +08:00
|
|
|
HeaderSpec Errno = HeaderSpec<
|
|
|
|
"errno.h",
|
|
|
|
[
|
|
|
|
Macro<"E2BIG">,
|
|
|
|
Macro<"EACCES">,
|
|
|
|
Macro<"EADDRINUSE">,
|
|
|
|
Macro<"EADDRNOTAVAIL">,
|
|
|
|
Macro<"EAFNOSUPPORT">,
|
|
|
|
Macro<"EAGAIN">,
|
|
|
|
Macro<"EALREADY">,
|
|
|
|
Macro<"EBADF">,
|
|
|
|
Macro<"EBADMSG">,
|
|
|
|
Macro<"EBUSY">,
|
|
|
|
Macro<"ECANCELED">,
|
|
|
|
Macro<"ECHILD">,
|
|
|
|
Macro<"ECONNABORTED">,
|
|
|
|
Macro<"ECONNREFUSED">,
|
|
|
|
Macro<"ECONNRESET">,
|
|
|
|
Macro<"EDEADLK">,
|
|
|
|
Macro<"EDESTADDRREQ">,
|
|
|
|
Macro<"EDQUOT">,
|
|
|
|
Macro<"EEXIST">,
|
|
|
|
Macro<"EFAULT">,
|
|
|
|
Macro<"EFBIG">,
|
|
|
|
Macro<"EHOSTUNREACH">,
|
|
|
|
Macro<"EIDRM">,
|
|
|
|
Macro<"EINPROGRESS">,
|
|
|
|
Macro<"EINTR">,
|
|
|
|
Macro<"EINVAL">,
|
|
|
|
Macro<"EIO">,
|
|
|
|
Macro<"EISCONN">,
|
|
|
|
Macro<"EISDIR">,
|
|
|
|
Macro<"ELOOP">,
|
|
|
|
Macro<"EMFILE">,
|
|
|
|
Macro<"EMLINK">,
|
|
|
|
Macro<"EMSGSIZE">,
|
|
|
|
Macro<"EMULTIHOP">,
|
|
|
|
Macro<"ENAMETOOLONG">,
|
|
|
|
Macro<"ENETDOWN">,
|
|
|
|
Macro<"ENETRESET">,
|
|
|
|
Macro<"ENETUNREACH">,
|
|
|
|
Macro<"ENFILE">,
|
|
|
|
Macro<"ENOBUFS">,
|
|
|
|
Macro<"ENODATA">,
|
|
|
|
Macro<"ENODEV">,
|
|
|
|
Macro<"ENOENT">,
|
|
|
|
Macro<"ENOEXEC">,
|
|
|
|
Macro<"ENOLCK">,
|
|
|
|
Macro<"ENOLINK">,
|
|
|
|
Macro<"ENOMEM">,
|
|
|
|
Macro<"ENOMSG">,
|
|
|
|
Macro<"ENOPROTOOPT">,
|
|
|
|
Macro<"ENOSPC">,
|
|
|
|
Macro<"ENOSR">,
|
|
|
|
Macro<"ENOSTR">,
|
|
|
|
Macro<"ENOSYS">,
|
|
|
|
Macro<"ENOTCONN">,
|
|
|
|
Macro<"ENOTDIR">,
|
|
|
|
Macro<"ENOTEMPTY">,
|
|
|
|
Macro<"ENOTRECOVERABLE">,
|
|
|
|
Macro<"ENOTSOCK">,
|
|
|
|
Macro<"ENOTSUP">,
|
|
|
|
Macro<"ENOTTY">,
|
|
|
|
Macro<"ENXIO">,
|
|
|
|
Macro<"EOPNOTSUPP">,
|
|
|
|
Macro<"EOVERFLOW">,
|
|
|
|
Macro<"EOWNERDEAD">,
|
|
|
|
Macro<"EPERM">,
|
|
|
|
Macro<"EPIPE">,
|
|
|
|
Macro<"EPROTO">,
|
|
|
|
Macro<"EPROTONOSUPPORT">,
|
|
|
|
Macro<"EPROTOTYPE">,
|
|
|
|
Macro<"EROFS">,
|
|
|
|
Macro<"ESPIPE">,
|
|
|
|
Macro<"ESRCH">,
|
|
|
|
Macro<"ESTALE">,
|
|
|
|
Macro<"ETIME">,
|
|
|
|
Macro<"ETIMEDOUT">,
|
|
|
|
Macro<"ETXTBSY">,
|
|
|
|
Macro<"EWOULDBLOCK">,
|
|
|
|
Macro<"EXDEV">,
|
|
|
|
],
|
|
|
|
[], // Types
|
2020-02-28 06:30:24 +08:00
|
|
|
[], // Enumerations
|
2019-12-06 04:09:24 +08:00
|
|
|
[] // Functions
|
|
|
|
>;
|
|
|
|
|
2019-12-05 15:17:14 +08:00
|
|
|
HeaderSpec SysMMan = HeaderSpec<
|
|
|
|
"sys/mman.h",
|
|
|
|
[
|
|
|
|
// TODO: Add a facility to bunch macros into bitwise-or-able groups.
|
|
|
|
// POSIX requires it, so such thing should be captured in this spec.
|
|
|
|
Macro<"PROT_EXEC">,
|
|
|
|
Macro<"PROT_NONE">,
|
|
|
|
Macro<"PROT_READ">,
|
|
|
|
Macro<"PROT_WRITE">,
|
|
|
|
|
|
|
|
Macro<"MAP_FIXED">,
|
|
|
|
Macro<"MAP_PRIVATE">,
|
|
|
|
Macro<"MAP_SHARED">,
|
|
|
|
|
|
|
|
Macro<"MAP_FAILED">,
|
|
|
|
],
|
|
|
|
[
|
|
|
|
SizeTType,
|
|
|
|
OffTType,
|
|
|
|
],
|
2020-02-28 06:30:24 +08:00
|
|
|
[], // Enumerations
|
2019-12-05 15:17:14 +08:00
|
|
|
[
|
|
|
|
FunctionSpec<
|
|
|
|
"mmap",
|
|
|
|
RetValSpec<VoidPtr>,
|
|
|
|
[ArgSpec<VoidPtr>,
|
|
|
|
ArgSpec<SizeTType>,
|
|
|
|
ArgSpec<IntType>,
|
|
|
|
ArgSpec<IntType>,
|
|
|
|
ArgSpec<IntType>,
|
|
|
|
ArgSpec<OffTType>]
|
|
|
|
>,
|
|
|
|
FunctionSpec<
|
|
|
|
"munmap",
|
|
|
|
RetValSpec<IntType>,
|
|
|
|
[ArgSpec<VoidPtr>, ArgSpec<SizeTType>]
|
|
|
|
>,
|
|
|
|
]
|
|
|
|
>;
|
|
|
|
|
2020-03-02 16:47:21 +08:00
|
|
|
HeaderSpec Signal = HeaderSpec<
|
|
|
|
"signal.h",
|
|
|
|
[], // Macros
|
2020-03-18 13:08:59 +08:00
|
|
|
[
|
|
|
|
SigSetType,
|
|
|
|
StructSigaction,
|
|
|
|
],
|
2020-03-02 16:47:21 +08:00
|
|
|
[], // Enumerations
|
|
|
|
[
|
2020-03-18 13:08:59 +08:00
|
|
|
FunctionSpec<
|
|
|
|
"sigaction",
|
|
|
|
RetValSpec<IntType>,
|
|
|
|
[ArgSpec<IntType>,
|
2020-08-15 03:38:52 +08:00
|
|
|
ArgSpec<ConstRestrictedStructSigactionPtr>,
|
|
|
|
ArgSpec<RestrictedStructSigactionPtr>]
|
2020-03-18 13:08:59 +08:00
|
|
|
>,
|
2020-04-24 07:30:23 +08:00
|
|
|
FunctionSpec<
|
|
|
|
"sigdelset",
|
|
|
|
RetValSpec<IntType>,
|
|
|
|
[ArgSpec<SigSetPtrType>,
|
|
|
|
ArgSpec<IntType>]
|
|
|
|
>,
|
2020-03-02 16:47:21 +08:00
|
|
|
FunctionSpec<
|
|
|
|
"sigprocmask",
|
|
|
|
RetValSpec<IntType>,
|
2020-08-15 03:38:52 +08:00
|
|
|
[ArgSpec<IntType>, ArgSpec<ConstRestrictedSigSetType>, ArgSpec<RestrictedSigSetType>]
|
2020-03-02 16:47:21 +08:00
|
|
|
>,
|
|
|
|
FunctionSpec<
|
|
|
|
"sigemptyset",
|
|
|
|
RetValSpec<IntType>,
|
|
|
|
[ArgSpec<SigSetPtrType>]
|
|
|
|
>,
|
|
|
|
FunctionSpec<
|
|
|
|
"sigaddset",
|
|
|
|
RetValSpec<IntType>,
|
2020-04-24 07:30:23 +08:00
|
|
|
[ArgSpec<SigSetPtrType>,
|
|
|
|
ArgSpec<IntType>]
|
|
|
|
>,
|
|
|
|
FunctionSpec<
|
|
|
|
"sigfillset",
|
|
|
|
RetValSpec<IntType>,
|
2020-03-02 16:47:21 +08:00
|
|
|
[ArgSpec<SigSetPtrType>]
|
|
|
|
>,
|
|
|
|
]
|
|
|
|
>;
|
|
|
|
|
2020-04-18 01:21:05 +08:00
|
|
|
HeaderSpec UniStd = HeaderSpec<
|
|
|
|
"unistd.h",
|
|
|
|
[], // Macros
|
|
|
|
[
|
|
|
|
SSizeTType,
|
|
|
|
SizeTType,
|
|
|
|
],
|
|
|
|
[], // Enumerations
|
|
|
|
[
|
|
|
|
FunctionSpec<
|
|
|
|
"write",
|
|
|
|
RetValSpec<SSizeTType>,
|
|
|
|
[ArgSpec<IntType>, ArgSpec<ConstVoidPtr>, ArgSpec<SizeTType>]
|
|
|
|
>,
|
|
|
|
]
|
|
|
|
>;
|
2020-07-23 06:21:00 +08:00
|
|
|
|
|
|
|
HeaderSpec String = HeaderSpec<
|
|
|
|
"string.h",
|
|
|
|
[
|
|
|
|
Macro<"NULL">,
|
|
|
|
],
|
|
|
|
[
|
|
|
|
SizeTType,
|
|
|
|
],
|
|
|
|
[], // Enumerations
|
|
|
|
[
|
2021-10-13 07:05:56 +08:00
|
|
|
FunctionSpec<
|
|
|
|
"memccpy",
|
|
|
|
RetValSpec<VoidPtr>,
|
|
|
|
[ArgSpec<VoidRestrictedPtr>,
|
|
|
|
ArgSpec<ConstVoidRestrictedPtr>,
|
|
|
|
ArgSpec<IntType>,
|
|
|
|
ArgSpec<SizeTType>]
|
|
|
|
>,
|
|
|
|
FunctionSpec<
|
|
|
|
"mempcpy",
|
|
|
|
RetValSpec<VoidPtr>,
|
|
|
|
[ArgSpec<VoidRestrictedPtr>,
|
|
|
|
ArgSpec<ConstVoidRestrictedPtr>,
|
|
|
|
ArgSpec<SizeTType>]
|
|
|
|
>,
|
2021-10-16 06:11:37 +08:00
|
|
|
FunctionSpec<
|
|
|
|
"stpcpy",
|
|
|
|
RetValSpec<CharPtr>,
|
|
|
|
[ArgSpec<RestrictedCharPtr>,
|
|
|
|
ArgSpec<ConstRestrictedCharPtr>]
|
|
|
|
>,
|
|
|
|
FunctionSpec<
|
|
|
|
"stpncpy",
|
|
|
|
RetValSpec<CharPtr>,
|
|
|
|
[ArgSpec<RestrictedCharPtr>,
|
|
|
|
ArgSpec<ConstRestrictedCharPtr>,
|
|
|
|
ArgSpec<SizeTType>]
|
|
|
|
>,
|
2020-07-23 06:21:00 +08:00
|
|
|
FunctionSpec<
|
|
|
|
"strnlen",
|
|
|
|
RetValSpec<SizeTType>,
|
|
|
|
[ArgSpec<ConstCharPtr>, ArgSpec<SizeTType>]
|
|
|
|
>,
|
2020-08-14 03:51:16 +08:00
|
|
|
FunctionSpec<
|
|
|
|
"strtok_r",
|
|
|
|
RetValSpec<CharPtr>,
|
2020-09-09 23:32:51 +08:00
|
|
|
[ArgSpec<RestrictedCharPtr>,
|
|
|
|
ArgSpec<ConstRestrictedCharPtr>,
|
|
|
|
ArgSpec<CharRestrictedDoublePtr>]
|
2020-08-14 03:51:16 +08:00
|
|
|
>,
|
2020-07-23 06:21:00 +08:00
|
|
|
]
|
|
|
|
>;
|
2020-04-18 01:21:05 +08:00
|
|
|
|
2021-01-13 06:37:56 +08:00
|
|
|
HeaderSpec CType = HeaderSpec<
|
|
|
|
"ctype.h",
|
|
|
|
[], // Macros
|
|
|
|
[], // Types
|
|
|
|
[], // Enumerations
|
|
|
|
[
|
|
|
|
FunctionSpec<
|
|
|
|
"isascii",
|
|
|
|
RetValSpec<IntType>,
|
|
|
|
[ArgSpec<IntType>]
|
|
|
|
>,
|
|
|
|
]
|
|
|
|
>;
|
|
|
|
|
2019-12-06 04:09:24 +08:00
|
|
|
let Headers = [
|
2021-01-13 06:37:56 +08:00
|
|
|
CType,
|
2019-12-06 04:09:24 +08:00
|
|
|
Errno,
|
2019-12-05 15:17:14 +08:00
|
|
|
SysMMan,
|
2020-03-02 16:47:21 +08:00
|
|
|
Signal,
|
2020-04-18 01:21:05 +08:00
|
|
|
UniStd,
|
2020-07-23 06:21:00 +08:00
|
|
|
String
|
2019-12-06 04:09:24 +08:00
|
|
|
];
|
|
|
|
}
|