2 Ringbuffer Implementation for gtvscreen
4 Copyright (C) 2000 Marcus Metzler (mocm@metzlerbros.de)
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
30 #endif /* __cplusplus */
32 #define FULL_BUFFER -1000
33 typedef struct ringbuffy{
40 int ring_init (ringbuffy *rbuf, int size);
41 void ring_destroy(ringbuffy *rbuf);
42 int ring_write(ringbuffy *rbuf, char *data, int count);
43 int ring_read(ringbuffy *rbuf, char *data, int count);
44 int ring_write_file(ringbuffy *rbuf, int fd, int count);
45 int ring_read_file(ringbuffy *rbuf, int fd, int count);
46 int ring_rest(ringbuffy *rbuf);
47 int ring_peek(ringbuffy *rbuf, char *data, int count, long off);
51 #endif /* __cplusplus */
52 #endif /* RINGBUFFY_H */