Change copyright notice from GPLv2+ to GPLv3+.
[gnulib.git] / lib / readtokens.h
1 /* readtokens.h -- Functions for reading tokens from an input stream.
2
3    Copyright (C) 1990, 1991, 1999, 2001-2004 Free Software Foundation, Inc.
4
5    This program is free software: you can redistribute it and/or modify
6    it under the terms of the GNU General Public License as published by
7    the Free Software Foundation; either version 3 of the License, or
8    (at your option) any later version.
9
10    This program is distributed in the hope that it will be useful,
11    but WITHOUT ANY WARRANTY; without even the implied warranty of
12    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13    GNU General Public License for more details.
14
15    You should have received a copy of the GNU General Public License
16    along with this program.  If not, see <http://www.gnu.org/licenses/>.
17
18    Written by Jim Meyering. */
19
20 #ifndef READTOKENS_H
21 # define READTOKENS_H
22
23 # include <stdio.h>
24
25 struct tokenbuffer
26 {
27   size_t size;
28   char *buffer;
29 };
30 typedef struct tokenbuffer token_buffer;
31
32 void init_tokenbuffer (token_buffer *tokenbuffer);
33
34 size_t
35   readtoken (FILE *stream, const char *delim, size_t n_delim,
36              token_buffer *tokenbuffer);
37 size_t
38   readtokens (FILE *stream, size_t projected_n_tokens,
39               const char *delim, size_t n_delim,
40               char ***tokens_out, size_t **token_lengths);
41
42 #endif /* not READTOKENS_H */