Skip to content
Closed
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
3 changes: 3 additions & 0 deletions libc/config/baremetal/arm/entrypoints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,9 @@ set(TARGET_LIBC_ENTRYPOINTS
libc.src.wchar.wcslen
libc.src.wchar.wctob

# wctype.h entrypoints
libc.src.wctype.iswalpha

# internal entrypoints
libc.startup.baremetal.init
libc.startup.baremetal.fini
Expand Down
9 changes: 9 additions & 0 deletions libc/include/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -720,6 +720,15 @@ add_header_macro(
.llvm-libc-types.wchar_t
)

add_header_macro(
wctype
../libc/include/wctype.yaml
wctype.h
DEPENDS
.llvm_libc_common_h
.llvm-libc-types.wint_t
)

add_header_macro(
locale
../libc/include/locale.yaml
Expand Down
16 changes: 16 additions & 0 deletions libc/include/wctype.h.def
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//===-- C standard library header network.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_WCTYPE_H
#define LLVM_LIBC_WCTYPE_H

#include "__llvm-libc-common.h"

%%public_api()

#endif // LLVM_LIBC_WCTYPE_H
14 changes: 14 additions & 0 deletions libc/include/wctype.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
header: wctype.h
header_template: wctype.h.def
macros: []
types:
- type_name: wint_t
enums: []
objects: []
functions:
- name: iswalpha
standards:
- stdc
return_type: int
arguments:
- type: wint_t
1 change: 1 addition & 0 deletions libc/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ add_subdirectory(strings)
add_subdirectory(time)
add_subdirectory(unistd)
add_subdirectory(wchar)
add_subdirectory(wctype)

if(${LIBC_TARGET_OS} STREQUAL "linux")
add_subdirectory(dirent)
Expand Down
9 changes: 9 additions & 0 deletions libc/src/wctype/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
add_entrypoint_object(
iswalpha
SRCS
iswalpha.cpp
HDRS
iswalpha.h
DEPENDS
libc.src.__support.wctype_utils
)
21 changes: 21 additions & 0 deletions libc/src/wctype/iswalpha.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
//===-- Implementation of wctob -------------------------------------------===//
//
// 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
//
//===----------------------------------------------------------------------===//

#include "src/wctype/iswalpha.h"
#include "src/__support/common.h"
#include "src/__support/wctype_utils.h"

#include "hdr/types/wint_t.h"

namespace LIBC_NAMESPACE_DECL {

LLVM_LIBC_FUNCTION(bool, iswalpha, (wint_t c)) {
return internal::iswalpha(c);
}

} // namespace LIBC_NAMESPACE_DECL
21 changes: 21 additions & 0 deletions libc/src/wctype/iswalpha.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
//===-- Implementation header for iswalpha ----------------------*- C++ -*-===//
//
// 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_SRC_WCHAR_WCTOB_H
#define LLVM_LIBC_SRC_WCHAR_WCTOB_H

#include "hdr/types/wint_t.h"
#include "src/__support/common.h"

namespace LIBC_NAMESPACE_DECL {

bool iswalpha(wint_t c);

} // namespace LIBC_NAMESPACE_DECL

#endif // LLVM_LIBC_SRC_WCHAR_WCTOB_H
Loading