27 lines
546 B
C
27 lines
546 B
C
|
#ifndef BUFFER_H
|
||
|
#define BUFFER_H
|
||
|
|
||
|
struct erow {
|
||
|
char *chars;
|
||
|
int n_chars;
|
||
|
|
||
|
char *rchars;
|
||
|
int n_rchars;
|
||
|
};
|
||
|
|
||
|
struct buffer {
|
||
|
char *filename;
|
||
|
struct erow *rows;
|
||
|
int n_rows;
|
||
|
};
|
||
|
|
||
|
struct buffer *buffer_create(void);
|
||
|
void buffer_read_file(struct buffer *buffer, const char *filename);
|
||
|
void buffer_append_row(struct buffer *buffer, const char *chars, int n_chars);
|
||
|
|
||
|
void erow_update_rendering(struct erow *erow);
|
||
|
int erow_cx_to_rx(struct erow *erow, int cx);
|
||
|
int erow_rx_to_cx(struct erow *erow, int rx);
|
||
|
|
||
|
#endif // BUFFER_H
|