Skip to content

Commit e17b17d

Browse files
authored
[libc] added yaml_combined files, frontend for new headergen (#96833)
These are the yaml files that have combined functions from different libraries Rose will be adding the rest of the yaml in the next pr Missing assert.yaml -- work in progress
1 parent 061e3aa commit e17b17d

File tree

16 files changed

+4109
-11
lines changed

16 files changed

+4109
-11
lines changed

libc/newhdrgen/class_implementation/classes/function.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,16 @@ def __init__(
1616
self.standards = standards
1717
self.return_type = return_type
1818
self.name = name
19-
self.arguments = [arg["type"] for arg in arguments]
19+
self.arguments = [
20+
arg if isinstance(arg, str) else arg["type"] for arg in arguments
21+
]
2022
self.guard = guard
21-
self.attributes = attributes
23+
self.attributes = attributes or []
2224

2325
def __str__(self):
24-
args_str = ", ".join(self.arguments)
2526
attributes_str = " ".join(self.attributes)
26-
result = f"{self.return_type} {self.name}({args_str}){attributes_str};"
27+
arguments_str = ", ".join(self.arguments)
28+
result = f"{self.return_type} {self.name}({arguments_str}){attributes_str};"
2729
if self.guard:
2830
result = f"#ifdef {self.guard}\n{result}\n#endif // {self.guard}"
2931
return result
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
header: ctype.h
2+
macros: []
3+
types: []
4+
enums: []
5+
objects: []
6+
functions:
7+
- name: isalnum
8+
standards:
9+
- stdc
10+
return_type: int
11+
arguments:
12+
- type: int
13+
- name: isalpha
14+
standards:
15+
- stdc
16+
return_type: int
17+
arguments:
18+
- type: int
19+
- name: isblank
20+
standards:
21+
- stdc
22+
return_type: int
23+
arguments:
24+
- type: int
25+
- name: iscntrl
26+
standards:
27+
- stdc
28+
return_type: int
29+
arguments:
30+
- type: int
31+
- name: isdigit
32+
standards:
33+
- stdc
34+
return_type: int
35+
arguments:
36+
- type: int
37+
- name: isgraph
38+
standards:
39+
- stdc
40+
return_type: int
41+
arguments:
42+
- type: int
43+
- name: islower
44+
standards:
45+
- stdc
46+
return_type: int
47+
arguments:
48+
- type: int
49+
- name: isprint
50+
standards:
51+
- stdc
52+
return_type: int
53+
arguments:
54+
- type: int
55+
- name: ispunct
56+
standards:
57+
- stdc
58+
return_type: int
59+
arguments:
60+
- type: int
61+
- name: isspace
62+
standards:
63+
- stdc
64+
return_type: int
65+
arguments:
66+
- type: int
67+
- name: isupper
68+
standards:
69+
- stdc
70+
return_type: int
71+
arguments:
72+
- type: int
73+
- name: isxdigit
74+
standards:
75+
- stdc
76+
return_type: int
77+
arguments:
78+
- type: int
79+
- name: tolower
80+
standards:
81+
- stdc
82+
return_type: int
83+
arguments:
84+
- type: int
85+
- name: toupper
86+
standards:
87+
- stdc
88+
return_type: int
89+
arguments:
90+
- type: int
91+
functions:
92+
- name: isascii
93+
standards:
94+
- POSIX
95+
return_type: int
96+
arguments:
97+
- type: int
98+
- name: toascii
99+
standards:
100+
- GNUExtensions
101+
return_type: int
102+
arguments:
103+
- type: int
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
header: fenv.h
2+
macros: []
3+
types:
4+
- type_name: fenv_t
5+
- type_name: fexcept_t
6+
enums: []
7+
objects: []
8+
functions:
9+
- name: feclearexcept
10+
standards:
11+
- stdc
12+
return_type: int
13+
arguments:
14+
- type: int
15+
- name: fetestexcept
16+
standards:
17+
- stdc
18+
return_type: int
19+
arguments:
20+
- type: int
21+
- name: fetestexceptflag
22+
standards:
23+
- stdc
24+
return_type: int
25+
arguments:
26+
- type: const fexcept_t *
27+
- type: int
28+
- name: feraiseexcept
29+
standards:
30+
- stdc
31+
return_type: int
32+
arguments:
33+
- type: int
34+
- name: fesetround
35+
standards:
36+
- stdc
37+
return_type: int
38+
arguments:
39+
- type: int
40+
- name: fegetround
41+
standards:
42+
- stdc
43+
return_type: int
44+
arguments: []
45+
- name: fegetenv
46+
standards:
47+
- stdc
48+
return_type: int
49+
arguments:
50+
- type: fenv_t *
51+
- name: fesetenv
52+
standards:
53+
- stdc
54+
return_type: int
55+
arguments:
56+
- type: const fenv_t *
57+
- name: fegetexceptflag
58+
standards:
59+
- stdc
60+
return_type: int
61+
arguments:
62+
- type: fexcept_t *
63+
- type: int
64+
- name: fesetexcept
65+
standards:
66+
- stdc
67+
return_type: int
68+
arguments:
69+
- type: int
70+
- name: fesetexceptflag
71+
standards:
72+
- stdc
73+
return_type: int
74+
arguments:
75+
- type: const fexcept_t *
76+
- type: int
77+
- name: feholdexcept
78+
standards:
79+
- stdc
80+
return_type: int
81+
arguments:
82+
- type: fenv_t *
83+
- name: feupdateenv
84+
standards:
85+
- stdc
86+
return_type: int
87+
arguments:
88+
- type: const fenv_t *
89+
- name: fedisableexcept
90+
standards:
91+
- GNUExtensions
92+
return_type: int
93+
arguments:
94+
- type: int
95+
guard: null
96+
- name: feenableexcept
97+
standards:
98+
- GNUExtensions
99+
return_type: int
100+
arguments:
101+
- type: int
102+
attributes: []
103+
- name: fegetexcept
104+
standards:
105+
- GNUExtensions
106+
return_type: int
107+
arguments: []

0 commit comments

Comments
 (0)