Mercurial > hg > octave-nkf > gnulib-hg
annotate lib/readtokens.h @ 4685:2e7b90348c21
Remove K&R cruft.
author | Paul Eggert <eggert@cs.ucla.edu> |
---|---|
date | Thu, 11 Sep 2003 08:43:46 +0000 |
parents | 73d4de41e43c |
children | 2e6bc7ec4f44 |
rev | line source |
---|---|
4347
df44e79ce676
.h files should stand alone, but we shouldn't include <sys/types.h>
Paul Eggert <eggert@cs.ucla.edu>
parents:
653
diff
changeset
|
1 /* readtokens.h -- Functions for reading tokens from an input stream. |
df44e79ce676
.h files should stand alone, but we shouldn't include <sys/types.h>
Paul Eggert <eggert@cs.ucla.edu>
parents:
653
diff
changeset
|
2 |
4380
73d4de41e43c
Put `Free Software Foundation, Inc.'
Jim Meyering <jim@meyering.net>
parents:
4347
diff
changeset
|
3 Copyright (C) 1990, 1991, 1999, 2001, 2003 Free Software Foundation, Inc. |
4347
df44e79ce676
.h files should stand alone, but we shouldn't include <sys/types.h>
Paul Eggert <eggert@cs.ucla.edu>
parents:
653
diff
changeset
|
4 |
df44e79ce676
.h files should stand alone, but we shouldn't include <sys/types.h>
Paul Eggert <eggert@cs.ucla.edu>
parents:
653
diff
changeset
|
5 This program is free software; you can redistribute it and/or modify |
df44e79ce676
.h files should stand alone, but we shouldn't include <sys/types.h>
Paul Eggert <eggert@cs.ucla.edu>
parents:
653
diff
changeset
|
6 it under the terms of the GNU General Public License as published by |
df44e79ce676
.h files should stand alone, but we shouldn't include <sys/types.h>
Paul Eggert <eggert@cs.ucla.edu>
parents:
653
diff
changeset
|
7 the Free Software Foundation; either version 2, or (at your option) |
df44e79ce676
.h files should stand alone, but we shouldn't include <sys/types.h>
Paul Eggert <eggert@cs.ucla.edu>
parents:
653
diff
changeset
|
8 any later version. |
df44e79ce676
.h files should stand alone, but we shouldn't include <sys/types.h>
Paul Eggert <eggert@cs.ucla.edu>
parents:
653
diff
changeset
|
9 |
df44e79ce676
.h files should stand alone, but we shouldn't include <sys/types.h>
Paul Eggert <eggert@cs.ucla.edu>
parents:
653
diff
changeset
|
10 This program is distributed in the hope that it will be useful, |
df44e79ce676
.h files should stand alone, but we shouldn't include <sys/types.h>
Paul Eggert <eggert@cs.ucla.edu>
parents:
653
diff
changeset
|
11 but WITHOUT ANY WARRANTY; without even the implied warranty of |
df44e79ce676
.h files should stand alone, but we shouldn't include <sys/types.h>
Paul Eggert <eggert@cs.ucla.edu>
parents:
653
diff
changeset
|
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
df44e79ce676
.h files should stand alone, but we shouldn't include <sys/types.h>
Paul Eggert <eggert@cs.ucla.edu>
parents:
653
diff
changeset
|
13 GNU General Public License for more details. |
df44e79ce676
.h files should stand alone, but we shouldn't include <sys/types.h>
Paul Eggert <eggert@cs.ucla.edu>
parents:
653
diff
changeset
|
14 |
df44e79ce676
.h files should stand alone, but we shouldn't include <sys/types.h>
Paul Eggert <eggert@cs.ucla.edu>
parents:
653
diff
changeset
|
15 You should have received a copy of the GNU General Public License |
df44e79ce676
.h files should stand alone, but we shouldn't include <sys/types.h>
Paul Eggert <eggert@cs.ucla.edu>
parents:
653
diff
changeset
|
16 along with this program; if not, write to the Free Software Foundation, |
df44e79ce676
.h files should stand alone, but we shouldn't include <sys/types.h>
Paul Eggert <eggert@cs.ucla.edu>
parents:
653
diff
changeset
|
17 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
df44e79ce676
.h files should stand alone, but we shouldn't include <sys/types.h>
Paul Eggert <eggert@cs.ucla.edu>
parents:
653
diff
changeset
|
18 |
df44e79ce676
.h files should stand alone, but we shouldn't include <sys/types.h>
Paul Eggert <eggert@cs.ucla.edu>
parents:
653
diff
changeset
|
19 Written by Jim Meyering. */ |
df44e79ce676
.h files should stand alone, but we shouldn't include <sys/types.h>
Paul Eggert <eggert@cs.ucla.edu>
parents:
653
diff
changeset
|
20 |
375 | 21 #ifndef H_READTOKENS_H |
653 | 22 # define H_READTOKENS_H |
375 | 23 |
4347
df44e79ce676
.h files should stand alone, but we shouldn't include <sys/types.h>
Paul Eggert <eggert@cs.ucla.edu>
parents:
653
diff
changeset
|
24 # include <stdio.h> |
df44e79ce676
.h files should stand alone, but we shouldn't include <sys/types.h>
Paul Eggert <eggert@cs.ucla.edu>
parents:
653
diff
changeset
|
25 |
653 | 26 # ifndef INITIAL_TOKEN_LENGTH |
27 # define INITIAL_TOKEN_LENGTH 20 | |
28 # endif | |
375 | 29 |
653 | 30 # ifndef TOKENBUFFER_DEFINED |
31 # define TOKENBUFFER_DEFINED | |
375 | 32 struct tokenbuffer |
33 { | |
34 long size; | |
35 char *buffer; | |
36 }; | |
37 typedef struct tokenbuffer token_buffer; | |
38 | |
653 | 39 # endif /* not TOKENBUFFER_DEFINED */ |
375 | 40 |
4380
73d4de41e43c
Put `Free Software Foundation, Inc.'
Jim Meyering <jim@meyering.net>
parents:
4347
diff
changeset
|
41 void init_tokenbuffer (token_buffer *tokenbuffer); |
375 | 42 |
43 long | |
4380
73d4de41e43c
Put `Free Software Foundation, Inc.'
Jim Meyering <jim@meyering.net>
parents:
4347
diff
changeset
|
44 readtoken (FILE *stream, const char *delim, int n_delim, |
73d4de41e43c
Put `Free Software Foundation, Inc.'
Jim Meyering <jim@meyering.net>
parents:
4347
diff
changeset
|
45 token_buffer *tokenbuffer); |
375 | 46 int |
4380
73d4de41e43c
Put `Free Software Foundation, Inc.'
Jim Meyering <jim@meyering.net>
parents:
4347
diff
changeset
|
47 readtokens (FILE *stream, int projected_n_tokens, |
375 | 48 const char *delim, int n_delim, |
4380
73d4de41e43c
Put `Free Software Foundation, Inc.'
Jim Meyering <jim@meyering.net>
parents:
4347
diff
changeset
|
49 char ***tokens_out, long **token_lengths); |
375 | 50 |
51 #endif /* not H_READTOKENS_H */ |