-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuffer.h
More file actions
29 lines (24 loc) · 845 Bytes
/
buffer.h
File metadata and controls
29 lines (24 loc) · 845 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#ifndef __ELI_BUFFER_H__
#define __ELI_BUFFER_H__
#include <stdbool.h>
#include <stddef.h>
struct Line;
struct Buffer {
char *name;
struct Buffer *prev, *next;
struct Line *line, *beg, *end;
size_t size;
size_t row, col;
};
struct Buffer* buf_new(const char *name);
void buf_free(struct Buffer *buf);
bool buf_read(struct Buffer *buf, const char *name);
bool buf_write(struct Buffer *buf, const char *name);
bool buf_moverow(struct Buffer *buf, size_t row);
bool buf_movecol(struct Buffer *buf, size_t col);
void buf_pushfront(struct Buffer *buf, struct Line *line);
void buf_pushback(struct Buffer *buf, struct Line *line);
void buf_insert(struct Buffer *buf, struct Line *dst, struct Line *line);
void buf_erase(struct Buffer *buf, struct Line *line);
void buf_clear(struct Buffer *buf);
#endif /* __ELI_BUFFER_H__ */