frontend: add a line editor for shell input

This commit is contained in:
2024-11-18 09:53:55 +00:00
parent f44a3364b3
commit 4fc1a6ade8
22 changed files with 2137 additions and 0 deletions

14
frontend/line-ed/buffer.h Normal file
View File

@@ -0,0 +1,14 @@
#ifndef LINE_ED_BUFFER_H_
#define LINE_ED_BUFFER_H_
struct line_ed;
/* returns a pointer to the start of the line based on the given `y`
* coordinate */
extern const char *line_start(struct line_ed *ed, unsigned int y);
/* returns the length of the line based on the given `y` coordinate.
* for any line other than the last line in the buffer, this length
* INCLUDES the trailing linefeed. */
extern unsigned int line_length(struct line_ed *ed, unsigned int y);
#endif