601 |
static int stack_idx_of_map_multiple; |
static int stack_idx_of_map_multiple; |
602 |
|
|
603 |
#define PUSH_MAPPING_STACK(restlen, orig) \ |
#define PUSH_MAPPING_STACK(restlen, orig) \ |
604 |
do { \ |
do \ |
605 |
|
{ \ |
606 |
mapping_stack_pointer->rest_length = (restlen); \ |
mapping_stack_pointer->rest_length = (restlen); \ |
607 |
mapping_stack_pointer->orig_val = (orig); \ |
mapping_stack_pointer->orig_val = (orig); \ |
608 |
mapping_stack_pointer++; \ |
mapping_stack_pointer++; \ |
609 |
} while (0) |
} \ |
610 |
|
while (0) |
611 |
|
|
612 |
#define POP_MAPPING_STACK(restlen, orig) \ |
#define POP_MAPPING_STACK(restlen, orig) \ |
613 |
do { \ |
do \ |
614 |
|
{ \ |
615 |
mapping_stack_pointer--; \ |
mapping_stack_pointer--; \ |
616 |
(restlen) = mapping_stack_pointer->rest_length; \ |
(restlen) = mapping_stack_pointer->rest_length; \ |
617 |
(orig) = mapping_stack_pointer->orig_val; \ |
(orig) = mapping_stack_pointer->orig_val; \ |
618 |
} while (0) |
} \ |
619 |
|
while (0) |
620 |
|
|
621 |
#define CCL_CALL_FOR_MAP_INSTRUCTION(symbol, ret_ic) \ |
#define CCL_CALL_FOR_MAP_INSTRUCTION(symbol, ret_ic) \ |
622 |
if (1) \ |
do \ |
623 |
{ \ |
{ \ |
624 |
struct ccl_program called_ccl; \ |
struct ccl_program called_ccl; \ |
625 |
if (stack_idx >= 256 \ |
if (stack_idx >= 256 \ |
639 |
ic = CCL_HEADER_MAIN; \ |
ic = CCL_HEADER_MAIN; \ |
640 |
goto ccl_repeat; \ |
goto ccl_repeat; \ |
641 |
} \ |
} \ |
642 |
else |
while (0) |
643 |
|
|
644 |
#define CCL_MapSingle 0x12 /* Map by single code conversion map |
#define CCL_MapSingle 0x12 /* Map by single code conversion map |
645 |
1:ExtendedCOMMNDXXXRRRrrrXXXXX |
1:ExtendedCOMMNDXXXRRRrrrXXXXX |
680 |
|
|
681 |
/* Terminate CCL program successfully. */ |
/* Terminate CCL program successfully. */ |
682 |
#define CCL_SUCCESS \ |
#define CCL_SUCCESS \ |
683 |
if (1) \ |
do \ |
684 |
{ \ |
{ \ |
685 |
ccl->status = CCL_STAT_SUCCESS; \ |
ccl->status = CCL_STAT_SUCCESS; \ |
686 |
goto ccl_finish; \ |
goto ccl_finish; \ |
687 |
} \ |
} \ |
688 |
else |
while(0) |
689 |
|
|
690 |
/* Suspend CCL program because of reading from empty input buffer or |
/* Suspend CCL program because of reading from empty input buffer or |
691 |
writing to full output buffer. When this program is resumed, the |
writing to full output buffer. When this program is resumed, the |
692 |
same I/O command is executed. */ |
same I/O command is executed. */ |
693 |
#define CCL_SUSPEND(stat) \ |
#define CCL_SUSPEND(stat) \ |
694 |
if (1) \ |
do \ |
695 |
{ \ |
{ \ |
696 |
ic--; \ |
ic--; \ |
697 |
ccl->status = stat; \ |
ccl->status = stat; \ |
698 |
goto ccl_finish; \ |
goto ccl_finish; \ |
699 |
} \ |
} \ |
700 |
else |
while (0) |
701 |
|
|
702 |
/* Terminate CCL program because of invalid command. Should not occur |
/* Terminate CCL program because of invalid command. Should not occur |
703 |
in the normal case. */ |
in the normal case. */ |
704 |
#define CCL_INVALID_CMD \ |
#define CCL_INVALID_CMD \ |
705 |
if (1) \ |
do \ |
706 |
{ \ |
{ \ |
707 |
ccl->status = CCL_STAT_INVALID_CMD; \ |
ccl->status = CCL_STAT_INVALID_CMD; \ |
708 |
goto ccl_error_handler; \ |
goto ccl_error_handler; \ |
709 |
} \ |
} \ |
710 |
else |
while(0) |
711 |
|
|
712 |
/* Encode one character CH to multibyte form and write to the current |
/* Encode one character CH to multibyte form and write to the current |
713 |
output buffer. If CH is less than 256, CH is written as is. */ |
output buffer. If CH is less than 256, CH is written as is. */ |