16cd50e7bScgyurgyik //===-- Implementation of ispunct------------------------------------------===//
26cd50e7bScgyurgyik //
36cd50e7bScgyurgyik // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
46cd50e7bScgyurgyik // See https://llvm.org/LICENSE.txt for license information.
56cd50e7bScgyurgyik // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66cd50e7bScgyurgyik //
76cd50e7bScgyurgyik //===----------------------------------------------------------------------===//
86cd50e7bScgyurgyik 
96cd50e7bScgyurgyik #include "src/ctype/ispunct.h"
106cd50e7bScgyurgyik 
116cd50e7bScgyurgyik #include "src/__support/common.h"
12c120edc7SMichael Jones #include "src/__support/ctype_utils.h"
136cd50e7bScgyurgyik 
146cd50e7bScgyurgyik namespace __llvm_libc {
156cd50e7bScgyurgyik 
166cd50e7bScgyurgyik // TODO: Currently restricted to default locale.
176cd50e7bScgyurgyik // These should be extended using locale information.
18a0b65a7bSMichael Jones LLVM_LIBC_FUNCTION(int, ispunct, (int c)) {
19*9cdd4ea0SAlfonso Gregory   const unsigned ch = static_cast<unsigned>(c);
20*9cdd4ea0SAlfonso Gregory   return static_cast<int>(!internal::isalnum(ch) && internal::isgraph(ch));
216cd50e7bScgyurgyik }
226cd50e7bScgyurgyik 
236cd50e7bScgyurgyik } // namespace __llvm_libc
24