]> mj.ucw.cz Git - libucw.git/commitdiff
Added character class definitions, formerly in lib/string.h.
authorMartin Mares <mj@ucw.cz>
Tue, 5 Dec 2000 22:38:52 +0000 (22:38 +0000)
committerMartin Mares <mj@ucw.cz>
Tue, 5 Dec 2000 22:38:52 +0000 (22:38 +0000)
charset/unicode.h

index 5319e3718cbbe320ab07a3ded966dee771e0a86e..a01eb97c23d22b004cca1a60a9b17b7c103c480e 100644 (file)
@@ -7,12 +7,25 @@
 #ifndef _UNICODE_H
 #define _UNICODE_H
 
-#include <lib/config.h>
-#include <lib/string.h>
+#include "lib/config.h"
 
 extern byte *_U_cat[], *_U_sig[];
 extern word *_U_upper[], *_U_lower[], *_U_unaccent[];
 
+#define _C_UPPER 1                     /* Upper-case letters */
+#define _C_LOWER 2                     /* Lower-case letters */
+#define _C_PRINT 4                     /* Printable */
+#define _C_DIGIT 8                     /* Digits */
+#define _C_CTRL 16                     /* Control characters */
+#define _C_XDIGIT 32                   /* Hexadecimal digits */
+#define _C_BLANK 64                    /* Blanks */
+#define _C_INNER 128                   /* `inner punctuation' -- underscore etc. */
+
+#define _C_ALPHA (_C_UPPER | _C_LOWER)
+#define _C_ALNUM (_C_ALPHA | _C_DIGIT)
+#define _C_WORD (_C_ALNUM | _C_INNER)
+#define _C_WSTART (_C_ALPHA | _C_INNER)
+
 static inline uns Ucategory(word x)
 {
   if (_U_cat[x >> 8U])