summaryrefslogtreecommitdiff
path: root/buf_misc.h
diff options
context:
space:
mode:
authorFreeArtMan <dos21h@gmail.com>2019-05-12 12:46:02 +0100
committerFreeArtMan <dos21h@gmail.com>2019-05-12 12:46:02 +0100
commit654bb8b09dd90c12c3a51ffdce800b2255b753b5 (patch)
tree67591880f34d6220b9026883b0ceb54f022aa385 /buf_misc.h
parent03bfeedc5f4c04c20764c8a9a58bd02604f27b2c (diff)
downloadlibbuf-654bb8b09dd90c12c3a51ffdce800b2255b753b5.tar.gz
libbuf-654bb8b09dd90c12c3a51ffdce800b2255b753b5.zip
Moved everything to C+. First test works
Diffstat (limited to 'buf_misc.h')
-rw-r--r--buf_misc.h27
1 files changed, 25 insertions, 2 deletions
diff --git a/buf_misc.h b/buf_misc.h
index c0d8aab..9eabd97 100644
--- a/buf_misc.h
+++ b/buf_misc.h
@@ -3,21 +3,44 @@
#include "buf.h"
+#define BUF_PATTER_SIZE 2
+
+/*
//line buffer, put data get line out
typedef struct bbuf_line
{
bbuf *buf;
+ char pattern[BUF_PATTER_SIZE];
char sep; //seperator character
} bbuf_line;
-int bbuf_line_new(bbuf_line *buf, char sep, int size);
+int bbuf_line_new(bbuf_line *buf, int size);
+int bbuf_line_pattern(bbuf_line *buf, char *patt, int size);
int bbuf_line_add(bbuf_line *buf_line, bbuf *new_data);
int bbuf_line_get_line(bbuf_line *buf_line, bbuf *line);
int bbuf_line_free(bbuf_line *buf);
+*/
+
+class BufLine
+{
+private:
+ Buf *buf;
+ char pattern[BUF_PATTER_SIZE];
+ char sep; //seperator character
+public:
+ BufLine(int size);
+ ~BufLine();
+ int set_pattern(char *pattern);
+ int add(char *string, int size);
+ int add(Buf *newdata);
+ int pop_line(char **val, int *size);
+};
+
//formating buf ops
//circular buffer
+/*
typedef struct bbuf_circ
{
bbuf *buf;
@@ -34,5 +57,5 @@ int bbuf_circ_put(bbuf_circ *circ, char data);
int bbuf_circ_empty(bbuf_circ *circ);
int bbuf_circ_full(bbuf_circ *circ);
int bbuf_circ_free(bbuf_circ *circ);
-
+*/
#endif