diff options
Diffstat (limited to 'all_pairs/source/anagram/anagram_ctype.h')
-rw-r--r-- | all_pairs/source/anagram/anagram_ctype.h | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/all_pairs/source/anagram/anagram_ctype.h b/all_pairs/source/anagram/anagram_ctype.h new file mode 100644 index 0000000..ebb8232 --- /dev/null +++ b/all_pairs/source/anagram/anagram_ctype.h | |||
@@ -0,0 +1,45 @@ | |||
1 | /* | ||
2 | |||
3 | This header is part of the TACLeBench benchmark suite. | ||
4 | Version 2.0 | ||
5 | |||
6 | Name: anagram_ctype.h | ||
7 | |||
8 | Author: Raymond Chen | ||
9 | |||
10 | Function: This header contains some C library functions used by anagram. | ||
11 | |||
12 | Source: unknown | ||
13 | |||
14 | Original name: anagram | ||
15 | |||
16 | Changes: See ChangeLog.txt | ||
17 | |||
18 | License: See anagram.c | ||
19 | |||
20 | */ | ||
21 | |||
22 | #ifndef ANAGRAM_CTYPE_H | ||
23 | #define ANAGRAM_CTYPE_H | ||
24 | |||
25 | int anagram_islower( int c ) | ||
26 | { | ||
27 | return 'a' <= c && c <= 'z'; | ||
28 | } | ||
29 | |||
30 | int anagram_isupper( int c ) | ||
31 | { | ||
32 | return 'A' <= c && c <= 'Z'; | ||
33 | } | ||
34 | |||
35 | int anagram_isalpha( int c ) | ||
36 | { | ||
37 | return anagram_isupper( c ) || anagram_islower( c ); | ||
38 | } | ||
39 | |||
40 | int anagram_tolower( int c ) | ||
41 | { | ||
42 | return anagram_isupper( c ) ? c + ( 'a' - 'A' ) : c; | ||
43 | } | ||
44 | |||
45 | #endif | ||