X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Freadtokens.c;h=f66bd21c5df9f7001aa62917fd4f68325f2f73a1;hb=17448795e00be0976f6e6ec9bfbb285cc2c3d1dd;hp=0bd66922461119c4b6bb26996bcece2ad31ae8bc;hpb=0ee6b616171a138ce4226f10b15a2f00e131c589;p=gnulib.git diff --git a/lib/readtokens.c b/lib/readtokens.c index 0bd669224..f66bd21c5 100644 --- a/lib/readtokens.c +++ b/lib/readtokens.c @@ -1,5 +1,5 @@ /* 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 @@ -12,8 +12,8 @@ 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. */ @@ -28,23 +28,23 @@ */ #ifdef HAVE_CONFIG_H -#include +# include #endif #include #ifdef STDC_HEADERS -#include +# include #endif #if defined (STDC_HEADERS) || defined(HAVE_STRING_H) -#include +# include /* An ANSI string.h and pre-ANSI memory.h might conflict. */ -#if !defined (STDC_HEADERS) && defined (HAVE_MEMORY_H) -#include -#endif /* not STDC_HEADERS and HAVE_MEMORY_H */ +# if !defined (STDC_HEADERS) && defined (HAVE_MEMORY_H) +# include +# endif /* not STDC_HEADERS and HAVE_MEMORY_H */ #else /* not STDC_HEADERS and not HAVE_STRING_H */ -#include +# include /* memory.h and strings.h conflict on some systems. */ #endif /* not STDC_HEADERS and not HAVE_STRING_H */ @@ -58,7 +58,8 @@ void *xrealloc (); /* Initialize a tokenbuffer. */ void -init_tokenbuffer (token_buffer *tokenbuffer) +init_tokenbuffer (tokenbuffer) + token_buffer *tokenbuffer; { tokenbuffer->size = INITIAL_TOKEN_LENGTH; tokenbuffer->buffer = ((char *) xmalloc (INITIAL_TOKEN_LENGTH)); @@ -76,7 +77,9 @@ init_tokenbuffer (token_buffer *tokenbuffer) and on files that aren't newline-terminated. */ long -readtoken (FILE *stream, const char *delim, int n_delim, +readtoken (FILE *stream, + const char *delim, + int n_delim, token_buffer *tokenbuffer) { char *p; @@ -160,9 +163,12 @@ readtoken (FILE *stream, const char *delim, int n_delim, %%% realloc() of `tokens' just before returning? */ int -readtokens (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;