1 // Copyright 2016 The Fuchsia Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include <ctype.h>
6
isdigit(int c)7 int isdigit(int c) {
8 return (c >= '0') && (c <= '9');
9 }
10
isspace(int c)11 int isspace(int c) {
12 return (c == ' ') ||
13 (c == '\f') ||
14 (c == '\n') ||
15 (c == '\r') ||
16 (c == '\t') ||
17 (c == '\v');
18 }
19
tolower(int c)20 int tolower(int c) {
21 if (c >= 'A' && c <= 'Z') {
22 return c + ('a' - 'A');
23 }
24 return c;
25 }
26
27