Don't create the tooltips as topmost, and don't position them as topmost either but...
[TortoiseGit.git] / src / TortoiseMerge / svninclude / svn_ctype.h
blob58255ef9d9d62690d25efb13997254a07860a630
1 /**
2 * @copyright
3 * ====================================================================
4 * Licensed to the Apache Software Foundation (ASF) under one
5 * or more contributor license agreements. See the NOTICE file
6 * distributed with this work for additional information
7 * regarding copyright ownership. The ASF licenses this file
8 * to you under the Apache License, Version 2.0 (the
9 * "License"); you may not use this file except in compliance
10 * with the License. You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing,
15 * software distributed under the License is distributed on an
16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 * KIND, either express or implied. See the License for the
18 * specific language governing permissions and limitations
19 * under the License.
20 * ====================================================================
21 * @endcopyright
23 * @file svn_ctype.h
24 * @brief Character classification routines
25 * @since New in 1.2.
29 #ifndef SVN_CTYPE_H
30 #define SVN_CTYPE_H
32 #include <apr.h>
35 #ifdef __cplusplus
36 extern "C" {
37 #endif /* __cplusplus */
40 /** Table of flags for character classification. */
41 extern const apr_uint32_t *const svn_ctype_table;
44 /** Check if @a c is in the character class described by @a flags.
45 * The @a flags is a bitwise-or combination of @c SVN_CTYPE_*
46 * constants. Uses #svn_ctype_table.
48 #define svn_ctype_test(c, flags) \
49 (0 != (svn_ctype_table[(unsigned char)(c)] & (flags)))
52 /**
53 * @defgroup ctype_basic Basic character classification - 7-bit ASCII only
54 * @{
57 /* Basic character classes */
58 #define SVN_CTYPE_CNTRL 0x0001 /**< Control character */
59 #define SVN_CTYPE_SPACE 0x0002 /**< Whitespace */
60 #define SVN_CTYPE_DIGIT 0x0004 /**< Decimal digit */
61 #define SVN_CTYPE_UPPER 0x0008 /**< Uppercase letter */
62 #define SVN_CTYPE_LOWER 0x0010 /**< Lowercase letter */
63 #define SVN_CTYPE_PUNCT 0x0020 /**< Punctuation mark */
64 #define SVN_CTYPE_XALPHA 0x0040 /**< Hexadecimal digits A to F */
65 #define SVN_CTYPE_ASCII 0x0080 /**< ASCII subset*/
67 /* Derived character classes */
68 /** ASCII letter */
69 #define SVN_CTYPE_ALPHA (SVN_CTYPE_LOWER | SVN_CTYPE_UPPER)
70 /** ASCII letter or decimal digit */
71 #define SVN_CTYPE_ALNUM (SVN_CTYPE_ALPHA | SVN_CTYPE_DIGIT)
72 /** ASCII hexadecimal digit */
73 #define SVN_CTYPE_XDIGIT (SVN_CTYPE_DIGIT | SVN_CTYPE_XALPHA)
74 /** Printable ASCII except space */
75 #define SVN_CTYPE_GRAPH (SVN_CTYPE_PUNCT | SVN_CTYPE_ALNUM)
76 /** All printable ASCII */
77 #define SVN_CTYPE_PRINT (SVN_CTYPE_GRAPH | SVN_CTYPE_SPACE)
80 /** Check if @a c is an ASCII control character. */
81 #define svn_ctype_iscntrl(c) svn_ctype_test((c), SVN_CTYPE_CNTRL)
83 /** Check if @a c is an ASCII whitespace character. */
84 #define svn_ctype_isspace(c) svn_ctype_test((c), SVN_CTYPE_SPACE)
86 /** Check if @a c is an ASCII digit. */
87 #define svn_ctype_isdigit(c) svn_ctype_test((c), SVN_CTYPE_DIGIT)
89 /** Check if @a c is an ASCII uppercase letter. */
90 #define svn_ctype_isupper(c) svn_ctype_test((c), SVN_CTYPE_UPPER)
92 /** Check if @a c is an ASCII lowercase letter. */
93 #define svn_ctype_islower(c) svn_ctype_test((c), SVN_CTYPE_LOWER)
95 /** Check if @a c is an ASCII punctuation mark. */
96 #define svn_ctype_ispunct(c) svn_ctype_test((c), SVN_CTYPE_PUNCT)
98 /** Check if @a c is an ASCII character. */
99 #define svn_ctype_isascii(c) svn_ctype_test((c), SVN_CTYPE_ASCII)
101 /** Check if @a c is an ASCII letter. */
102 #define svn_ctype_isalpha(c) svn_ctype_test((c), SVN_CTYPE_ALPHA)
104 /** Check if @a c is an ASCII letter or decimal digit. */
105 #define svn_ctype_isalnum(c) svn_ctype_test((c), SVN_CTYPE_ALNUM)
107 /** Check if @a c is an ASCII hexadecimal digit. */
108 #define svn_ctype_isxdigit(c) svn_ctype_test((c), SVN_CTYPE_XDIGIT)
110 /** Check if @a c is an ASCII graphical (visible printable) character. */
111 #define svn_ctype_isgraph(c) svn_ctype_test((c), SVN_CTYPE_GRAPH)
113 /** Check if @a c is an ASCII printable character. */
114 #define svn_ctype_isprint(c) svn_ctype_test((c), SVN_CTYPE_PRINT)
116 /** @} */
119 * @defgroup ctype_extra Extended character classification
120 * @{
123 /* Basic extended character classes */
124 #define SVN_CTYPE_UTF8LEAD 0x0100 /**< UTF-8 multibyte lead byte */
125 #define SVN_CTYPE_UTF8CONT 0x0200 /**< UTF-8 multibyte non-lead byte */
126 /* ### TBD
127 #define SVN_CTYPE_XMLNAME 0x0400
128 #define SVN_CTYPE_URISAFE 0x0800
131 /* Derived extended character classes */
132 /** Part of a UTF-8 multibyte character. */
133 #define SVN_CTYPE_UTF8MBC (SVN_CTYPE_UTF8LEAD | SVN_CTYPE_UTF8CONT)
134 /** All valid UTF-8 bytes. */
135 #define SVN_CTYPE_UTF8 (SVN_CTYPE_ASCII | SVN_CTYPE_UTF8MBC)
137 /** Check if @a c is a UTF-8 multibyte lead byte. */
138 #define svn_ctype_isutf8lead(c) svn_ctype_test((c), SVN_CTYPE_UTF8LEAD)
140 /** Check if @a c is a UTF-8 multibyte continuation (non-lead) byte. */
141 #define svn_ctype_isutf8cont(c) svn_ctype_test((c), SVN_CTYLE_UTF8CONT)
143 /** Check if @a c is part of a UTF-8 multibyte character. */
144 #define svn_ctype_isutf8mbc(c) svn_ctype_test((c), SVN_CTYPE_UTF8MBC)
146 /** Check if @a c is valid in UTF-8. */
147 #define svn_ctype_isutf8(c) svn_ctype_test((c), SVN_CTYPE_UTF8)
149 /** @} */
152 * @defgroup ctype_ascii ASCII character value constants
153 * @{
156 #define SVN_CTYPE_ASCII_MINUS 45 /**< ASCII value of '-' */
157 #define SVN_CTYPE_ASCII_DOT 46 /**< ASCII value of '.' */
158 #define SVN_CTYPE_ASCII_COLON 58 /**< ASCII value of ':' */
159 #define SVN_CTYPE_ASCII_UNDERSCORE 95 /**< ASCII value of '_' */
160 #define SVN_CTYPE_ASCII_TAB 9 /**< ASCII value of a tab */
161 #define SVN_CTYPE_ASCII_LINEFEED 10 /**< ASCII value of a line feed */
162 #define SVN_CTYPE_ASCII_CARRIAGERETURN 13
163 /**< ASCII value of a carriage return */
164 #define SVN_CTYPE_ASCII_DELETE 127
165 /**< ASCII value of a delete character */
168 /** @} */
171 * @defgroup ctype_case ASCII-subset case folding
172 * @{
176 * Compare two characters @a a and @a b, treating case-equivalent
177 * unaccented Latin (ASCII subset) letters as equal.
179 * Returns in integer greater than, equal to, or less than 0,
180 * according to whether @a a is considered greater than, equal to,
181 * or less than @a b.
183 * @since New in 1.5.
186 svn_ctype_casecmp(int a,
187 int b);
190 /** @} */
192 #ifdef __cplusplus
194 #endif /* __cplusplus */
196 #endif /* SVN_CTYPE_H */