1 /*** BEGIN INCLUDE FILE: wstkill.h ***/ 2 3 /* HISTORY COMMENTS: 4 1) change(88-08-08,Lee), approve(88-05-16,MCR7897), audit(88-09-19,Flegel): 5 Created. 6 END HISTORY COMMENTS */ 7 8 /* Function: 9 define structures and constants used in implementing the 10 kill ring for edit mode editing. 11 */ 12 13 #ifndef WSTKILL 14 15 /* size of kill buffer; should be at least maximum size of line edited */ 16 #define KILL_BUFF_SIZE 1024 17 18 /* This structure maintains a circular buffer which is used as a 19 kill ring. Each item placed in the kill ring has the following 20 format: 21 [2 bytes for item size] + [data bytes] + [2 bytes for item size] 22 23 Thus, a total of four additional bytes are stored with each item. 24 The size bytes at the beginning and end of the item allows for 25 bi-directional traversal of the kill ring. 26 27 head, tail, current and yank_index are indices to a circular buffer 28 and as such, their values are incremented or decremented using 29 modular arithmetic (of kill buffer size) to ensure they access 30 only valid kill buffer locations. 31 32 */ 33 34 typedef struct kill_buff_struct { 35 int head; /* indexes past most recently saved item */ 36 int head_item_size; /* size of most recently saved item */ 37 int tail; /* indexes to the least recently saved item */ 38 int tail_item_size; /* size of least recently saved item */ 39 int chars_free; /* number of bytes unused in kill buffer */ 40 int current; /* index to next item to retrieve */ 41 int current_size; /* size of next item to retrieve */ 42 int head_of_killbuff; /* flag indicating current = head */ 43 int yank_index; /* index into line edited of where last yanked */ 44 int yank_size; /* size of last item yanked */ 45 char kb [KILL_BUFF_SIZE]; /* kill buffer space */ 46 } KILL_BUFF_INFO; 47 48 49 /* global structure which serves as the kill ring */ 50 KILL_BUFF_INFO kill_info; 51 52 #define WSTKILL 53 #endif WSTKILL 54 55 /*** END INCLUDE FILE: wstkill.h ***/