2024-11-18 09:53:55 +00:00
|
|
|
#ifndef LINE_ED_BUFFER_H_
|
|
|
|
|
#define LINE_ED_BUFFER_H_
|
|
|
|
|
|
2024-12-13 17:20:45 +00:00
|
|
|
#include <stddef.h>
|
|
|
|
|
|
2024-11-18 09:53:55 +00:00
|
|
|
struct line_ed;
|
|
|
|
|
|
|
|
|
|
/* returns a pointer to the start of the line based on the given `y`
|
|
|
|
|
* coordinate */
|
2024-12-13 17:20:45 +00:00
|
|
|
extern const char *line_start(struct line_ed *ed, size_t y);
|
2024-11-18 09:53:55 +00:00
|
|
|
/* 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. */
|
2024-12-13 17:20:45 +00:00
|
|
|
extern size_t line_length(struct line_ed *ed, size_t y);
|
2024-11-18 09:53:55 +00:00
|
|
|
|
|
|
|
|
#endif
|