comparison src/buffer.h @ 422:95016f13131a r21-2-19

Import from CVS: tag r21-2-19
author cvs
date Mon, 13 Aug 2007 11:25:01 +0200
parents 697ef44129c6
children 11054d720c21
comparison
equal deleted inserted replaced
421:fff06e11db74 422:95016f13131a
407 the character it's moving over. */ 407 the character it's moving over. */
408 408
409 #define REAL_INC_CHARPTR(ptr) \ 409 #define REAL_INC_CHARPTR(ptr) \
410 ((void) ((ptr) += REP_BYTES_BY_FIRST_BYTE (* (unsigned char *) (ptr)))) 410 ((void) ((ptr) += REP_BYTES_BY_FIRST_BYTE (* (unsigned char *) (ptr))))
411 411
412 #define REAL_INC_CHARBYTIND(ptr,pos) \
413 (pos += REP_BYTES_BY_FIRST_BYTE (* (unsigned char *) (ptr)))
414
412 #define REAL_DEC_CHARPTR(ptr) do { \ 415 #define REAL_DEC_CHARPTR(ptr) do { \
413 (ptr)--; \ 416 (ptr)--; \
414 } while (!VALID_CHARPTR_P (ptr)) 417 } while (!VALID_CHARPTR_P (ptr))
415 418
416 #ifdef ERROR_CHECK_BUFPOS 419 #ifdef ERROR_CHECK_BUFPOS
417 #define INC_CHARPTR(ptr) do { \ 420 #define INC_CHARPTR(ptr) do { \
418 ASSERT_VALID_CHARPTR (ptr); \ 421 ASSERT_VALID_CHARPTR (ptr); \
419 REAL_INC_CHARPTR (ptr); \ 422 REAL_INC_CHARPTR (ptr); \
423 } while (0)
424
425 #define INC_CHARBYTIND(ptr,pos) do { \
426 ASSERT_VALID_CHARPTR (ptr); \
427 REAL_INC_CHARBYTIND (ptr,pos); \
420 } while (0) 428 } while (0)
421 429
422 #define DEC_CHARPTR(ptr) do { \ 430 #define DEC_CHARPTR(ptr) do { \
423 CONST Bufbyte *dc_ptr1 = (ptr); \ 431 CONST Bufbyte *dc_ptr1 = (ptr); \
424 CONST Bufbyte *dc_ptr2 = dc_ptr1; \ 432 CONST Bufbyte *dc_ptr2 = dc_ptr1; \
427 REP_BYTES_BY_FIRST_BYTE (*dc_ptr2)); \ 435 REP_BYTES_BY_FIRST_BYTE (*dc_ptr2)); \
428 (ptr) = dc_ptr2; \ 436 (ptr) = dc_ptr2; \
429 } while (0) 437 } while (0)
430 438
431 #else /* ! ERROR_CHECK_BUFPOS */ 439 #else /* ! ERROR_CHECK_BUFPOS */
440 #define INC_CHARBYTIND(ptr,pos) REAL_INC_CHARBYTIND (ptr,pos)
432 #define INC_CHARPTR(ptr) REAL_INC_CHARPTR (ptr) 441 #define INC_CHARPTR(ptr) REAL_INC_CHARPTR (ptr)
433 #define DEC_CHARPTR(ptr) REAL_DEC_CHARPTR (ptr) 442 #define DEC_CHARPTR(ptr) REAL_DEC_CHARPTR (ptr)
434 #endif /* ! ERROR_CHECK_BUFPOS */ 443 #endif /* ! ERROR_CHECK_BUFPOS */
435 444
436 #ifdef MULE 445 #ifdef MULE