aboutsummaryrefslogtreecommitdiffstats
path: root/buf.h
diff options
context:
space:
mode:
Diffstat (limited to 'buf.h')
-rw-r--r--buf.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/buf.h b/buf.h
new file mode 100644
index 0000000..8ca6014
--- /dev/null
+++ b/buf.h
@@ -0,0 +1,43 @@
+#ifndef __IHE_BUF_H
+#define __IHE_BUF_H
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <stdint.h>
+#include <string.h>
+
+typedef struct buf_t
+{
+ uint8_t *buf;
+ int size;
+ int buf_size;
+} buf_t;
+
+/*
+create empty buffer structure
+*/
+buf_t* buf_init();
+/*
+if empty setup new buffer
+if not empty resize?
+*/
+int buf_size( buf_t *bf, int size );
+/*
+set used buffer size
+*/
+int buf_used_size( buf_t *bf, int size );
+/*
+change buffer size
+*/
+int buf_resize( buf_t *bf, int size );
+/*
+make buffer full of zeros
+*/
+int buf_zero( buf_t *bf );
+/*
+clean all buffer
+*/
+void buf_free( buf_t *bf );
+
+
+#endif \ No newline at end of file