Skip to content

Commit 8a8c33d

Browse files
committed
Update C++ stubs for ctype.h/cctype and wctype.h/cwctype
1 parent eccc416 commit 8a8c33d

File tree

4 files changed

+81
-3
lines changed

4 files changed

+81
-3
lines changed
Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,20 @@
1-
#include "ctype.h"
1+
#ifndef _GHLIBCPP_CCTYPE
2+
#define _GHLIBCPP_CCTYPE
3+
#include "ctype.h"
4+
namespace std {
5+
using ::isalnum;
6+
using ::isalpha;
7+
using ::isblank;
8+
using ::iscntrl;
9+
using ::isdigit;
10+
using ::isgraph;
11+
using ::islower;
12+
using ::isprint;
13+
using ::ispunct;
14+
using ::isspace;
15+
using ::isupper;
16+
using ::isxdigit;
17+
using ::tolower;
18+
using ::toupper;
19+
} // namespace std
20+
#endif // _GHLIBCPP_CCTYPE

cpp/common/test/includes/standard-library/ctype.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
#ifndef _GHLIBCPP_CTYPE
22
#define _GHLIBCPP_CTYPE
3-
namespace std {
3+
44
extern int isalnum(int);
55
extern int isalpha(int);
6+
extern int isblank(int);
67
extern int iscntrl(int);
78
extern int isdigit(int);
89
extern int islower(int);
@@ -14,5 +15,5 @@ extern int isupper(int);
1415
extern int isxdigit(int);
1516
extern int tolower(int);
1617
extern int toupper(int);
17-
} // namespace std
18+
1819
#endif // _GHLIBCPP_CTYPE
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,38 @@
11
#ifndef _GHLIBCPP_CWCTYPE
22
#define _GHLIBCPP_CWCTYPE
3+
#include "wctype.h"
34

45
namespace std {
6+
// Types
57
using ::wint_t;
8+
using ::wctype_t;
9+
using ::wctrans_t;
10+
11+
// Wide character classification functions
12+
using ::iswalnum;
13+
using ::iswalpha;
14+
using ::iswblank;
15+
using ::iswcntrl;
16+
using ::iswdigit;
17+
using ::iswgraph;
18+
using ::iswlower;
19+
using ::iswprint;
20+
using ::iswpunct;
21+
using ::iswspace;
22+
using ::iswupper;
23+
using ::iswxdigit;
24+
25+
// Wide character conversion functions
26+
using ::towlower;
27+
using ::towupper;
28+
29+
// Generic wide character classification functions
30+
using ::iswctype;
31+
using ::wctype;
32+
33+
// Generic wide character mapping functions
34+
using ::towctrans;
35+
using ::wctrans;
636
} // namespace std
737

838
#endif // _GHLIBCPP_CWCTYPE

cpp/common/test/includes/standard-library/wctype.h

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,33 @@
22
#define _GHLIBCPP_WCTYPE
33

44
typedef long wint_t;
5+
typedef long wctype_t;
6+
typedef long wctrans_t;
7+
8+
// Wide character classification functions
9+
extern int iswalnum(wint_t wc);
10+
extern int iswalpha(wint_t wc);
11+
extern int iswblank(wint_t wc);
12+
extern int iswcntrl(wint_t wc);
13+
extern int iswdigit(wint_t wc);
14+
extern int iswgraph(wint_t wc);
15+
extern int iswlower(wint_t wc);
16+
extern int iswprint(wint_t wc);
17+
extern int iswpunct(wint_t wc);
18+
extern int iswspace(wint_t wc);
19+
extern int iswupper(wint_t wc);
20+
extern int iswxdigit(wint_t wc);
21+
22+
// Wide character conversion functions
23+
extern wint_t towlower(wint_t wc);
24+
extern wint_t towupper(wint_t wc);
25+
26+
// Generic wide character classification functions
27+
extern int iswctype(wint_t wc, wctype_t desc);
28+
extern wctype_t wctype(const char *property);
29+
30+
// Generic wide character mapping functions
31+
extern wint_t towctrans(wint_t wc, wctrans_t desc);
32+
extern wctrans_t wctrans(const char *property);
533

634
#endif // _GHLIBCPP_WCTYPE

0 commit comments

Comments
 (0)