]> CyberLeo.Net >> Repos - FreeBSD/releng/8.1.git/blob - lib/libedit/editline.3
Copy stable/8 to releng/8.1 in preparation for 8.1-RC1.
[FreeBSD/releng/8.1.git] / lib / libedit / editline.3
1 .\"     $NetBSD: editline.3,v 1.55 2007/01/12 16:31:13 christos Exp $
2 .\"
3 .\" Copyright (c) 1997-2003 The NetBSD Foundation, Inc.
4 .\" All rights reserved.
5 .\"
6 .\" This file was contributed to The NetBSD Foundation by Luke Mewburn.
7 .\"
8 .\" Redistribution and use in source and binary forms, with or without
9 .\" modification, are permitted provided that the following conditions
10 .\" are met:
11 .\" 1. Redistributions of source code must retain the above copyright
12 .\"    notice, this list of conditions and the following disclaimer.
13 .\" 2. Redistributions in binary form must reproduce the above copyright
14 .\"    notice, this list of conditions and the following disclaimer in the
15 .\"    documentation and/or other materials provided with the distribution.
16 .\" 3. Neither the name of The NetBSD Foundation nor the names of its
17 .\"    contributors may be used to endorse or promote products derived
18 .\"    from this software without specific prior written permission.
19 .\"
20 .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
21 .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
22 .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23 .\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
24 .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25 .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26 .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 .\" POSSIBILITY OF SUCH DAMAGE.
31 .\"
32 .\" $FreeBSD$
33 .\"
34 .Dd January 12, 2007
35 .Os
36 .Dt EDITLINE 3
37 .Sh NAME
38 .Nm editline ,
39 .Nm el_init ,
40 .Nm el_end ,
41 .Nm el_reset ,
42 .Nm el_gets ,
43 .Nm el_getc ,
44 .Nm el_push ,
45 .Nm el_parse ,
46 .Nm el_set ,
47 .Nm el_get ,
48 .Nm el_source ,
49 .Nm el_resize ,
50 .Nm el_line ,
51 .Nm el_insertstr ,
52 .Nm el_deletestr ,
53 .Nm history_init ,
54 .Nm history_end ,
55 .Nm history ,
56 .Nm tok_init ,
57 .Nm tok_end ,
58 .Nm tok_reset ,
59 .Nm tok_line ,
60 .Nm tok_str
61 .Nd line editor, history and tokenization functions
62 .Sh LIBRARY
63 .Lb libedit
64 .Sh SYNOPSIS
65 .In histedit.h
66 .Ft EditLine *
67 .Fn el_init "const char *prog" "FILE *fin" "FILE *fout" "FILE *ferr"
68 .Ft void
69 .Fn el_end "EditLine *e"
70 .Ft void
71 .Fn el_reset "EditLine *e"
72 .Ft const char *
73 .Fn el_gets "EditLine *e" "int *count"
74 .Ft int
75 .Fn el_getc "EditLine *e" "char *ch"
76 .Ft void
77 .Fn el_push "EditLine *e" "char *str"
78 .Ft int
79 .Fn el_parse "EditLine *e" "int argc" "const char *argv[]"
80 .Ft int
81 .Fn el_set "EditLine *e" "int op" "..."
82 .Ft int
83 .Fn el_get "EditLine *e" "int op" "..."
84 .Ft int
85 .Fn el_source "EditLine *e" "const char *file"
86 .Ft void
87 .Fn el_resize "EditLine *e"
88 .Ft const LineInfo *
89 .Fn el_line "EditLine *e"
90 .Ft int
91 .Fn el_insertstr "EditLine *e" "const char *str"
92 .Ft void
93 .Fn el_deletestr "EditLine *e" "int count"
94 .Ft History *
95 .Fn history_init
96 .Ft void
97 .Fn history_end "History *h"
98 .Ft int
99 .Fn history "History *h" "HistEvent *ev" "int op" "..."
100 .Ft Tokenizer *
101 .Fn tok_init "const char *IFS"
102 .Ft void
103 .Fn tok_end "Tokenizer *t"
104 .Ft void
105 .Fn tok_reset "Tokenizer *t"
106 .Ft int
107 .Fo tok_line
108 .Fa "Tokenizer *t" "const LineInfo *li" "int *argc" "const char **argv[]"
109 .Fa "int *cursorc" "int *cursoro"
110 .Fc
111 .Ft int
112 .Fn tok_str "Tokenizer *t" "const char *str" "int *argc" "const char **argv[]"
113 .Sh DESCRIPTION
114 The
115 .Nm
116 library provides generic line editing, history and tokenization functions,
117 similar to those found in
118 .Xr sh 1 .
119 .Pp
120 These functions are available in the
121 .Nm libedit
122 library (which needs the
123 .Nm libtermcap
124 library).
125 Programs should be linked with
126 .Fl ledit ltermcap .
127 .Sh LINE EDITING FUNCTIONS
128 The line editing functions use a common data structure,
129 .Fa EditLine ,
130 which is created by
131 .Fn el_init
132 and freed by
133 .Fn el_end .
134 .Pp
135 The following functions are available:
136 .Bl -tag -width 4n
137 .It Fn el_init
138 Initialise the line editor, and return a data structure
139 to be used by all other line editing functions.
140 .Fa prog
141 is the name of the invoking program, used when reading the
142 .Xr editrc 5
143 file to determine which settings to use.
144 .Fa fin ,
145 .Fa fout
146 and
147 .Fa ferr
148 are the input, output, and error streams (respectively) to use.
149 In this documentation, references to
150 .Dq the tty
151 are actually to this input/output stream combination.
152 .It Fn el_end
153 Clean up and finish with
154 .Fa e ,
155 assumed to have been created with
156 .Fn el_init .
157 .It Fn el_reset
158 Reset the tty and the parser.
159 This should be called after an error which may have upset the tty's
160 state.
161 .It Fn el_gets
162 Read a line from the tty.
163 .Fa count
164 is modified to contain the number of characters read.
165 Returns the line read if successful, or
166 .Dv NULL
167 if no characters were read or if an error occurred.
168 .It Fn el_getc
169 Read a character from the tty.
170 .Fa ch
171 is modified to contain the character read.
172 Returns the number of characters read if successful, \-1 otherwise.
173 .It Fn el_push
174 Pushes
175 .Fa str
176 back onto the input stream.
177 This is used by the macro expansion mechanism.
178 Refer to the description of
179 .Ic bind
180 .Fl s
181 in
182 .Xr editrc 5
183 for more information.
184 .It Fn el_parse
185 Parses the
186 .Fa argv
187 array (which is
188 .Fa argc
189 elements in size)
190 to execute builtin
191 .Nm
192 commands.
193 If the command is prefixed with
194 .Dq prog:
195 then
196 .Fn el_parse
197 will only execute the command if
198 .Dq prog
199 matches the
200 .Fa prog
201 argument supplied to
202 .Fn el_init .
203 The return value is
204 \-1 if the command is unknown,
205 0 if there was no error or
206 .Dq prog
207 did not match, or
208 1 if the command returned an error.
209 Refer to
210 .Xr editrc 5
211 for more information.
212 .It Fn el_set
213 Set
214 .Nm
215 parameters.
216 .Fa op
217 determines which parameter to set, and each operation has its
218 own parameter list.
219 .Pp
220 The following values for
221 .Fa op
222 are supported, along with the required argument list:
223 .Bl -tag -width 4n
224 .It Dv EL_PROMPT , Fa "char *(*f)(EditLine *)"
225 Define prompt printing function as
226 .Fa f ,
227 which is to return a string that contains the prompt.
228 .It Dv EL_RPROMPT , Fa "char *(*f)(EditLine *)"
229 Define right side prompt printing function as
230 .Fa f ,
231 which is to return a string that contains the prompt.
232 .It Dv EL_TERMINAL , Fa "const char *type"
233 Define terminal type of the tty to be
234 .Fa type ,
235 or to
236 .Ev TERM
237 if
238 .Fa type
239 is
240 .Dv NULL .
241 .It Dv EL_EDITOR , Fa "const char *mode"
242 Set editing mode to
243 .Fa mode ,
244 which must be one of
245 .Dq emacs
246 or
247 .Dq vi .
248 .It Dv EL_SIGNAL , Fa "int flag"
249 If
250 .Fa flag
251 is non-zero,
252 .Nm
253 will install its own signal handler for the following signals when
254 reading command input:
255 .Dv SIGCONT ,
256 .Dv SIGHUP ,
257 .Dv SIGINT ,
258 .Dv SIGQUIT ,
259 .Dv SIGSTOP ,
260 .Dv SIGTERM ,
261 .Dv SIGTSTP ,
262 and
263 .Dv SIGWINCH .
264 Otherwise, the current signal handlers will be used.
265 .It Dv EL_BIND , Xo
266 .Fa "const char *" ,
267 .Fa "..." ,
268 .Dv NULL
269 .Xc
270 Perform the
271 .Ic bind
272 builtin command.
273 Refer to
274 .Xr editrc 5
275 for more information.
276 .It Dv EL_ECHOTC , Xo
277 .Fa "const char *" ,
278 .Fa "..." ,
279 .Dv NULL
280 .Xc
281 Perform the
282 .Ic echotc
283 builtin command.
284 Refer to
285 .Xr editrc 5
286 for more information.
287 .It Dv EL_SETTC , Xo
288 .Fa "const char *" ,
289 .Fa "..." ,
290 .Dv NULL
291 .Xc
292 Perform the
293 .Ic settc
294 builtin command.
295 Refer to
296 .Xr editrc 5
297 for more information.
298 .It Dv EL_SETTY , Xo
299 .Fa "const char *" ,
300 .Fa "..." ,
301 .Dv NULL
302 .Xc
303 Perform the
304 .Ic setty
305 builtin command.
306 Refer to
307 .Xr editrc 5
308 for more information.
309 .It Dv EL_TELLTC , Xo
310 .Fa "const char *" ,
311 .Fa "..." ,
312 .Dv NULL
313 .Xc
314 Perform the
315 .Ic telltc
316 builtin command.
317 Refer to
318 .Xr editrc 5
319 for more information.
320 .It Dv EL_ADDFN , Xo
321 .Fa "const char *name" ,
322 .Fa "const char *help" ,
323 .Fa "unsigned char (*func)(EditLine *e, int ch)"
324 .Xc
325 Add a user defined function,
326 .Fn func ,
327 referred to as
328 .Fa name
329 which is invoked when a key which is bound to
330 .Fa name
331 is entered.
332 .Fa help
333 is a description of
334 .Fa name .
335 At invocation time,
336 .Fa ch
337 is the key which caused the invocation.
338 The return value of
339 .Fn func
340 should be one of:
341 .Bl -tag -width "CC_REDISPLAY"
342 .It Dv CC_NORM
343 Add a normal character.
344 .It Dv CC_NEWLINE
345 End of line was entered.
346 .It Dv CC_EOF
347 EOF was entered.
348 .It Dv CC_ARGHACK
349 Expecting further command input as arguments, do nothing visually.
350 .It Dv CC_REFRESH
351 Refresh display.
352 .It Dv CC_REFRESH_BEEP
353 Refresh display, and beep.
354 .It Dv CC_CURSOR
355 Cursor moved, so update and perform
356 .Dv CC_REFRESH .
357 .It Dv CC_REDISPLAY
358 Redisplay entire input line.
359 This is useful if a key binding outputs extra information.
360 .It Dv CC_ERROR
361 An error occurred.
362 Beep, and flush tty.
363 .It Dv CC_FATAL
364 Fatal error, reset tty to known state.
365 .El
366 .It Dv EL_HIST , Xo
367 .Fa "History *(*func)(History *, int op, ...)" ,
368 .Fa "const char *ptr"
369 .Xc
370 Defines which history function to use, which is usually
371 .Fn history .
372 .Fa ptr
373 should be the value returned by
374 .Fn history_init .
375 .It Dv EL_EDITMODE , Fa "int flag"
376 If
377 .Fa flag
378 is non-zero,
379 editing is enabled (the default).
380 Note that this is only an indication, and does not
381 affect the operation of
382 .Nm .
383 At this time, it is the caller's responsibility to
384 check this
385 (using
386 .Fn el_get )
387 to determine if editing should be enabled or not.
388 .It Dv EL_GETCFN , Fa "int (*f)(EditLine *, char *c)"
389 Define the character reading function as
390 .Fa f ,
391 which is to return the number of characters read and store them in
392 .Fa c .
393 This function is called internally by
394 .Fn el_gets
395 and
396 .Fn el_getc .
397 The builtin function can be set or restored with the special function
398 name
399 .Dv EL_BUILTIN_GETCFN .
400 .It Dv EL_CLIENTDATA , Fa "void *data"
401 Register
402 .Fa data
403 to be associated with this EditLine structure.
404 It can be retrieved with the corresponding
405 .Fn el_get
406 call.
407 .It Dv EL_SETFP , Fa "int fd" , Fa "FILE *fp"
408 Set the current
409 .Nm editline
410 file pointer for
411 .Dq input
412 .Fa fd
413 =
414 .Dv 0 ,
415 .Dq output
416 .Fa fd
417 =
418 .Dv 1 ,
419 or
420 .Dq error
421 .Fa fd
422 =
423 .Dv 2
424 from
425 .Fa fp .
426 .El
427 .It Fn el_get
428 Get
429 .Nm
430 parameters.
431 .Fa op
432 determines which parameter to retrieve into
433 .Fa result .
434 Returns 0 if successful, \-1 otherwise.
435 .Pp
436 The following values for
437 .Fa op
438 are supported, along with actual type of
439 .Fa result :
440 .Bl -tag -width 4n
441 .It Dv EL_PROMPT , Fa "char *(*f)(EditLine *)"
442 Return a pointer to the function that displays the prompt.
443 .It Dv EL_RPROMPT , Fa "char *(*f)(EditLine *)"
444 Return a pointer to the function that displays the rightside prompt.
445 .It Dv EL_EDITOR , Fa "const char *"
446 Return the name of the editor, which will be one of
447 .Dq emacs
448 or
449 .Dq vi .
450 .It Dv EL_GETTC , Fa "const char *name" , Fa "void *value"
451 Return non-zero if
452 .Fa name
453 is a valid
454 .Xr termcap 5
455 capability
456 and set
457 .Fa value
458 to the current value of that capability.
459 .It Dv EL_SIGNAL , Fa "int *"
460 Return non-zero if
461 .Nm
462 has installed private signal handlers (see
463 .Fn el_get
464 above).
465 .It Dv EL_EDITMODE , Fa "int *"
466 Return non-zero if editing is enabled.
467 .It Dv EL_GETCFN , Fa "int (**f)(EditLine *, char *)"
468 Return a pointer to the function that read characters, which is equal to
469 .Dv EL_BUILTIN_GETCFN
470 in the case of the default builtin function.
471 .It Dv EL_CLIENTDATA , Fa "void **data"
472 Retrieve
473 .Fa data
474 previously registered with the corresponding
475 .Fn el_set
476 call.
477 .It Dv EL_UNBUFFERED , Fa "int"
478 Sets or clears unbuffered mode.
479 In this mode,
480 .Fn el_gets
481 will return immediately after processing a single character.
482 .It Dv EL_PREP_TERM , Fa "int"
483 Sets or clears terminal editing mode.
484 .It Dv EL_GETFP , Fa "int fd", Fa "FILE **fp"
485 Return in
486 .Fa fp
487 the current
488 .Nm editline
489 file pointer for
490 .Dq input
491 .Fa fd
492 =
493 .Dv 0 ,
494 .Dq output
495 .Fa fd
496 =
497 .Dv 1 ,
498 or
499 .Dq error
500 .Fa fd
501 =
502 .Dv 2 .
503 .El
504 .It Fn el_source
505 Initialise
506 .Nm
507 by reading the contents of
508 .Fa file .
509 .Fn el_parse
510 is called for each line in
511 .Fa file .
512 If
513 .Fa file
514 is
515 .Dv NULL ,
516 try
517 .Pa $PWD/.editrc
518 then
519 .Pa $HOME/.editrc .
520 Refer to
521 .Xr editrc 5
522 for details on the format of
523 .Fa file .
524 .It Fn el_resize
525 Must be called if the terminal size changes.
526 If
527 .Dv EL_SIGNAL
528 has been set with
529 .Fn el_set ,
530 then this is done automatically.
531 Otherwise, it is the responsibility of the application to call
532 .Fn el_resize
533 on the appropriate occasions.
534 .It Fn el_line
535 Return the editing information for the current line in a
536 .Fa LineInfo
537 structure, which is defined as follows:
538 .Bd -literal
539 typedef struct lineinfo {
540     const char *buffer;    /* address of buffer */
541     const char *cursor;    /* address of cursor */
542     const char *lastchar;  /* address of last character */
543 } LineInfo;
544 .Ed
545 .Pp
546 .Fa buffer
547 is not NUL terminated.
548 This function may be called after
549 .Fn el_gets
550 to obtain the
551 .Fa LineInfo
552 structure pertaining to line returned by that function,
553 and from within user defined functions added with
554 .Dv EL_ADDFN .
555 .It Fn el_insertstr
556 Insert
557 .Fa str
558 into the line at the cursor.
559 Returns \-1 if
560 .Fa str
561 is empty or will not fit, and 0 otherwise.
562 .It Fn el_deletestr
563 Delete
564 .Fa count
565 characters before the cursor.
566 .El
567 .Sh HISTORY LIST FUNCTIONS
568 The history functions use a common data structure,
569 .Fa History ,
570 which is created by
571 .Fn history_init
572 and freed by
573 .Fn history_end .
574 .Pp
575 The following functions are available:
576 .Bl -tag -width 4n
577 .It Fn history_init
578 Initialise the history list, and return a data structure
579 to be used by all other history list functions.
580 .It Fn history_end
581 Clean up and finish with
582 .Fa h ,
583 assumed to have been created with
584 .Fn history_init .
585 .It Fn history
586 Perform operation
587 .Fa op
588 on the history list, with optional arguments as needed by the
589 operation.
590 .Fa ev
591 is changed accordingly to operation.
592 The following values for
593 .Fa op
594 are supported, along with the required argument list:
595 .Bl -tag -width 4n
596 .It Dv H_SETSIZE , Fa "int size"
597 Set size of history to
598 .Fa size
599 elements.
600 .It Dv H_GETSIZE
601 Get number of events currently in history.
602 .It Dv H_END
603 Cleans up and finishes with
604 .Fa h ,
605 assumed to be created with
606 .Fn history_init .
607 .It Dv H_CLEAR
608 Clear the history.
609 .It Dv H_FUNC , Xo
610 .Fa "void *ptr" ,
611 .Fa "history_gfun_t first" ,
612 .Fa "history_gfun_t next" ,
613 .Fa "history_gfun_t last" ,
614 .Fa "history_gfun_t prev" ,
615 .Fa "history_gfun_t curr" ,
616 .Fa "history_sfun_t set" ,
617 .Fa "history_vfun_t clear" ,
618 .Fa "history_efun_t enter" ,
619 .Fa "history_efun_t add"
620 .Xc
621 Define functions to perform various history operations.
622 .Fa ptr
623 is the argument given to a function when it is invoked.
624 .It Dv H_FIRST
625 Return the first element in the history.
626 .It Dv H_LAST
627 Return the last element in the history.
628 .It Dv H_PREV
629 Return the previous element in the history.
630 .It Dv H_NEXT
631 Return the next element in the history.
632 .It Dv H_CURR
633 Return the current element in the history.
634 .It Dv H_SET
635 Set the cursor to point to the requested element.
636 .It Dv H_ADD , Fa "const char *str"
637 Append
638 .Fa str
639 to the current element of the history, or perform the
640 .Dv H_ENTER
641 operation with argument
642 .Fa str
643 if there is no current element.
644 .It Dv H_APPEND , Fa "const char *str"
645 Append
646 .Fa str
647 to the last new element of the history.
648 .It Dv H_ENTER , Fa "const char *str"
649 Add
650 .Fa str
651 as a new element to the history, and, if necessary,
652 removing the oldest entry to keep the list to the created size.
653 If
654 .Dv H_SETUNIQUE
655 was has been called with a non-zero arguments, the element
656 will not be entered into the history if its contents match
657 the ones of the current history element.
658 If the element is entered
659 .Fn history
660 returns 1, if it is ignored as a duplicate returns 0.
661 Finally
662 .Fn history
663 returns \-1 if an error occurred.
664 .It Dv H_PREV_STR , Fa "const char *str"
665 Return the closest previous event that starts with
666 .Fa str .
667 .It Dv H_NEXT_STR , Fa "const char *str"
668 Return the closest next event that starts with
669 .Fa str .
670 .It Dv H_PREV_EVENT , Fa "int e"
671 Return the previous event numbered
672 .Fa e .
673 .It Dv H_NEXT_EVENT , Fa "int e"
674 Return the next event numbered
675 .Fa e .
676 .It Dv H_LOAD , Fa "const char *file"
677 Load the history list stored in
678 .Fa file .
679 .It Dv H_SAVE , Fa "const char *file"
680 Save the history list to
681 .Fa file .
682 .It Dv H_SETUNIQUE , Fa "int unique"
683 Set flag that adjacent identical event strings should not be entered
684 into the history.
685 .It Dv H_GETUNIQUE
686 Retrieve the current setting if adjacent identical elements should
687 be entered into the history.
688 .It Dv H_DEL , Fa "int e"
689 Delete the event numbered
690 .Fa e .
691 This function is only provided for
692 .Xr readline 3
693 compatibility.
694 The caller is responsible for free'ing the string in the returned
695 .Fa HistEvent .
696 .El
697 .Pp
698 The
699 .Fn history
700 function returns \*[Ge] 0 if the operation
701 .Fa op
702 succeeds.
703 Otherwise, \-1 is returned and
704 .Fa ev
705 is updated to contain more details about the error.
706 .El
707 .Sh TOKENIZATION FUNCTIONS
708 The tokenization functions use a common data structure,
709 .Fa Tokenizer ,
710 which is created by
711 .Fn tok_init
712 and freed by
713 .Fn tok_end .
714 .Pp
715 The following functions are available:
716 .Bl -tag -width 4n
717 .It Fn tok_init
718 Initialise the tokenizer, and return a data structure
719 to be used by all other tokenizer functions.
720 .Fa IFS
721 contains the Input Field Separators, which defaults to
722 .Aq space ,
723 .Aq tab ,
724 and
725 .Aq newline
726 if
727 .Dv NULL .
728 .It Fn tok_end
729 Clean up and finish with
730 .Fa t ,
731 assumed to have been created with
732 .Fn tok_init .
733 .It Fn tok_reset
734 Reset the tokenizer state.
735 Use after a line has been successfully tokenized
736 by
737 .Fn tok_line
738 or
739 .Fn tok_str
740 and before a new line is to be tokenized.
741 .It Fn tok_line
742 Tokenize
743 .Fa li ,
744 If successful, modify:
745 .Fa argv
746 to contain the words,
747 .Fa argc
748 to contain the number of words,
749 .Fa cursorc
750 (if not
751 .Dv NULL )
752 to contain the index of the word containing the cursor,
753 and
754 .Fa cursoro
755 (if not
756 .Dv NULL )
757 to contain the offset within
758 .Fa argv[cursorc]
759 of the cursor.
760 .Pp
761 Returns
762 0 if successful,
763 \-1 for an internal error,
764 1 for an unmatched single quote,
765 2 for an unmatched double quote,
766 and
767 3 for a backslash quoted
768 .Aq newline .
769 A positive exit code indicates that another line should be read
770 and tokenization attempted again.
771 .It Fn tok_str
772 A simpler form of
773 .Fn tok_line ;
774 .Fa str
775 is a NUL terminated string to tokenize.
776 .El
777 .\"XXX.Sh EXAMPLES
778 .\"XXX: provide some examples
779 .Sh SEE ALSO
780 .Xr sh 1 ,
781 .Xr signal 3 ,
782 .Xr termcap 3 ,
783 .Xr editrc 5 ,
784 .Xr termcap 5
785 .Sh HISTORY
786 The
787 .Nm
788 library first appeared in
789 .Bx 4.4 .
790 .Dv CC_REDISPLAY
791 appeared in
792 .Nx 1.3 .
793 .Dv CC_REFRESH_BEEP
794 and
795 .Dv EL_EDITMODE
796 appeared in
797 .Nx 1.4 .
798 .Dv EL_RPROMPT
799 appeared in
800 .Nx 1.5 .
801 .Sh AUTHORS
802 .An -nosplit
803 The
804 .Nm
805 library was written by
806 .An Christos Zoulas .
807 .An Luke Mewburn
808 wrote this manual and implemented
809 .Dv CC_REDISPLAY ,
810 .Dv CC_REFRESH_BEEP ,
811 .Dv EL_EDITMODE ,
812 and
813 .Dv EL_RPROMPT .
814 .Sh BUGS
815 At this time, it is the responsibility of the caller to
816 check the result of the
817 .Dv EL_EDITMODE
818 operation of
819 .Fn el_get
820 (after an
821 .Fn el_source
822 or
823 .Fn el_parse )
824 to determine if
825 .Nm
826 should be used for further input.
827 I.e.,
828 .Dv EL_EDITMODE
829 is purely an indication of the result of the most recent
830 .Xr editrc 5
831 .Ic edit
832 command.