-
Notifications
You must be signed in to change notification settings - Fork 0
/
ctype_42.h
executable file
·81 lines (68 loc) · 2.74 KB
/
ctype_42.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ctype_42.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: akharrou <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/03/03 21:31:54 by akharrou #+# #+# */
/* Updated: 2019/05/28 18:01:48 by akharrou ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef CTYPE_42_H
# define CTYPE_42_H
/*
** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** **
*/
# include <string.h>
/*
** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** **
*/
# define ISBLANK(c) (c == ' ' || c == '\t')
# define ISSPACE(c) (ISBLANK (c) || c >= 10 && c <= 13)
# define ISDIGIT(c) (c >= '0' && c <= '9')
# define ISLOWER(c) (c >= 'a' && c <= 'z')
# define ISUPPER(c) (c >= 'A' && c <= 'Z')
# define ISALPHA(c) (ISUPPER(c) || ISLOWER(c))
# define ISALNUM(c) (ISALPHA(c) || ISDIGIT(c))
# define ISPRINT(c) (c >= 32 && c <= 126)
# define ISGRAPH(c) (c >= 33 && c <= 126)
# define ISPUNCT(c) (ISGRAPH(c) && !ISALNUM(c))
# define ISCNTRL(c) (!ISPRINT(c))
# define ISASCII(c) (c >= 0 && <= 127)
# define ISGREATER(x, y) (x > y)
# define ISLESSER(x, y) (x < y)
# define ISEQUAL(x, y) (x == y)
/*
** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** **
*/
int ft_isupper(int c);
int ft_islower(int c);
int ft_isblank(int c);
int ft_isspace(int c);
int ft_isalpha(int c);
int ft_isdigit(int c);
int ft_isalnum(int c);
int ft_isascii(int c);
int ft_isgraph(int c);
int ft_ispunct(int c);
int ft_iscntrl(int c);
int ft_isprint(int c);
int ft_isprime(int n);
int ft_ischarset(int c, const char *seperators);
int ft_int_isany(int num1, int numbers, ...);
int ft_str_isany(const char *s1, int strings, ...);
int ft_isstrset(const char *str, const char **strset);
int ft_isstrsets(const char *str, int sets, ...);
int ft_toupper(int c);
int ft_tolower(int c);
char *ft_strtoupper(char *str);
char *ft_strtolower(char *str);
void *ft_to_big_endian(void *data, size_t size);
void *ft_to_little_endian(void *data, size_t size);
int ft_cmpstr(void *a, void *b);
int ft_reverse_cmpstr(void *a, void *b);
/*
** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** **
*/
#endif