OSDN Git Service

* reload1.c (move2add_last_cc0): New.
[pf3gnuchains/gcc-fork.git] / gcc / scan.h
1 /* scan.h - Utility declarations for scan-decls and fix-header programs.
2    Copyright (C) 1993, 1998, 1999 Free Software Foundation, Inc.
3
4 This program is free software; you can redistribute it and/or modify it
5 under the terms of the GNU General Public License as published by the
6 Free Software Foundation; either version 2, or (at your option) any
7 later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
17
18 #include <stdio.h>
19
20 typedef 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
36 #ifndef _PARAMS
37 #if defined(ANSI_PROTOTYPES) || defined(__cplusplus)
38 #define _PARAMS(args) args
39 #else
40 #define _PARAMS(args) ()
41 #endif
42 #endif
43
44 struct partial_proto;
45 struct fn_decl
46 {
47   const char *fname;
48   const char *rtype;
49   const char *params;
50   struct partial_proto *partial;
51 };
52
53 struct cpp_token;
54
55 extern int lineno;
56 extern void sstring_append _PARAMS((sstring *, sstring *));
57 extern void make_sstring_space _PARAMS((sstring *, int));
58 extern int skip_spaces _PARAMS((FILE *, int));
59 extern int scan_ident _PARAMS((FILE *, sstring *, int));
60 extern int scan_string _PARAMS((FILE *, sstring *, int));
61 extern int read_upto _PARAMS((FILE *, sstring *, int));
62 extern unsigned long hash _PARAMS((const char *));
63 extern void recognized_function _PARAMS((const struct cpp_token *,
64                                          unsigned int, int, int));
65 extern void recognized_extern _PARAMS((const struct cpp_token *));
66 extern unsigned int hashstr _PARAMS((const char *, unsigned int));
67
68 extern int scan_decls _PARAMS((struct cpp_reader *, int, char **));
69
70 /* get_token is a simple C lexer.  */
71 #define IDENTIFIER_TOKEN 300
72 #define CHAR_TOKEN 301
73 #define STRING_TOKEN 302
74 #define INT_TOKEN 303
75 extern int get_token _PARAMS ((FILE *, sstring *));
76
77 /* Current file and line numer, taking #-directives into account */
78 extern int source_lineno;
79 extern sstring source_filename;
80 /* Current physical line number */
81 extern int lineno;