Skip to content

[libc] added yaml_combined files, frontend for new headergen #96833

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jun 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions libc/newhdrgen/class_implementation/classes/function.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,16 @@ def __init__(
self.standards = standards
self.return_type = return_type
self.name = name
self.arguments = [arg["type"] for arg in arguments]
self.arguments = [
arg if isinstance(arg, str) else arg["type"] for arg in arguments
]
self.guard = guard
self.attributes = attributes
self.attributes = attributes or []

def __str__(self):
args_str = ", ".join(self.arguments)
attributes_str = " ".join(self.attributes)
result = f"{self.return_type} {self.name}({args_str}){attributes_str};"
arguments_str = ", ".join(self.arguments)
result = f"{self.return_type} {self.name}({arguments_str}){attributes_str};"
if self.guard:
result = f"#ifdef {self.guard}\n{result}\n#endif // {self.guard}"
return result
103 changes: 103 additions & 0 deletions libc/newhdrgen/yaml_combined/ctype.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
header: ctype.h
macros: []
types: []
enums: []
objects: []
functions:
- name: isalnum
standards:
- stdc
return_type: int
arguments:
- type: int
- name: isalpha
standards:
- stdc
return_type: int
arguments:
- type: int
- name: isblank
standards:
- stdc
return_type: int
arguments:
- type: int
- name: iscntrl
standards:
- stdc
return_type: int
arguments:
- type: int
- name: isdigit
standards:
- stdc
return_type: int
arguments:
- type: int
- name: isgraph
standards:
- stdc
return_type: int
arguments:
- type: int
- name: islower
standards:
- stdc
return_type: int
arguments:
- type: int
- name: isprint
standards:
- stdc
return_type: int
arguments:
- type: int
- name: ispunct
standards:
- stdc
return_type: int
arguments:
- type: int
- name: isspace
standards:
- stdc
return_type: int
arguments:
- type: int
- name: isupper
standards:
- stdc
return_type: int
arguments:
- type: int
- name: isxdigit
standards:
- stdc
return_type: int
arguments:
- type: int
- name: tolower
standards:
- stdc
return_type: int
arguments:
- type: int
- name: toupper
standards:
- stdc
return_type: int
arguments:
- type: int
functions:
- name: isascii
standards:
- POSIX
return_type: int
arguments:
- type: int
- name: toascii
standards:
- GNUExtensions
return_type: int
arguments:
- type: int
107 changes: 107 additions & 0 deletions libc/newhdrgen/yaml_combined/fenv.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
header: fenv.h
macros: []
types:
- type_name: fenv_t
- type_name: fexcept_t
enums: []
objects: []
functions:
- name: feclearexcept
standards:
- stdc
return_type: int
arguments:
- type: int
- name: fetestexcept
standards:
- stdc
return_type: int
arguments:
- type: int
- name: fetestexceptflag
standards:
- stdc
return_type: int
arguments:
- type: const fexcept_t *
- type: int
- name: feraiseexcept
standards:
- stdc
return_type: int
arguments:
- type: int
- name: fesetround
standards:
- stdc
return_type: int
arguments:
- type: int
- name: fegetround
standards:
- stdc
return_type: int
arguments: []
- name: fegetenv
standards:
- stdc
return_type: int
arguments:
- type: fenv_t *
- name: fesetenv
standards:
- stdc
return_type: int
arguments:
- type: const fenv_t *
- name: fegetexceptflag
standards:
- stdc
return_type: int
arguments:
- type: fexcept_t *
- type: int
- name: fesetexcept
standards:
- stdc
return_type: int
arguments:
- type: int
- name: fesetexceptflag
standards:
- stdc
return_type: int
arguments:
- type: const fexcept_t *
- type: int
- name: feholdexcept
standards:
- stdc
return_type: int
arguments:
- type: fenv_t *
- name: feupdateenv
standards:
- stdc
return_type: int
arguments:
- type: const fenv_t *
- name: fedisableexcept
standards:
- GNUExtensions
return_type: int
arguments:
- type: int
guard: null
- name: feenableexcept
standards:
- GNUExtensions
return_type: int
arguments:
- type: int
attributes: []
- name: fegetexcept
standards:
- GNUExtensions
return_type: int
arguments: []
Loading
Loading