1 //---------------------------------------------------------------------------
4 //---------------------------------------------------------------------------
9 #define CODE_APOSTROPHE 0x9188 //
\81f
11 // typedefs and macros //
13 typedef wchar_t tuchar;
14 typedef wchar_t tchar;
15 #define LD_CHAR(c,p) c = *p++;
16 #define ST_CHAR(c,p) *p++ = c;
17 #define MOV_CHAR(p,q) *p++ = *q++;
18 #define IS_ENDCHAR(c) (!(c))
19 #define NEXT_CHAR(p) CharNextW(p)
21 #define _tcslen wcslen
26 typedef unsigned char tuchar;
28 #define LD_CHAR(c, p) {c = (unsigned char)*(*(unsigned char**)&p)++; if(_ismbblead(c)) c = (unsigned short)(((unsigned short)c << 8) + (unsigned char)*(*(unsigned char**)&p)++);}
29 #define ST_CHAR(c, p) {if ((unsigned short)c > 0x100) *(*(unsigned char**)&p)++ = (unsigned char)(c >> 8); *(*(unsigned char**)&p)++ = (unsigned char)c;}
30 #define MOV_CHAR(p, q) { unsigned char c = *(*(unsigned char**)&q)++ = *(*(unsigned char**)&p)++; if ( _ismbblead( c ) ) *(*(unsigned char**)&q)++ = *(*(unsigned char**)&p)++; }
31 #define IS_ENDCHAR(c) (!((unsigned char)(c)))
32 #define NEXT_CHAR(p) CharNextA(p)
33 #define _tcslen strlen
38 typedef unsigned int uint;
39 typedef unsigned short ushort;
41 #define STR_DIFF( p1, p2 ) ( (uint)( (tchar*)(p1) - (tchar*)(p2) ) )
44 int isalphanum( tuchar c );
45 bool mbIsWordChar( unsigned short c );
46 BOOL GetWord( const tchar *str, int pos, int &start, int &end, int &prevstart, bool fLongest, int wordcount, bool about, bool alnum );
47 bool mbGetWord( const tchar *str, int pos, int &start, int &end, bool fLongest, int wordcount );
50 inline bool IsWordChar( tuchar c )
54 GetStringTypeW(CT_CTYPE1,&c,1,&ct);
55 return (ct & (C1_ALPHA|C1_DIGIT)) || c=='-' || c==CODE_JPROLONG || c=='\'' || c=='_';
57 return isalphanum( c ) || c == '-' || c == '\'' || c >= 0xc0;
61 inline bool IsNotWordChar( tuchar c )
65 GetStringTypeW(CT_CTYPE1,&c,1,&ct);
66 return (ct & (C1_SPACE|C1_PUNCT|C1_CNTRL|C1_BLANK)) ? true : false;
68 return !IsWordChar(c);