SimpleKernel 1.17.0
Loading...
Searching...
No Matches
sk_ctype.c File Reference
#include "sk_ctype.h"
Include dependency graph for sk_ctype.c:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int isalnum (int c)
 
int isalpha (int c)
 
int isblank (int c)
 
int iscntrl (int c)
 
int isdigit (int c)
 
int isgraph (int c)
 
int islower (int c)
 
int isprint (int c)
 
int ispunct (int c)
 
int isspace (int c)
 
int isupper (int c)
 
int isxdigit (int c)
 
int tolower (int c)
 
int toupper (int c)
 

Function Documentation

◆ isalnum()

int isalnum ( int  c)

Definition at line 11 of file sk_ctype.c.

11{ return (isalpha(c) || isdigit(c)); }
#define isdigit
#define isalpha

◆ isalpha()

int isalpha ( int  c)

Definition at line 13 of file sk_ctype.c.

13{ return (islower(c) || isupper(c)); }
#define isupper
#define islower

◆ isblank()

int isblank ( int  c)

Definition at line 15 of file sk_ctype.c.

15{ return (c == ' ' || c == '\t'); }

◆ iscntrl()

int iscntrl ( int  c)

Definition at line 17 of file sk_ctype.c.

17{ return ((c >= 0 && c <= 31) || c == 127); }

◆ isdigit()

int isdigit ( int  c)

Definition at line 19 of file sk_ctype.c.

19{ return (c >= '0' && c <= '9'); }

◆ isgraph()

int isgraph ( int  c)

Definition at line 21 of file sk_ctype.c.

21{ return (c >= 33 && c <= 126); }

◆ islower()

int islower ( int  c)

Definition at line 23 of file sk_ctype.c.

23{ return (c >= 'a' && c <= 'z'); }

◆ isprint()

int isprint ( int  c)

Definition at line 25 of file sk_ctype.c.

25{ return (c >= 32 && c <= 126); }

◆ ispunct()

int ispunct ( int  c)

Definition at line 27 of file sk_ctype.c.

27{ return (isgraph(c) && !isalnum(c)); }
#define isgraph
#define isalnum

◆ isspace()

int isspace ( int  c)

Definition at line 29 of file sk_ctype.c.

29 {
30 return (c == ' ' || c == '\f' || c == '\n' || c == '\r' || c == '\t' ||
31 c == '\v');
32}

◆ isupper()

int isupper ( int  c)

Definition at line 34 of file sk_ctype.c.

34{ return (c >= 'A' && c <= 'Z'); }

◆ isxdigit()

int isxdigit ( int  c)

Definition at line 36 of file sk_ctype.c.

36 {
37 return (isdigit(c) || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F'));
38}

◆ tolower()

int tolower ( int  c)

Definition at line 40 of file sk_ctype.c.

40 {
41 if (isupper(c)) {
42 return c + ('a' - 'A');
43 }
44 return c;
45}

◆ toupper()

int toupper ( int  c)

Definition at line 47 of file sk_ctype.c.

47 {
48 if (islower(c)) {
49 return c - ('a' - 'A');
50 }
51 return c;
52}