358 |
|
|
359 |
/* When UTF-8 encoding is being used, a character is no longer just a single |
/* When UTF-8 encoding is being used, a character is no longer just a single |
360 |
byte. The macros for character handling generate simple sequences when used in |
byte. The macros for character handling generate simple sequences when used in |
361 |
byte-mode, and more complicated ones for UTF-8 characters. */ |
byte-mode, and more complicated ones for UTF-8 characters. BACKCHAR should |
362 |
|
never be called in byte mode. To make sure it can never even appear when UTF-8 |
363 |
|
support is omitted, we don't even define it. */ |
364 |
|
|
365 |
#ifndef SUPPORT_UTF8 |
#ifndef SUPPORT_UTF8 |
366 |
#define GETCHAR(c, eptr) c = *eptr; |
#define GETCHAR(c, eptr) c = *eptr; |
368 |
#define GETCHARINC(c, eptr) c = *eptr++; |
#define GETCHARINC(c, eptr) c = *eptr++; |
369 |
#define GETCHARINCTEST(c, eptr) c = *eptr++; |
#define GETCHARINCTEST(c, eptr) c = *eptr++; |
370 |
#define GETCHARLEN(c, eptr, len) c = *eptr; |
#define GETCHARLEN(c, eptr, len) c = *eptr; |
371 |
#define BACKCHAR(eptr) |
/* #define BACKCHAR(eptr) */ |
372 |
|
|
373 |
#else /* SUPPORT_UTF8 */ |
#else /* SUPPORT_UTF8 */ |
374 |
|
|
461 |
} |
} |
462 |
|
|
463 |
/* If the pointer is not at the start of a character, move it back until |
/* If the pointer is not at the start of a character, move it back until |
464 |
it is. Called only in UTF-8 mode. */ |
it is. This is called only in UTF-8 mode - we don't put a test within the macro |
465 |
|
because almost all calls are already within a block of UTF-8 only code. */ |
466 |
|
|
467 |
#define BACKCHAR(eptr) while((*eptr & 0xc0) == 0x80) eptr--; |
#define BACKCHAR(eptr) while((*eptr & 0xc0) == 0x80) eptr-- |
468 |
|
|
469 |
#endif |
#endif |
470 |
|
|