"Fossies" - the Fresh Open Source Software Archive

Member "netbiff-0.9.18/buffer.h" (21 Sep 2003, 590 Bytes) of package /linux/privat/old/netbiff-0.9.18.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 #ifndef BUFFER_H
    2 #define BUFFER_H
    3 
    4 typedef struct _bufferchunk BufferChunk;
    5 struct _bufferchunk {
    6   char *buf;
    7   unsigned long len;
    8   struct _bufferchunk *next;
    9 };
   10 
   11 typedef struct _buffer Buffer;
   12 struct _buffer {
   13   unsigned long size;
   14   BufferChunk *head;
   15   BufferChunk *tail;
   16 };
   17 
   18 void buffer_init(Buffer *b);
   19 void buffer_put(Buffer *b, const char *s, unsigned long len);
   20 int buffer_get(Buffer *b, char **dest);
   21 char *buffer_get_line(Buffer *b);
   22 void buffer_finish(Buffer *b);
   23 
   24 #define buffer_get_size(b) ((b)->size)
   25 #define buffer_has_data(b) (!!buffer_get_size(b))
   26 
   27 #endif /* BUFFER_H */