eventstore-client-c/buffer.c

21 lines
361 B
C
Raw Normal View History

2018-03-19 06:08:57 +00:00
//
// Created by nicol on 2018-03-18.
//
#include <stdlib.h>
#include "buffer.h"
const buffer_t buffer_create(uint32_t size) {
buffer_t buf = {size, malloc(size)};
return buf;
}
const buffer_t buffer_from(uint8_t* data, uint32_t size) {
buffer_t buf = {size, data};
return buf;
}
void buffer_free(buffer_t buffer) {
free(buffer.data);
}