e0d4df8324a2c69ffd2523673ab2abbd5eb3d4fd
[lldb.git] / libc / config / linux / api.td
1 include "config/public_api.td"
2
3 include "spec/stdc.td"
4
5 def FloatT : TypeDecl<"float_t"> {
6   let Decl = [{
7     #if __FLT_EVAL_METHOD__ == 1
8       typedef float float_t
9     #elif __FLT_EVAL_METHOD__ == 2
10       ...
11     #else
12       ...
13     #endif
14   }]; // This is only an example and not exactly how it will appear
15 }
16
17 def SizeT : TypeDecl<"size_t"> {
18   let Decl = [{
19     #define __need_size_t
20     #include <stddef.h>
21   }];
22 }
23
24 def NullMacro : MacroDef<"NULL"> {
25   let Defn = [{
26     #define __need_NULL
27     #include <stddef.h>
28   }];
29 }
30
31 def MathAPI : PublicAPI<"math.h"> {
32   let Functions = [
33    "acos",
34    "acosl",
35   ];
36
37   let TypeDeclarations = [
38     FloatT,
39   ];
40 }
41
42 def StringAPI : PublicAPI<"string.h"> {
43   let Functions = [
44     "memcpy",
45     "memmove",
46     "memcmp",
47     "memchr",
48     "memset",
49     "strcpy",
50     "strncpy",
51     "strcat",
52     "strncat",
53     "strcmp",
54     "strcoll",
55     "strncmp",
56     "strxfrm",
57     "strchr",
58     "strcspn",
59     "strpbrk",
60     "strrchr",
61     "strspn",
62     "strstr",
63     "strtok",
64     "strerror",
65     "strlen",
66   ];
67
68   let TypeDeclarations = [
69     SizeT,
70   ];
71
72   let Macros = [
73     NullMacro,
74   ];
75 }
76
77 def StdIOAPI : PublicAPI<"stdio.h"> {
78   let TypeDeclarations = [
79     SizeT,
80   ];
81
82   let Functions = [
83     "snprintf",
84   ];
85 }