X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=lib%2Fchartype.h;h=09dc1ec4c69c92f309d19e19675e2d27fb0d302e;hb=ebc61451614fb62a13e55c3974f538a06b7463a8;hp=16118b9fa64c730a710a9060181ada4ce2f0060d;hpb=edaee717448dedce382b0f5313a3712361b79ca8;p=libucw.git diff --git a/lib/chartype.h b/lib/chartype.h index 16118b9f..09dc1ec4 100644 --- a/lib/chartype.h +++ b/lib/chartype.h @@ -1,11 +1,14 @@ /* - * Sherlock Library -- Character Types + * UCW Library -- Character Types * - * (c) 1997 Martin Mares, + * (c) 1997--2004 Martin Mares + * + * This software may be freely distributed and used according to the terms + * of the GNU Lesser General Public License. */ -#ifndef _SHERLOCK_CHARTYPE_H -#define _SHERLOCK_CHARTYPE_H +#ifndef _UCW_CHARTYPE_H +#define _UCW_CHARTYPE_H #define _C_UPPER 1 /* Upper-case letters */ #define _C_LOWER 2 /* Lower-case letters */ @@ -13,7 +16,7 @@ #define _C_DIGIT 8 /* Digits */ #define _C_CTRL 16 /* Control characters */ #define _C_XDIGIT 32 /* Hexadecimal digits */ -#define _C_BLANK 64 /* Blanks */ +#define _C_BLANK 64 /* White spaces (spaces, tabs, newlines) */ #define _C_INNER 128 /* `inner punctuation' -- underscore etc. */ #define _C_ALPHA (_C_UPPER | _C_LOWER) @@ -21,7 +24,7 @@ #define _C_WORD (_C_ALNUM | _C_INNER) #define _C_WSTART (_C_ALPHA | _C_INNER) -extern unsigned char _c_cat[256], _c_upper[256], _c_collate[256], _c_order[256]; +extern const unsigned char _c_cat[256], _c_upper[256], _c_lower[256]; #define Category(x) (_c_cat[(unsigned char)(x)]) #define Ccat(x,y) (Category(x) & y) @@ -39,6 +42,7 @@ extern unsigned char _c_cat[256], _c_upper[256], _c_collate[256], _c_order[256]; #define Cspace(x) Cblank(x) #define Cupcase(x) _c_upper[(unsigned char)(x)] +#define Clocase(x) _c_lower[(unsigned char)(x)] #define Cxvalue(x) (((x)<'A')?((x)-'0'):(((x)&0xdf)-'A'+10))