From 082dee0658b67744ab3428eea964f375f7aab9dc Mon Sep 17 00:00:00 2001 From: FreeArtMan Date: Sun, 12 May 2019 15:05:57 +0100 Subject: Added more functionality to Buf, substring, search for characer, and shifting string. --- buf_misc.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'buf_misc.c') diff --git a/buf_misc.c b/buf_misc.c index bcf7705..dee1b04 100644 --- a/buf_misc.c +++ b/buf_misc.c @@ -57,21 +57,26 @@ int bbuf_line_free(bbuf_line *buf) BufLine::BufLine(int size) { - *buf = Buf(size); + buf = new Buf(size); sep=0x0; memset(pattern,0,BUF_PATTER_SIZE); } BufLine::~BufLine() { - delete buf; + } -int BufLine::set_pattern(char *pattern) +int BufLine::setpattern(char *pattern) { return -1; } +int BufLine::setseperator(char s) +{ + this->sep = s; + return 0; +} int BufLine::add(char *string, int size) { @@ -86,6 +91,13 @@ int BufLine::add(Buf *newdata) int BufLine::pop_line(char **val, int *size) { + + return -1; +} + +int BufLine::print() +{ + buf->print(); return -1; } -- cgit v1.2.3