1 05/10/16 window_editor_utils_
2
3
4 A library of editor utility routines is provided for the benefit of
5 user-written editor routines. Some operations can be performed
6 simply by a user-written editor routine. For example, to position
7 the cursor to the end of the line, set the cursor_index variable to
8 one greater than the value of the line_length variable. Most
9 actions are more complex than this, however. So it is recommended
10 that the following editor utility routines be used to perform most
11 changes.
12
13 The following is a description of these routines. In all cases,
14 line_editor_info_ptr is the pointer to the editor data structure
15 that is supplied as an argument to user-written editor routines.
16
17
18 Entry points in window_editor_utils_:
19
20
21 :Entry: insert_text: 07/31/92 window_editor_utils_$insert_text
22
23 Function: Inserts the supplied character string into the input buffer
24 at the current cursor location. If the string is too large to fit in
25 the remaining buffer space, the code
26 error_table_$action_not_performed is returned. This routine updates
27 the line_length field of the line_editor_info structure, and the
28 cursor_index if necessary.
29
30
31 Syntax:
32 dcl window_editor_utils_$insert_text entry ptr char* fixed bin 35;
33
34 call window_editor_utils_$insert_text line_editor_info_ptr "text"
35 code;
36
37
38 Arguments:
39 line_editor_info_ptr
40 pointer to editor data structure. Input/Output
41 "text"
42 text string to be inserted. Input
43 code
44 status code. Output
45
46
47 :Entry: delete_text: 07/31/92 window_editor_utils_$delete_text
48
49 Function: Deletes a specified number of characters from the input
50 buffer at the current cursor location. If there are not enough
51 characters remaining between the cursor and the end of the line,
52 error_table_$action_not_performed is returned and no characters are
53 deleted. The line_length component of the line_editor_info_structure
54 is updated, and the cursor_index if necessary.
55
56
57 Syntax:
58 dcl window_editor_utils_$delete_text entry ptr fixed bin fixed bin 35;
59
60 call window_editor_utils_$delete_text line_editor_info_ptr count
61 code;
62
63
64 Arguments:
65 line_editor_info_ptr
66 pointer to editor data structure. Input/Output
67 count
68 number of characters to be deleted. Input
69 code
70 status code. Output
71
72
73 :Entry: delete_text_save: 07/31/92 window_editor_utils_$delete_text_save
74
75 Function: This entrypoint is identical to delete_text, except that
76 the deleted text is added to the kill ring. The kill_direction flag
77 is used during kill merging to decide whether the killed text will be
78 concatenated onto the beginning or end of the current kill ring
79 element. "1"b is used to specify a forward kill e.g.
80 FORWARD_DELETE_WORD, "0" a backward kill.
81
82
83 Syntax:
84 dcl window_editor_utils_$delete_text_save entry
85 ptr fixed bin bit1 fixed bin 35;
86 call window_editor_utils_$delete_text_save
87 line_editor_info_ptr count kill_direction code;
88
89
90 Arguments:
91 line_editor_info_ptr
92 pointer to editor data structure. Input/Output
93 count
94 number of characters to be deleted. Input
95 kill_direction
96 flag to determine which end of current kill ring element
97 deleted text will be concatenated to. Input
98 code
99 status code. Output
100
101
102 :Entry: move_forward: 07/31/92 window_editor_utils_$move_forward
103
104 Function: Advances the cursor forward a specified number of
105 characters in the input line. If there are not enough characters
106 between the cursor and the end of the line,
107 error_table_$action_not_performed is returned.
108
109
110 Syntax:
111 dcl window_editor_utils_$move_forward entry ptr fixed bin fixed bin 35;
112
113 call window_editor_utils_$move_forward line_editor_info_ptr
114 count code;
115
116
117 Arguments:
118 line_editor_info_ptr
119 pointer to editor data structure. Input/Output
120 count
121 number of characters to move forward. Input
122 code
123 status code. Output
124
125
126 :Entry: move_backward: 07/31/92 window_editor_utils_$move_backward
127
128 Function: Moves the cursor backward a specified number of characters
129 in the input line. If there are not enough characters between the
130 cursor and the end of the line, error_table_$action_not_performed is
131 returned.
132
133
134 Syntax:
135 dcl window_editor_utils_$move_backward entry ptr fixed bin fixed bin 35;
136
137 call window_editor_utils_$move_backward
138 line_editor_info_ptr count code;
139
140
141 Arguments:
142 line_editor_info_ptr
143 pointer to editor data structure. Input/Output
144 count
145 number of characters to move backward. Input
146 code
147 status code. Output
148
149
150 :Entry: move_forward_word: 07/31/92 window_editor_utils_$move_forward_word
151
152 Function: Updates the cursor_index to a position after the next word
153 or token in the input line. A word is defined via the editor's set
154 of token delimiters, set via the set_token_delimiters control order.
155
156
157 Syntax:
158 dcl window_editor_utils_$move_forward_word entry ptr fixed bin 35;
159
160 call window_editor_utils_$move_forward_word line_editor_info_ptr
161 code;
162
163
164 Arguments:
165 line_editor_info_ptr
166 pointer to editor data structure. Input/Output
167 code
168 status code. Output
169
170
171 :Entry: move_backward_word: 07/31/92 window_editor_utils_$move_backward_word
172
173 Function: Updates the cursor_index to a position before the
174 preceeding word or token in the input line. A word is defined via
175 the editor's set of token delimiters, set via the
176 set_token_delimiters control order.
177
178
179 Syntax:
180 dcl window_editor_utils_$move_backward_word entry ptr fixed bin 35;
181
182 call window_editor_utils_$move_backward_word
183 line_editor_info_ptr code;
184
185
186 Arguments:
187 line_editor_info_ptr
188 pointer to editor data structure. Input/Output
189 code
190 status code. Output
191
192
193 :Entry: get_top_kill_ring_string: 05/10/16 window_editor_utils_$get_top_kill_ring_string
194
195 Function: Returns the top kill ring element.
196
197
198 Syntax:
199 dcl window_editor_utils_$get_top_kill_ring_string entry
200 ptr char* varying fixed bin 35;
201 call window_editor_utils_$get_top_kill_ring_string
202 line_editor_info_ptr text code;
203
204
205 Arguments:
206 line_editor_info_ptr
207 pointer to editor data structure. Input/Output
208 text
209 string containing contents of top kill ring element. Output
210 code
211 status code. Output error_table_$long_record is returned if
212 the top element of the kill ring is longer than maxlengthtext.
213
214
215 :Entry: rotate_kill_ring: 07/31/92 window_editor_utils_$rotate_kill_ring
216
217 Function: Rotates the kill ring.
218
219
220 Syntax:
221 dcl window_editor_utils_$rotate_kill_ring entry ptr fixed bin 35;
222
223 call window_editor_utils_$rotate_kill_ring
224 line_editor_info_ptr code;
225
226
227 Arguments:
228 line_editor_info_ptr
229 pointer to editor data structure. Input/Output
230 code
231 status code. Output
232