NeoMutt  2025-12-11-1039-g550ac6
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
ctype.c File Reference

ctype(3) wrapper functions More...

#include <ctype.h>
#include <stdbool.h>
Include dependency graph for ctype.c:

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
  • Richard Russon

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 ctype.c.

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 40 of file ctype.c.

41{
42 if (isascii(arg))
43 return isalnum(arg);
44
45 return false;
46}
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 53 of file ctype.c.

54{
55 if (isascii(arg))
56 return isalpha(arg);
57
58 return false;
59}
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 66 of file ctype.c.

67{
68 if (isascii(arg))
69 return isdigit(arg);
70
71 return false;
72}
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 79 of file ctype.c.

80{
81 if (isascii(arg))
82 return ispunct(arg);
83
84 return false;
85}
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 96 of file ctype.c.

97{
98 if (isascii(arg))
99 return isspace(arg);
100
101 return false;
102}
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 111 of file ctype.c.

112{
113 if (isascii(arg))
114 return isxdigit(arg);
115
116 return false;
117}
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: