summaryrefslogtreecommitdiff
path: root/libc/include
diff options
context:
space:
mode:
Diffstat (limited to 'libc/include')
-rw-r--r--libc/include/CMakeLists.txt12
-rw-r--r--libc/include/arpa/inet.yaml10
-rw-r--r--libc/include/llvm-libc-macros/CMakeLists.txt6
-rw-r--r--libc/include/llvm-libc-macros/nl-types-macros.h15
-rw-r--r--libc/include/llvm-libc-types/CMakeLists.txt1
-rw-r--r--libc/include/llvm-libc-types/nl_catd.h14
-rw-r--r--libc/include/nl_types.yaml35
7 files changed, 92 insertions, 1 deletions
diff --git a/libc/include/CMakeLists.txt b/libc/include/CMakeLists.txt
index 81360aac984e..a277690ae2e1 100644
--- a/libc/include/CMakeLists.txt
+++ b/libc/include/CMakeLists.txt
@@ -218,6 +218,9 @@ add_header_macro(
DEPENDS
.llvm_libc_common_h
.llvm-libc-macros.complex_macros
+ .llvm-libc-types.float128
+ .llvm-libc-types.cfloat128
+ .llvm-libc-types.cfloat16
)
add_header_macro(
@@ -768,6 +771,15 @@ add_header_macro(
.llvm-libc-macros.poll-macros
)
+add_header_macro(
+ nl_types
+ ../libc/include/nl_types.yaml
+ nl_types.h
+ DEPENDS
+ .llvm-libc-macros.nl_types_macros
+ .llvm-libc-types.nl_catd
+ )
+
# UEFI spec references "Uefi.h" so we use that name for compatibility
add_header_macro(
uefi
diff --git a/libc/include/arpa/inet.yaml b/libc/include/arpa/inet.yaml
index 10cd56d6ce78..6e0629072b6e 100644
--- a/libc/include/arpa/inet.yaml
+++ b/libc/include/arpa/inet.yaml
@@ -1,7 +1,8 @@
header: arpa/inet.h
header_template: inet.h.def
macros: []
-types: []
+types:
+ - type_name: in_addr
enums: []
objects: []
functions:
@@ -17,6 +18,13 @@ functions:
return_type: uint16_t
arguments:
- type: uint16_t
+ - name: inet_aton
+ standards:
+ - llvm_libc_ext
+ return_type: int
+ arguments:
+ - type: const char *
+ - type: in_addr *
- name: ntohl
standards:
- POSIX
diff --git a/libc/include/llvm-libc-macros/CMakeLists.txt b/libc/include/llvm-libc-macros/CMakeLists.txt
index 76c03d913ee1..a33ff6cabbcf 100644
--- a/libc/include/llvm-libc-macros/CMakeLists.txt
+++ b/libc/include/llvm-libc-macros/CMakeLists.txt
@@ -346,6 +346,12 @@ add_macro_header(
)
add_macro_header(
+ nl_types_macros
+ HDR
+ nl-types-macros.h
+)
+
+add_macro_header(
pthread_macros
HDR
pthread-macros.h
diff --git a/libc/include/llvm-libc-macros/nl-types-macros.h b/libc/include/llvm-libc-macros/nl-types-macros.h
new file mode 100644
index 000000000000..b6d0d3519b51
--- /dev/null
+++ b/libc/include/llvm-libc-macros/nl-types-macros.h
@@ -0,0 +1,15 @@
+//===-- Definition of macros from nl_types.h ------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_LIBC_MACROS_NL_TYPES_MACROS_H
+#define LLVM_LIBC_MACROS_NL_TYPES_MACROS_H
+
+#define NL_SETD 1
+#define NL_CAT_LOCALE 1
+
+#endif // LLVM_LIBC_MACROS_NL_TYPES_MACROS_H
diff --git a/libc/include/llvm-libc-types/CMakeLists.txt b/libc/include/llvm-libc-types/CMakeLists.txt
index 5f506c4d25c9..a428a0e73aab 100644
--- a/libc/include/llvm-libc-types/CMakeLists.txt
+++ b/libc/include/llvm-libc-types/CMakeLists.txt
@@ -46,6 +46,7 @@ add_header(mbstate_t HDR mbstate_t.h)
add_header(mode_t HDR mode_t.h)
add_header(mtx_t HDR mtx_t.h DEPENDS .__futex_word .__mutex_type)
add_header(nfds_t HDR nfds_t.h)
+add_header(nl_catd HDR nl_catd.h)
add_header(nlink_t HDR nlink_t.h)
add_header(off_t HDR off_t.h)
add_header(once_flag HDR once_flag.h DEPENDS .__futex_word)
diff --git a/libc/include/llvm-libc-types/nl_catd.h b/libc/include/llvm-libc-types/nl_catd.h
new file mode 100644
index 000000000000..ccdb0206713a
--- /dev/null
+++ b/libc/include/llvm-libc-types/nl_catd.h
@@ -0,0 +1,14 @@
+//===-- Definition of nl_catd type ----------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_LIBC_TYPES_NL_CATD_H
+#define LLVM_LIBC_TYPES_NL_CATD_H
+
+typedef void *nl_catd;
+
+#endif // LLVM_LIBC_TYPES_NL_CATD_H
diff --git a/libc/include/nl_types.yaml b/libc/include/nl_types.yaml
new file mode 100644
index 000000000000..bdb59a82a333
--- /dev/null
+++ b/libc/include/nl_types.yaml
@@ -0,0 +1,35 @@
+header: nl_types.h
+standards:
+ - posix
+macros:
+ - macro_name: NL_SETD
+ macro_header: nl-types-macros.h
+ - macro_name: NL_CAT_LOCALE
+ macro_header: nl-types-macros.h
+types:
+ - type_name: nl_catd
+enums: []
+objects: []
+functions:
+ - name: catopen
+ standards:
+ - posix
+ return_type: nl_catd
+ arguments:
+ - type: const char *
+ - type: int
+ - name: catclose
+ standards:
+ - posix
+ return_type: int
+ arguments:
+ - type: nl_catd
+ - name: catgets
+ standards:
+ - posix
+ return_type: char *
+ arguments:
+ - type: nl_catd
+ - type: int
+ - type: int
+ - type: const char*