]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/scan.h
re PR testsuite/27476 (ACATS: Ada testsuite Bourne shell compatibility problem on...
[thirdparty/gcc.git] / gcc / scan.h
CommitLineData
82020a12 1/* scan.h - Utility declarations for scan-decls and fix-header programs.
aa335b76 2 Copyright (C) 1993, 1998, 1999, 2003, 2004 Free Software Foundation, Inc.
7936052f
PB
3
4This program is free software; you can redistribute it and/or modify it
5under the terms of the GNU General Public License as published by the
6Free Software Foundation; either version 2, or (at your option) any
7later version.
8
9This program is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12GNU General Public License for more details.
13
14You should have received a copy of the GNU General Public License
15along with this program; if not, write to the Free Software
366ccddb 16Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
7936052f
PB
17
18#include <stdio.h>
19
20typedef struct sstring
21{
22 char *base;
23 char *ptr;
24 char *limit;
25} sstring;
26
27#define INIT_SSTRING(STR) ((STR)->base = 0, (STR)->ptr = 0, (STR)->limit = 0)
28#define FREE_SSTRING(STR) do { if ((STR)->base) free (STR)->base; } while(0)
29#define SSTRING_PUT(STR, C) do {\
30 if ((STR)->limit <= (STR)->ptr) make_sstring_space (STR, 1); \
31 *(STR)->ptr++ = (C); } while (0)
32#define SSTRING_LENGTH(STR) ((STR)->ptr - (STR)->base)
33#define MAKE_SSTRING_SPACE(STR, COUNT) \
34 if ((STR)->limit - (STR)->ptr < (COUNT)) make_sstring_space (STR, COUNT);
35
7936052f
PB
36struct partial_proto;
37struct fn_decl
38{
9b3142b3
KG
39 const char *fname;
40 const char *rtype;
41 const char *params;
7936052f
PB
42 struct partial_proto *partial;
43};
44
041c3194
ZW
45struct cpp_token;
46
2a0621b9
KG
47extern void sstring_append (sstring *, sstring *);
48extern void make_sstring_space (sstring *, int);
49extern int skip_spaces (FILE *, int);
50extern int scan_ident (FILE *, sstring *, int);
51extern int scan_string (FILE *, sstring *, int);
52extern int read_upto (FILE *, sstring *, int);
53extern unsigned long hash (const char *);
54extern void recognized_function (const struct cpp_token *,
55 unsigned int, int, int);
56extern void recognized_extern (const struct cpp_token *);
57extern unsigned int hashstr (const char *, unsigned int);
7936052f 58
2a0621b9 59extern int scan_decls (struct cpp_reader *, int, char **);
bb52fa7f 60
2ba84f36 61/* get_token is a simple C lexer. */
7936052f
PB
62#define IDENTIFIER_TOKEN 300
63#define CHAR_TOKEN 301
64#define STRING_TOKEN 302
65#define INT_TOKEN 303
2a0621b9 66extern int get_token (FILE *, sstring *);
7936052f
PB
67
68/* Current file and line numer, taking #-directives into account */
69extern int source_lineno;
70extern sstring source_filename;
71/* Current physical line number */
774cb6d1 72extern int lineno;
c7762b44
PB
73
74extern struct line_maps line_table;