mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-11-23 22:00:10 +00:00
e06b5a2435
strsep, strtok_r, strlcpy, and strlcat take restricted pointers as parameters. Add the restrict qualifiers to them. Sources: https://man7.org/linux/man-pages/man3/strsep.3.html https://man7.org/linux/man-pages/man3/strtok_r.3.html https://man.freebsd.org/cgi/man.cgi?strlcpy
75 lines
1.8 KiB
TableGen
75 lines
1.8 KiB
TableGen
def BsdExtensions : StandardSpec<"BSDExtensions"> {
|
|
HeaderSpec String = HeaderSpec<
|
|
"string.h",
|
|
[], // Macros
|
|
[], // Types
|
|
[], // Enumerations
|
|
[
|
|
FunctionSpec<
|
|
"strlcat",
|
|
RetValSpec<SizeTType>,
|
|
[ArgSpec<ConstCharRestrictedPtr>, ArgSpec<ConstCharRestrictedPtr>, ArgSpec<SizeTType>]
|
|
>,
|
|
FunctionSpec<
|
|
"strlcpy",
|
|
RetValSpec<SizeTType>,
|
|
[ArgSpec<ConstCharRestrictedPtr>, ArgSpec<ConstCharRestrictedPtr>, ArgSpec<SizeTType>]
|
|
>,
|
|
FunctionSpec<
|
|
"strsep",
|
|
RetValSpec<CharPtr>,
|
|
[ArgSpec<CharRestrictedPtrPtr>, ArgSpec<ConstCharRestrictedPtr>]
|
|
>,
|
|
]
|
|
>;
|
|
|
|
HeaderSpec Strings = HeaderSpec<
|
|
"strings.h",
|
|
[], // Macros
|
|
[], // Types
|
|
[], // Enumerations
|
|
[
|
|
FunctionSpec<
|
|
"strcasecmp",
|
|
RetValSpec<IntType>,
|
|
[ArgSpec<ConstCharPtr>, ArgSpec<ConstCharPtr>]
|
|
>,
|
|
FunctionSpec<
|
|
"strncasecmp",
|
|
RetValSpec<IntType>,
|
|
[ArgSpec<ConstCharPtr>, ArgSpec<ConstCharPtr>, ArgSpec<SizeTType>]
|
|
>,
|
|
FunctionSpec<
|
|
"index",
|
|
RetValSpec<CharPtr>,
|
|
[ArgSpec<ConstCharPtr>, ArgSpec<IntType>]
|
|
>,
|
|
FunctionSpec<
|
|
"rindex",
|
|
RetValSpec<CharPtr>,
|
|
[ArgSpec<ConstCharPtr>, ArgSpec<IntType>]
|
|
>,
|
|
]
|
|
>;
|
|
|
|
HeaderSpec SysWait = HeaderSpec<
|
|
"sys/wait.h",
|
|
[], // Macros
|
|
[StructRUsage], // Types
|
|
[], // Enumerations
|
|
[
|
|
FunctionSpec<
|
|
"wait4",
|
|
RetValSpec<PidT>,
|
|
[ArgSpec<PidT>, ArgSpec<IntPtr>, ArgSpec<IntType>, ArgSpec<StructRUsagePtr>]
|
|
>
|
|
]
|
|
>;
|
|
|
|
let Headers = [
|
|
String,
|
|
Strings,
|
|
SysWait,
|
|
];
|
|
}
|