Initial revision
[ssr] / StraySrc / Libraries / Steel / c / buffer
1 /*
2 * buffer.c
3 *
4 * Two buffers for building strings in
5 *
6 * © 1994-1998 Straylight
7 */
8
9 /*----- Licensing note ----------------------------------------------------*
10 *
11 * This file is part of Straylight's Steel library.
12 *
13 * Steel is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2, or (at your option)
16 * any later version.
17 *
18 * Steel is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
22 *
23 * You should have received a copy of the GNU General Public License
24 * along with Steel. If not, write to the Free Software Foundation,
25 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
26 */
27
28 #include "buffer.h"
29
30 /*
31 * char *buffer_find(void)
32 *
33 * Use
34 * Returns a pointer to a 256-byte buffer. There are two buffers, which are
35 * returned alternately.
36 */
37
38 char *buffer_find(void)
39 {
40 static int which;
41 static char buffers[512];
42 which^=256;
43 return (buffers+which);
44 }