- regtail - set the next-pointer at the end of a node chain */
| 722 | - regtail - set the next-pointer at the end of a node chain |
| 723 | */ |
| 724 | static void |
| 725 | regtail( |
| 726 | char *p, |
| 727 | char *val ) |
| 728 | { |
| 729 | char *scan; |
| 730 | char *temp; |
| 731 | size_t offset; |
| 732 | |
| 733 | if (p == ®dummy) |
| 734 | return; |
| 735 | |
| 736 | /* Find last node. */ |
| 737 | scan = p; |
| 738 | for (;;) { |
| 739 | temp = regnext(scan); |
| 740 | if (temp == NULL) |
| 741 | break; |
| 742 | scan = temp; |
| 743 | } |
| 744 | |
| 745 | if (OP(scan) == BACK) |
| 746 | offset = scan - val; |
| 747 | else |
| 748 | offset = val - scan; |
| 749 | *(scan+1) = (offset>>8)&0377; |
| 750 | *(scan+2) = offset&0377; |
| 751 | } |
| 752 | |
| 753 | /* |
| 754 | - regoptail - regtail on operand of first argument; nop if operandless |