]> gcc.gnu.org Git - gcc.git/blame - gcc/scan.h
formatting tweaks
[gcc.git] / gcc / scan.h
CommitLineData
82020a12 1/* scan.h - Utility declarations for scan-decls and fix-header programs.
7936052f
PB
2 Copyright (C) 1993 Free Software Foundation, Inc.
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
e9fa0c7c 16Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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
36#ifndef _PARAMS
37#if defined(__STDC__) || defined(__cplusplus)
38#define _PARAMS(args) args
39#else
40#define _PARAMS(args) ()
41#endif
42#endif
43
44struct partial_proto;
45struct fn_decl
46{
47 char *fname;
48 char *rtype;
49 char *params;
50 struct partial_proto *partial;
51};
52
53extern int lineno;
0f41302f
MS
54extern void sstring_append _PARAMS((sstring *, sstring *));
55extern void make_sstring_space _PARAMS((sstring *, int));
56extern int skip_spaces _PARAMS((FILE *, int));
7936052f 57extern int scan_ident _PARAMS((FILE *, sstring *, int));
0f41302f
MS
58extern int scan_string _PARAMS((FILE *, sstring *, int));
59extern int read_upto _PARAMS((FILE *, sstring *, int));
7936052f
PB
60extern char *xmalloc _PARAMS((unsigned));
61extern char *xrealloc _PARAMS((char *, unsigned));
0f41302f 62extern unsigned long hash _PARAMS((const char *));
7936052f
PB
63
64/* get_token is a simple C lexer. */
65#define IDENTIFIER_TOKEN 300
66#define CHAR_TOKEN 301
67#define STRING_TOKEN 302
68#define INT_TOKEN 303
0f41302f 69extern int get_token _PARAMS ((FILE *, sstring *));
7936052f
PB
70
71/* Current file and line numer, taking #-directives into account */
72extern int source_lineno;
73extern sstring source_filename;
74/* Current physical line number */
75extern int lineno;
This page took 0.269078 seconds and 5 git commands to generate.