🧵 str
Painfully common string utilities for C
Loading...
Searching...
No Matches
predicate.h
Go to the documentation of this file.
1/*
2 * 🧵 str — predicate.h
3 * Copyright (c) 2025–2026 Fawn <rubiefawn@gmail.com>
4 *
5 * Permission to use, copy, modify, and distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above
7 * copyright notice and this permission notice appear in all copies.
8 *
9 * THE SOFTWARE IS PROVIDED “AS IS” AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 */
17
20#pragma once
21#include "str.h"
22
29bool char_is_alnum(char c);
30
37bool char_is_alpha(char c);
38
45bool char_is_lower(char c);
46
53bool char_is_upper(char c);
54
61bool char_is_digit(char c);
62
69bool char_is_xdigit(char c);
70
77bool char_is_cntrl(char c);
78
85bool char_is_graph(char c);
86
93bool char_is_space(char c);
94
101bool char_is_blank(char c);
102
109bool char_is_print(char c);
110
117bool char_is_punct(char c);
118
122bool cstr_is_alnum(const char *c);
123
127bool cstr_is_alpha(const char *c);
128
132bool cstr_is_lower(const char *c);
133
137bool cstr_is_upper(const char *c);
138
142bool cstr_is_digit(const char *c);
143
147bool cstr_is_xdigit(const char *c);
148
152bool cstr_is_cntrl(const char *c);
153
157bool cstr_is_graph(const char *c);
158
162bool cstr_is_space(const char *c);
163
167bool cstr_is_blank(const char *c);
168
172bool cstr_is_print(const char *c);
173
177bool cstr_is_punct(const char *c);
178
183
188
193
198
203
208
213
218
223
228
233
bool cstr_is_upper(const char *c)
Checks if a string is entirely uppercase.
bool str_is_lower(str c)
Checks if a string is entirely lowercase.
bool char_is_cntrl(char c)
Checks if a character is control character.
bool char_is_lower(char c)
Checks if a character is lowercase.
bool str_is_xdigit(str c)
Checks if a string is entirely made of hexadecimal digits.
bool char_is_digit(char c)
Checks if a character is a digit.
bool str_is_space(str c)
Checks if a string is entirely made of space characters.
bool str_is_alpha(str c)
Checks if a string is entirely alphabetic.
bool cstr_is_lower(const char *c)
Checks if a string is entirely lowercase.
bool cstr_is_blank(const char *c)
Checks if a string is entirely made of blank characters.
bool str_is_alnum(str c)
Checks if a string is entirely alphanumeric.
bool char_is_blank(char c)
Checks if a character is a blank character.
bool char_is_upper(char c)
Checks if a character is uppercase.
bool char_is_alnum(char c)
Checks if a character is alphanumeric.
bool cstr_is_print(const char *c)
Checks if a string is entirely made of printing characters.
bool cstr_is_graph(const char *c)
Checks if a string is entirely made of graphical characters.
bool char_is_graph(char c)
Checks if a character is graphical character.
bool str_is_graph(str c)
Checks if a string is entirely made of graphical characters.
bool cstr_is_alpha(const char *c)
Checks if a string is entirely alphabetic.
bool str_is_print(str c)
Checks if a string is entirely made of printing characters.
bool char_is_print(char c)
Checks if a character is a printing character.
bool str_is_punct(str c)
Checks if a string is entirely made of punctuation characters.
bool char_is_xdigit(char c)
Checks if a character is a hexadecimal digit.
bool cstr_is_cntrl(const char *c)
Checks if a string is entirely made of control characters.
bool cstr_is_punct(const char *c)
Checks if a string is entirely made of punctuation characters.
bool str_is_digit(str c)
Checks if a string is entirely made of digits.
bool cstr_is_digit(const char *c)
Checks if a string is entirely made of digits.
bool char_is_space(char c)
Checks if a character is a space character.
bool str_is_upper(str c)
Checks if a string is entirely uppercase.
bool cstr_is_alnum(const char *c)
Checks if a string is entirely alphanumeric.
bool str_is_blank(str c)
Checks if a string is entirely made of blank characters.
bool str_is_cntrl(str c)
Checks if a string is entirely made of control characters.
bool cstr_is_space(const char *c)
Checks if a string is entirely made of space characters.
bool char_is_alpha(char c)
Checks if a character is alphabetic.
bool cstr_is_xdigit(const char *c)
Checks if a string is entirely made of hexadecimal digits.
bool char_is_punct(char c)
Checks if a character is a punctuation character.
Utilities for string slices.
A string "slice", which is a pointer & length pair.
Definition str.h:42