NeoMutt  2025-09-05-2-g4bf191
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
ctype2.h File Reference

ctype(3) wrapper functions More...

#include <stdbool.h>
+ Include dependency graph for ctype2.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

bool mutt_isalnum (int arg)
 Wrapper for isalnum(3)
 
bool mutt_isalpha (int arg)
 Wrapper for isalpha(3)
 
bool mutt_isdigit (int arg)
 Wrapper for isdigit(3)
 
bool mutt_ispunct (int arg)
 Wrapper for ispunct(3)
 
bool mutt_isspace (int arg)
 Wrapper for isspace(3)
 
bool mutt_isxdigit (int arg)
 Wrapper for isxdigit(3)
 
int mutt_tolower (int arg)
 Wrapper for tolower(3)
 
int mutt_toupper (int arg)
 Wrapper for toupper(3)
 

Detailed Description

ctype(3) wrapper functions

Authors
  • Thomas Klausner

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Definition in file ctype2.h.

Function Documentation

◆ mutt_isalnum()

bool mutt_isalnum ( int  arg)

Wrapper for isalnum(3)

Parameters
argCharacter to test
Return values
trueCharacter is alphanumeric

Definition at line 39 of file ctype.c.

40{
41 if (isascii(arg))
42 return isalnum(arg);
43
44 return false;
45}
+ Here is the caller graph for this function:

◆ mutt_isalpha()

bool mutt_isalpha ( int  arg)

Wrapper for isalpha(3)

Parameters
argCharacter to test
Return values
trueCharacter is alphabetic

Definition at line 52 of file ctype.c.

53{
54 if (isascii(arg))
55 return isalpha(arg);
56
57 return false;
58}
+ Here is the caller graph for this function:

◆ mutt_isdigit()

bool mutt_isdigit ( int  arg)

Wrapper for isdigit(3)

Parameters
argCharacter to test
Return values
trueCharacter is a digit (0 through 9)

Definition at line 65 of file ctype.c.

66{
67 if (isascii(arg))
68 return isdigit(arg);
69
70 return false;
71}
+ Here is the caller graph for this function:

◆ mutt_ispunct()

bool mutt_ispunct ( int  arg)

Wrapper for ispunct(3)

Parameters
argCharacter to test
Return values
trueCharacter is printable but is not a space or alphanumeric

Definition at line 78 of file ctype.c.

79{
80 if (isascii(arg))
81 return ispunct(arg);
82
83 return false;
84}
+ Here is the caller graph for this function:

◆ mutt_isspace()

bool mutt_isspace ( int  arg)

Wrapper for isspace(3)

Parameters
argCharacter to test
Return values
trueCharacter is white-space

In the "C" and "POSIX" locales, these are: space, form-feed ('\f'), newline ('\n'), carriage return ('\r'), horizontal tab ('\t'), and vertical tab ('\v').

Definition at line 95 of file ctype.c.

96{
97 if (isascii(arg))
98 return isspace(arg);
99
100 return false;
101}
+ Here is the caller graph for this function:

◆ mutt_isxdigit()

bool mutt_isxdigit ( int  arg)

Wrapper for isxdigit(3)

Parameters
argCharacter to test
Return values
trueCharacter is a hexadecimal digits

That is, one of 0 1 2 3 4 5 6 7 8 9 a b c d e f A B C D E F.

Definition at line 110 of file ctype.c.

111{
112 if (isascii(arg))
113 return isxdigit(arg);
114
115 return false;
116}
+ Here is the caller graph for this function:

◆ mutt_tolower()

int mutt_tolower ( int  arg)

Wrapper for tolower(3)

Parameters
argCharacter to lowercase
Return values
numSuccess: Lower-case character
argFailure: Original character

Definition at line 125 of file ctype.c.

126{
127 if (isascii(arg))
128 return tolower(arg);
129
130 return arg;
131}
+ Here is the caller graph for this function:

◆ mutt_toupper()

int mutt_toupper ( int  arg)

Wrapper for toupper(3)

Parameters
argCharacter to uppercase
Return values
numSuccess: Upper-case character
argFailure: Original character

Definition at line 139 of file ctype.c.

140{
141 if (isascii(arg))
142 return toupper(arg);
143
144 return arg;
145}
+ Here is the caller graph for this function: