X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Freadtokens.c;h=651b5efb651602f1976af7b4b37f21481d127ba9;hb=7b7f6d343eb133e6fb670a982ef4b6b3e13256cb;hp=c1b80a24d1638093b5933f96f7418dfbe3b80396;hpb=ed68688309bd5d0d3b7b8d3babbfbd40238c4215;p=gnulib.git diff --git a/lib/readtokens.c b/lib/readtokens.c index c1b80a24d..651b5efb6 100644 --- a/lib/readtokens.c +++ b/lib/readtokens.c @@ -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,28 +28,29 @@ */ #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 */ #include "readtokens.h" -#include "xalloc.h" +void *xmalloc (); +void *xrealloc (); #define STREQ(a,b) ((a) == (b) || ((a) && (b) && *(a) == *(b) \ && strcmp(a, b) == 0)) @@ -57,7 +58,8 @@ /* 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)); @@ -75,8 +77,11 @@ init_tokenbuffer (token_buffer *tokenbuffer) and on files that aren't newline-terminated. */ long -readtoken (FILE *stream, const char *delim, int n_delim, - token_buffer *tokenbuffer) +readtoken (stream, delim, n_delim, tokenbuffer) + FILE *stream; + const char *delim; + int n_delim; + token_buffer *tokenbuffer; { char *p; int c, i, n; @@ -159,9 +164,14 @@ 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 (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; { token_buffer tb, *token = &tb; int token_length;