LibC: Declare wide character type functions in wctype.h
Declares all wide character handling functions in wctype.h. All calls are forwarded to the corresponding character handling function in ctype.h. These functions are declared, but not implemented: - iswctype - wctype - towctrans - wctrans This should also resolve a build issue with the 'sed' port getting confused with iswprint being declared twice. Seems like it expected more functions from wctype.h and then had a backup strategy of adding its own wctype.h.
This commit is contained in:
parent
eb9c82a487
commit
7a4f59f638
Notes:
sideshowbarker
2024-07-18 08:19:43 +09:00
Author: https://github.com/kennethmyhra Commit: https://github.com/SerenityOS/serenity/commit/7a4f59f6388 Pull-request: https://github.com/SerenityOS/serenity/pull/8988 Reviewed-by: https://github.com/alimpfard
2 changed files with 103 additions and 9 deletions
|
@ -4,16 +4,68 @@
|
|||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <AK/Format.h>
|
||||
#include <assert.h>
|
||||
#include <wctype.h>
|
||||
|
||||
extern "C" {
|
||||
|
||||
wctype_t wctype(const char*)
|
||||
int iswalnum(wint_t wc)
|
||||
{
|
||||
dbgln("FIXME: Implement wctype()");
|
||||
TODO();
|
||||
return __inline_isalnum(wc);
|
||||
}
|
||||
|
||||
int iswalpha(wint_t wc)
|
||||
{
|
||||
return __inline_isalpha(wc);
|
||||
}
|
||||
|
||||
int iswcntrl(wint_t wc)
|
||||
{
|
||||
return __inline_iscntrl(wc);
|
||||
}
|
||||
|
||||
int iswdigit(wint_t wc)
|
||||
{
|
||||
return __inline_isdigit(wc);
|
||||
}
|
||||
|
||||
int iswxdigit(wint_t wc)
|
||||
{
|
||||
return __inline_isxdigit(wc);
|
||||
}
|
||||
|
||||
int iswspace(wint_t wc)
|
||||
{
|
||||
return __inline_isspace(wc);
|
||||
}
|
||||
|
||||
int iswpunct(wint_t wc)
|
||||
{
|
||||
return __inline_ispunct(wc);
|
||||
}
|
||||
|
||||
int iswprint(wint_t wc)
|
||||
{
|
||||
return __inline_isprint(wc);
|
||||
}
|
||||
|
||||
int iswgraph(wint_t wc)
|
||||
{
|
||||
return __inline_isgraph(wc);
|
||||
}
|
||||
|
||||
int iswlower(wint_t wc)
|
||||
{
|
||||
return __inline_islower(wc);
|
||||
}
|
||||
|
||||
int iswupper(wint_t wc)
|
||||
{
|
||||
return __inline_isupper(wc);
|
||||
}
|
||||
|
||||
int iswblank(wint_t wc)
|
||||
{
|
||||
return __inline_isblank(wc);
|
||||
}
|
||||
|
||||
int iswctype(wint_t, wctype_t)
|
||||
|
@ -22,9 +74,31 @@ int iswctype(wint_t, wctype_t)
|
|||
TODO();
|
||||
}
|
||||
|
||||
int iswprint(wint_t)
|
||||
wctype_t wctype(const char*)
|
||||
{
|
||||
dbgln("FIXME: Implement iswprint()");
|
||||
dbgln("FIXME: Implement wctype()");
|
||||
TODO();
|
||||
}
|
||||
|
||||
wint_t towlower(wint_t wc)
|
||||
{
|
||||
return __inline_tolower(wc);
|
||||
}
|
||||
|
||||
wint_t towupper(wint_t wc)
|
||||
{
|
||||
return __inline_toupper(wc);
|
||||
}
|
||||
|
||||
wint_t towctrans(wint_t, wctrans_t)
|
||||
{
|
||||
dbgln("FIXME: Implement towctrans()");
|
||||
TODO();
|
||||
}
|
||||
|
||||
wctrans_t wctrans(const char*)
|
||||
{
|
||||
dbgln("FIXME: Implement wctrans()");
|
||||
TODO();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,12 +6,32 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/Format.h>
|
||||
#include <assert.h>
|
||||
#include <ctype.h>
|
||||
#include <wchar.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
wctype_t wctype(const char* name);
|
||||
int iswctype(wint_t wc, wctype_t desc);
|
||||
typedef const int* wctrans_t;
|
||||
|
||||
int iswalnum(wint_t wc);
|
||||
int iswalpha(wint_t wc);
|
||||
int iswcntrl(wint_t wc);
|
||||
int iswdigit(wint_t wc);
|
||||
int iswxdigit(wint_t wc);
|
||||
int iswspace(wint_t wc);
|
||||
int iswpunct(wint_t wc);
|
||||
int iswprint(wint_t wc);
|
||||
int iswgraph(wint_t wc);
|
||||
int iswlower(wint_t wc);
|
||||
int iswupper(wint_t wc);
|
||||
int iswblank(wint_t wc);
|
||||
int iswctype(wint_t, wctype_t);
|
||||
wctype_t wctype(const char*);
|
||||
wint_t towlower(wint_t wc);
|
||||
wint_t towupper(wint_t wc);
|
||||
wint_t towctrans(wint_t, wctrans_t);
|
||||
wctrans_t wctrans(const char*);
|
||||
|
||||
__END_DECLS
|
||||
|
|
Loading…
Add table
Reference in a new issue