Archived
1
Fork 0
This repository has been archived on 2024-10-07. You can view files and clone it, but cannot push or open issues or pull requests.
kilo/include/buffer.h

31 lines
674 B
C
Raw Normal View History

2023-09-01 15:04:12 +00:00
#ifndef BUFFER_H
#define BUFFER_H
2023-09-03 11:01:22 +00:00
#include "utils.h"
2023-09-01 15:04:12 +00:00
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);
2023-09-03 11:01:22 +00:00
ERRCODE buffer_write_file(struct buffer *buffer);
2023-09-01 15:04:12 +00:00
void erow_update_rendering(struct erow *erow);
void erow_insert_char(struct erow *erow, int at, char c);
2023-09-01 15:04:12 +00:00
int erow_cx_to_rx(struct erow *erow, int cx);
int erow_rx_to_cx(struct erow *erow, int rx);
#endif // BUFFER_H