diff options
author | Robert James Kaes <rjkaes@users.sourceforge.net> | 2000-03-31 20:09:19 +0000 |
---|---|---|
committer | Robert James Kaes <rjkaes@users.sourceforge.net> | 2000-03-31 20:09:19 +0000 |
commit | ae347fc87a55e1c3a6dc4debce62ee1faceaf81a (patch) | |
tree | 96f247bd2818bca001c8a901198d8aef84dc8a38 | |
parent | 0edeabbd63b5524ee27a8123015f08a477e6929c (diff) | |
download | tinyproxy-ae347fc87a55e1c3a6dc4debce62ee1faceaf81a.tar.gz tinyproxy-ae347fc87a55e1c3a6dc4debce62ee1faceaf81a.zip |
Added the working_* fields as a scratch pad for readline().
Diffstat (limited to '')
-rw-r--r-- | src/buffer.c | 8 | ||||
-rw-r--r-- | src/buffer.h | 5 |
2 files changed, 11 insertions, 2 deletions
diff --git a/src/buffer.c b/src/buffer.c index 8e76e26..2111034 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -1,4 +1,4 @@ -/* $Id: buffer.c,v 1.1.1.1 2000-02-16 17:32:22 sdyoung Exp $ +/* $Id: buffer.c,v 1.2 2000-03-31 20:09:19 rjkaes Exp $ * * The buffer used in each connection is a linked list of lines. As the lines * are read in and written out the buffer expands and contracts. Basically, @@ -72,6 +72,9 @@ struct buffer_s *new_buffer(void) buffptr->head = buffptr->tail = NULL; buffptr->size = 0; + buffptr->working_string = NULL; + buffptr->working_length = 0; + return buffptr; } @@ -92,6 +95,9 @@ void delete_buffer(struct buffer_s *buffptr) buffer_head(buffptr) = NULL; buffer_tail(buffptr) = NULL; + buffptr->working_length = 0; + safefree(buffptr->working_string); + safefree(buffptr); } diff --git a/src/buffer.h b/src/buffer.h index a1ee86c..2a68fd8 100644 --- a/src/buffer.h +++ b/src/buffer.h @@ -1,4 +1,4 @@ -/* $Id: buffer.h,v 1.1.1.1 2000-02-16 17:32:22 sdyoung Exp $ +/* $Id: buffer.h,v 1.2 2000-03-31 20:09:19 rjkaes Exp $ * * See 'buffer.c' for a detailed description. * @@ -31,6 +31,9 @@ struct buffer_s { struct bufline_s *head; /* top of the buffer */ struct bufline_s *tail; /* bottom of the buffer */ unsigned long int size; /* total size of the buffer */ + + unsigned char *working_string; /* needed for building a new line incr. */ + unsigned int working_length; /* length of working line */ }; #define buffer_head(x) (((struct buffer_s *)(x))->head) |