-
Notifications
You must be signed in to change notification settings - Fork 0
How to use readlines in Minishell
Michael Leitner edited this page Apr 20, 2023
·
3 revisions
This is still a WIP
- Programming with readline
- GNU Documentation on readline
- PDF Documentation on readlin
- Programming with GNU History
- Readline man page
| name | library | description | return | required for |
|---|---|---|---|---|
| readline | stdio.h | reads a line from the terminal and returns it | NULL if EOF, empty for empty line, returns text of line as char*, needs to be free'd | reading input from the terminal |
| rl_clear_history | stdio.h | deletes all entries in history | none, void function | not sure yet |
| rl_on_new_line | stdio.h | tells the update routine that we have moved onto a new (empty) line | ||
| rl_replace_line | stdio.h | Replace the contents of rl_line_buffer with text passed as argument. The point and mark are preserved, if possible. If clear_undo (second argument) is non-zero, the undo list associated with the current line is cleared. | ||
| rl_redisplay | stdio.h | change what's displayed on the screen to the current content of rl_line_buffer | none, void function | |
| add_history | stdio.h | string passed as argument is placed at the end of the history list | none, void function | adding custom history, not sure yet |