diff options
| author | bozo.kopic <bozo@kopic.xyz> | 2022-08-02 01:20:12 +0200 |
|---|---|---|
| committer | bozo.kopic <bozo@kopic.xyz> | 2022-09-25 02:40:23 +0200 |
| commit | 288727f09a1b3458c268497d111349e608c3f9fa (patch) | |
| tree | d62565249fa3c7127856c65405752572fc41aca9 /src_c/buff.h | |
Diffstat (limited to 'src_c/buff.h')
| -rw-r--r-- | src_c/buff.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src_c/buff.h b/src_c/buff.h new file mode 100644 index 0000000..d17694c --- /dev/null +++ b/src_c/buff.h @@ -0,0 +1,23 @@ +#ifndef LISP16_BUFF_H +#define LISP16_BUFF_H + +#include "mem.h" +#include "status.h" + +#define LSP_BUFF_SIZE 32 + + +typedef struct { + lsp_mem_t *m; + lsp_addr_t value; + lsp_uint8_t buff[LSP_BUFF_SIZE]; + lsp_uint8_t buff_len; +} lsp_buff_t; + + +void lsp_buff_init(lsp_buff_t *b, lsp_mem_t *m); +lsp_status_t lsp_buff_push(lsp_buff_t *b, lsp_uint8_t c); +lsp_status_t lsp_buff_pop(lsp_buff_t *b, lsp_addr_t *value); +void lsp_buff_clear(lsp_buff_t *b); + +#endif |
