summaryrefslogtreecommitdiff
path: root/buf_misc.c
diff options
context:
space:
mode:
authorFreeArtMan <dos21h@gmail.com>2019-05-12 15:05:57 +0100
committerFreeArtMan <dos21h@gmail.com>2019-05-12 15:05:57 +0100
commit082dee0658b67744ab3428eea964f375f7aab9dc (patch)
tree6dd58d5044513ec7bef3b445fefa7003e33ebeed /buf_misc.c
parent654bb8b09dd90c12c3a51ffdce800b2255b753b5 (diff)
downloadlibbuf-082dee0658b67744ab3428eea964f375f7aab9dc.tar.gz
libbuf-082dee0658b67744ab3428eea964f375f7aab9dc.zip
Added more functionality to Buf, substring, search for characer, and shifting string.
Diffstat (limited to 'buf_misc.c')
-rw-r--r--buf_misc.c18
1 files changed, 15 insertions, 3 deletions
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;
}