]>
git.proxmox.com Git - mirror_frr.git/blob - lib/buffer.h
2 * Buffering to output and input.
3 * Copyright (C) 1998 Kunihiro Ishiguro
5 * This file is part of GNU Zebra.
7 * GNU Zebra is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published
9 * by the Free Software Foundation; either version 2, or (at your
10 * option) any later version.
12 * GNU Zebra is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with GNU Zebra; see the file COPYING. If not, write to the
19 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 * Boston, MA 02111-1307, USA.
23 #ifndef _ZEBRA_BUFFER_H
24 #define _ZEBRA_BUFFER_H
30 struct buffer_data
*head
;
31 struct buffer_data
*tail
;
33 /* Current allocated data. */
36 /* Total length of buffer. */
40 struct buffer_data
*unused_head
;
41 struct buffer_data
*unused_tail
;
43 /* Current total length of this buffer. */
50 struct buffer
*parent
;
51 struct buffer_data
*next
;
52 struct buffer_data
*prev
;
54 /* Acctual data stream. */
57 /* Current pointer. */
64 /* Buffer prototypes. */
65 struct buffer
*buffer_new (size_t);
66 int buffer_write (struct buffer
*, void *, size_t);
67 void buffer_free (struct buffer
*);
68 char *buffer_getstr (struct buffer
*);
69 int buffer_putc (struct buffer
*, u_char
);
70 int buffer_putstr (struct buffer
*, char *);
71 void buffer_reset (struct buffer
*);
72 int buffer_flush_all (struct buffer
*, int);
73 int buffer_flush_vty_all (struct buffer
*, int, int, int);
74 int buffer_flush_window (struct buffer
*, int, int, int, int, int);
75 int buffer_empty (struct buffer
*);
77 #endif /* _ZEBRA_BUFFER_H */