1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-03 20:02:46 +03:00

Remove #ifdef MULTIBYTE per hackers list discussion.

This commit is contained in:
Tatsuo Ishii
2002-08-29 07:22:30 +00:00
parent 8e80dbb849
commit ed7baeaf4d
31 changed files with 81 additions and 761 deletions

View File

@ -52,10 +52,7 @@ typedef struct
size_t re_nsub; /* number of parenthesized subexpressions */
const pg_wchar *re_endp; /* end pointer for REG_PEND */
struct re_guts *re_g; /* none of your business :-) */
#ifdef MULTIBYTE
pg_wchar *patsave; /* me too :-) */
#endif
} regex_t;
typedef struct

View File

@ -113,18 +113,13 @@ typedef struct
{
uch *ptr; /* -> uch [csetsize] */
uch mask; /* bit within array */
#ifdef MULTIBYTE
pg_wchar hash; /* hash code */
unsigned int lc; /* leading character (character-set) */
#else
uch hash; /* hash code */
#endif
size_t smultis;
char *multis; /* -> char[smulti] ab\0cd\0ef\0\0 */
} cset;
/* note that CHadd and CHsub are unsafe, and CHIN doesn't yield 0/1 */
#ifdef MULTIBYTE
#define CHlc(c) (((unsigned)(c)&0xff0000)>>16)
#define CHadd(cs, c) ((cs)->ptr[(unsigned)(c)&0xffff] |= (cs)->mask, (cs)->hash += (unsigned)(c)&0xffff,\
(cs)->lc = CHlc(c))
@ -135,15 +130,6 @@ typedef struct
* fns */
#define MCsub(p, cs, cp) mcsub(p, cs, cp)
#define MCin(p, cs, cp) mcin(p, cs, cp)
#else
#define CHadd(cs, c) ((cs)->ptr[(uch)(c)] |= (cs)->mask, (cs)->hash += (c))
#define CHsub(cs, c) ((cs)->ptr[(uch)(c)] &= ~(cs)->mask, (cs)->hash -= (c))
#define CHIN(cs, c) ((cs)->ptr[(uch)(c)] & (cs)->mask)
#define MCadd(p, cs, cp) mcadd(p, cs, cp) /* regcomp() internal
* fns */
#define MCsub(p, cs, cp) mcsub(p, cs, cp)
#define MCin(p, cs, cp) mcin(p, cs, cp)
#endif
/* stuff for character categories */
typedef unsigned char cat_t;
@ -182,16 +168,7 @@ struct re_guts
};
/* misc utilities */
#ifdef MULTIBYTE
#define OUT (16777216+1) /* 16777216 == 2^24 == 3 bytes */
#else
#define OUT (CHAR_MAX+1) /* a non-character value */
#endif
#ifdef MULTIBYTE
#define ISWORD(c) (((c) >= 0 && (c) <= UCHAR_MAX) && \
(isalnum((unsigned char) (c)) || (c) == '_'))
#else
#define ISWORD(c) (isalnum((unsigned char) (c)) || (c) == '_')
#endif

View File

@ -46,11 +46,7 @@
#define DUPMAX 100000000 /* xxx is this right? */
#define INFINITY (DUPMAX + 1)
#ifdef MULTIBYTE
#define NC (SHRT_MAX - SHRT_MIN + 1)
#else
#define NC (CHAR_MAX - CHAR_MIN + 1)
#endif
typedef unsigned char uch;