summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibC
diff options
context:
space:
mode:
authorTim Schumacher <timschumi@gmx.de>2021-05-27 12:44:54 +0200
committerLinus Groh <mail@linusgroh.de>2021-05-30 14:56:50 +0100
commitc2b47c0676073678e9921a7eb37616af179d25da (patch)
treedd64594532e2427a2ee337f217f6c5a73d476a36 /Userland/Libraries/LibC
parentd364abe4d5ebd417757783474e88a1b154c3e0d6 (diff)
downloadserenity-c2b47c0676073678e9921a7eb37616af179d25da.zip
LibC: Add stubs for wctype and iswctype
Diffstat (limited to 'Userland/Libraries/LibC')
-rw-r--r--Userland/Libraries/LibC/CMakeLists.txt1
-rw-r--r--Userland/Libraries/LibC/wchar.h1
-rw-r--r--Userland/Libraries/LibC/wctype.cpp24
-rw-r--r--Userland/Libraries/LibC/wctype.h16
4 files changed, 42 insertions, 0 deletions
diff --git a/Userland/Libraries/LibC/CMakeLists.txt b/Userland/Libraries/LibC/CMakeLists.txt
index f5d9722bc7..99a640b194 100644
--- a/Userland/Libraries/LibC/CMakeLists.txt
+++ b/Userland/Libraries/LibC/CMakeLists.txt
@@ -56,6 +56,7 @@ set(LIBC_SOURCES
utime.cpp
utsname.cpp
wchar.cpp
+ wctype.cpp
)
file(GLOB AK_SOURCES CONFIGURE_DEPENDS "../../../AK/*.cpp")
diff --git a/Userland/Libraries/LibC/wchar.h b/Userland/Libraries/LibC/wchar.h
index 551b8b2300..35b192f939 100644
--- a/Userland/Libraries/LibC/wchar.h
+++ b/Userland/Libraries/LibC/wchar.h
@@ -16,6 +16,7 @@ __BEGIN_DECLS
#endif
typedef __WINT_TYPE__ wint_t;
+typedef unsigned long int wctype_t;
size_t wcslen(const wchar_t*);
wchar_t* wcscpy(wchar_t*, const wchar_t*);
diff --git a/Userland/Libraries/LibC/wctype.cpp b/Userland/Libraries/LibC/wctype.cpp
new file mode 100644
index 0000000000..7a68b7c389
--- /dev/null
+++ b/Userland/Libraries/LibC/wctype.cpp
@@ -0,0 +1,24 @@
+/*
+ * Copyright (c) 2021, the SerenityOS developers
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ */
+
+#include <AK/Format.h>
+#include <assert.h>
+#include <wctype.h>
+
+extern "C" {
+
+wctype_t wctype(const char*)
+{
+ dbgln("FIXME: Implement wctype()");
+ TODO();
+}
+
+int iswctype(wint_t, wctype_t)
+{
+ dbgln("FIXME: Implement iswctype()");
+ TODO();
+}
+}
diff --git a/Userland/Libraries/LibC/wctype.h b/Userland/Libraries/LibC/wctype.h
new file mode 100644
index 0000000000..6d91f8cc71
--- /dev/null
+++ b/Userland/Libraries/LibC/wctype.h
@@ -0,0 +1,16 @@
+/*
+ * Copyright (c) 2021, the SerenityOS developers
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ */
+
+#pragma once
+
+#include <wchar.h>
+
+__BEGIN_DECLS
+
+wctype_t wctype(const char* name);
+int iswctype(wint_t wc, wctype_t desc);
+
+__END_DECLS