2021-06-27 09:32:03 +03:00
|
|
|
#pragma once
|
2021-06-10 13:19:09 +03:00
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
|
2021-07-08 01:18:16 +03:00
|
|
|
typedef struct {
|
|
|
|
int size;
|
|
|
|
char data[];
|
|
|
|
} Buffer;
|
|
|
|
|
2021-06-10 13:19:09 +03:00
|
|
|
void* newBuffer(int bytes);
|
|
|
|
|
|
|
|
int getBufferSize(void* buffer);
|
|
|
|
|
|
|
|
void setBufferByte(void* buffer, int loc, int byte);
|
|
|
|
void setBufferInt(void* buffer, int loc, int64_t val);
|
|
|
|
void setBufferDouble(void* buffer, int loc, double val);
|
|
|
|
void setBufferString(void* buffer, int loc, char* str);
|
|
|
|
|
|
|
|
void copyBuffer(void* from, int start, int len,
|
|
|
|
void* to, int loc);
|
|
|
|
|
|
|
|
uint8_t getBufferByte(void* buffer, int loc);
|
|
|
|
int64_t getBufferInt(void* buffer, int loc);
|
|
|
|
double getBufferDouble(void* buffer, int loc);
|
|
|
|
char* getBufferString(void* buffer, int loc, int len);
|