libtui
Loading...
Searching...
No Matches
libtui_buffer.h
Go to the documentation of this file.
1#ifndef LIBTUI_BUFFER_H
2#define LIBTUI_BUFFER_H
3
17#include <stdlib.h>
18
29 char *buf;
30 size_t rows;
31 size_t columns;
32};
33
44struct libtui_buffer *libtui_buffer_create(size_t column, size_t row);
45
58size_t libtui_buffer_get_index(const struct libtui_buffer *const buf, size_t x,
59 size_t y);
60
73void libtui_buffer_set(struct libtui_buffer *const buf, const char c, size_t x,
74 size_t y);
75
89char libtui_buffer_get(const struct libtui_buffer *const buf, size_t x,
90 size_t y);
91
103
105
106#endif
struct libtui_buffer * libtui_buffer_create(size_t column, size_t row)
Allocates and returns owned pointer to the struct libtui_buffer struct. WARNING: Internal function,...
Definition libtui_buffer.c:6
void libtui_buffer_free(struct libtui_buffer *buf)
Frees the struct libtui_buffer and the buffer inside it. WARNING: Internal Funcion,...
Definition libtui_buffer.c:51
size_t libtui_buffer_get_index(const struct libtui_buffer *const buf, size_t x, size_t y)
Gets x, y positions and maps them according to the buf which is 1-Dimensional. WARNING: Internal Func...
Definition libtui_buffer.c:30
void libtui_buffer_set(struct libtui_buffer *const buf, const char c, size_t x, size_t y)
Sets the char at a specific position. WARNING: Internal Funcion, end user shouldn't use this.
Definition libtui_buffer.c:36
char libtui_buffer_get(const struct libtui_buffer *const buf, size_t x, size_t y)
Gets the char at a specific location. WARNING: Internal Funcion, end user shouldn't use this.
Definition libtui_buffer.c:43
A struct that represents a 2D buffer. WARNING: Internal struct, end user shouldn't use this.
Definition libtui_buffer.h:27
char * buf
Owned by libtui_buffer.
Definition libtui_buffer.h:29