Hadeed Ahmad
fc5e50e4db
Doesn't compile yet. Dreading the time when it does and there's an error in the hundreds of lines I changed. For future: commit small changes that can be compiled and tested atomically.
31 lines
687 B
C
31 lines
687 B
C
#ifndef BUFFER_H
|
|
#define BUFFER_H
|
|
|
|
#include <stdbool.h>
|
|
#include <stddef.h>
|
|
|
|
#include "utils.h"
|
|
#include "erow.h"
|
|
|
|
struct buffer {
|
|
char *filename;
|
|
|
|
int cx, cy, rx;
|
|
int row_off, col_off;
|
|
|
|
struct erow **rows;
|
|
int n_rows;
|
|
|
|
bool modified;
|
|
};
|
|
|
|
struct buffer *buffer_create(void);
|
|
ERRCODE buffer_read_file(struct buffer *buffer, const char *filename);
|
|
ERRCODE buffer_write_file(struct buffer *buffer, size_t *bytes_written);
|
|
void buffer_insert_row(struct buffer *buffer, struct erow *erow, int at);
|
|
void buffer_delete_row(struct buffer *buffer, int at);
|
|
struct erow *buffer_get_crow(struct buffer *buffer);
|
|
void buffer_free(struct buffer *buffer);
|
|
|
|
|
|
#endif // BUFFER_H
|