summaryrefslogtreecommitdiffhomepage
path: root/src/buffer.h
diff options
context:
space:
mode:
authorRobert James Kaes <rjkaes@users.sourceforge.net>2000-09-11 23:41:32 +0000
committerRobert James Kaes <rjkaes@users.sourceforge.net>2000-09-11 23:41:32 +0000
commitb7f7599d76f853c5150eddfc104d6c1663376d85 (patch)
tree4da158bca9e3d8a2eb0f158ea0b6f7a737c61f58 /src/buffer.h
parent55185db499b1d7c6340d78edb223e26f3c5e5c72 (diff)
Cleaned up the source so that the internal structure is no exposed by the
buffer.h header.
Diffstat (limited to 'src/buffer.h')
-rw-r--r--src/buffer.h45
1 files changed, 4 insertions, 41 deletions
diff --git a/src/buffer.h b/src/buffer.h
index 2a68fd8..7248d05 100644
--- a/src/buffer.h
+++ b/src/buffer.h
@@ -1,4 +1,4 @@
-/* $Id: buffer.h,v 1.2 2000-03-31 20:09:19 rjkaes Exp $
+/* $Id: buffer.h,v 1.3 2000-09-11 23:41:32 rjkaes Exp $
*
* See 'buffer.c' for a detailed description.
*
@@ -15,50 +15,13 @@
* General Public License for more details.
*/
-#ifndef __BUFFER_H_
-#define __BUFFER_H_ 1
+#ifndef _TINYPROXY_BUFFER_H_
+#define _TINYPROXY_BUFFER_H_
-#define MAXBUFFSIZE 20480
-
-struct bufline_s {
- unsigned char *string; /* the actual string of data */
- struct bufline_s *next; /* pointer to next in linked list */
- unsigned int length; /* length of the string of data */
- unsigned int pos; /* start sending from this offset */
-};
-
-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)
-#define buffer_tail(x) (((struct buffer_s *)(x))->tail)
-#define buffer_size(x) (((struct buffer_s *)(x))->size)
-
-/* Create and delete buffers */
extern struct buffer_s *new_buffer(void);
extern void delete_buffer(struct buffer_s *buffptr);
+extern unsigned int buffer_size(struct buffer_s *buffptr);
-/* Operate on the end of the list */
-extern struct bufline_s *push_buffer(struct buffer_s *buffptr,
- unsigned char *data, unsigned int length);
-extern struct bufline_s *pop_buffer(struct buffer_s *buffptr);
-
-/* Operate on the head of the list */
-extern struct bufline_s *unshift_buffer(struct buffer_s *buffptr,
- unsigned char *data,
- unsigned int length);
-extern struct bufline_s *shift_buffer(struct buffer_s *buffptr);
-
-/* Free a buffer line */
-extern void free_line(struct bufline_s *line);
-
-/* Read/Write the buffer to a socket */
extern int readbuff(int fd, struct buffer_s *buffptr);
extern int writebuff(int fd, struct buffer_s *buffptr);