/* readtokens.c -- Functions for reading tokens from an input stream.
- Copyright (C) 1990-1991 Jim Meyering.
+ Copyright (C) 1990-1991, 1999 Jim Meyering.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Written by Jim Meyering. */
*/
#ifdef HAVE_CONFIG_H
-#include <config.h>
+# include <config.h>
#endif
#include <stdio.h>
#ifdef STDC_HEADERS
-#include <stdlib.h>
+# include <stdlib.h>
#endif
#if defined (STDC_HEADERS) || defined(HAVE_STRING_H)
-#include <string.h>
+# include <string.h>
/* An ANSI string.h and pre-ANSI memory.h might conflict. */
-#if !defined (STDC_HEADERS) && defined (HAVE_MEMORY_H)
-#include <memory.h>
-#endif /* not STDC_HEADERS and HAVE_MEMORY_H */
+# if !defined (STDC_HEADERS) && defined (HAVE_MEMORY_H)
+# include <memory.h>
+# endif /* not STDC_HEADERS and HAVE_MEMORY_H */
#else /* not STDC_HEADERS and not HAVE_STRING_H */
-#include <strings.h>
+# include <strings.h>
/* memory.h and strings.h conflict on some systems. */
#endif /* not STDC_HEADERS and not HAVE_STRING_H */
and on files that aren't newline-terminated. */
long
-readtoken (stream, delim, n_delim, tokenbuffer)
- FILE *stream;
- const char *delim;
- int n_delim;
- token_buffer *tokenbuffer;
+readtoken (FILE *stream,
+ const char *delim,
+ int n_delim,
+ token_buffer *tokenbuffer)
{
char *p;
int c, i, n;
%%% realloc() of `tokens' just before returning? */
int
-readtokens (stream, projected_n_tokens, delim, n_delim,
- tokens_out, token_lengths)
- FILE *stream;
- int projected_n_tokens;
- const char *delim;
- int n_delim;
- char ***tokens_out;
- long **token_lengths;
+readtokens (FILE *stream,
+ int projected_n_tokens,
+ const char *delim,
+ int n_delim,
+ char ***tokens_out,
+ long **token_lengths)
{
token_buffer tb, *token = &tb;
int token_length;