summaryrefslogtreecommitdiff
path: root/gnu/egcs/gcc/f/where.h
blob: 32b3d4b224d402c14cfab8bb730f63c26affd691 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
/* where.h -- Public #include File (module.h template V1.0)
   Copyright (C) 1995 Free Software Foundation, Inc.
   Contributed by James Craig Burley.

This file is part of GNU Fortran.

GNU Fortran is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.

GNU Fortran is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with GNU Fortran; see the file COPYING.  If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.

   Owning Modules:
      where.c

   Modifications:
*/

/* Allow multiple inclusion to work. */

#ifndef _H_f_where
#define _H_f_where

/* Simple definitions and enumerations. */

#define FFEWHERE_columnMAX UCHAR_MAX
#define FFEWHERE_columnUNKNOWN 0
#define FFEWHERE_indexMAX 36
#define FFEWHERE_indexUNKNOWN UCHAR_MAX
#define FFEWHERE_lineMAX ULONG_MAX
#define FFEWHERE_lineUNKNOWN (&ffewhere_unknown_line_)
#define FFEWHERE_filenameUNKNOWN ("(input file)")

/* Typedefs. */

typedef unsigned char ffewhereColumnNumber;	/* Change FFEWHERE_columnMAX
						   too. */
#define ffewhereColumnNumber_f ""
typedef unsigned char ffewhereColumn;
typedef struct _ffewhere_file_ *ffewhereFile;
typedef unsigned short ffewhereLength_;
#define ffewhereLength_f_ ""
typedef unsigned long ffewhereLineNumber;	/* Change FFEWHERE_lineMAX
						   too. */
#define ffewhereLineNumber_f "l"
typedef struct _ffewhere_line_ *ffewhereLine;
typedef unsigned char ffewhereIndex;
#define ffewhereIndex_f ""
typedef ffewhereIndex ffewhereTrack[FFEWHERE_indexMAX * 2 - 2];
typedef unsigned int ffewhereUses_;
#define ffewhereUses_f_ ""

/* Include files needed by this one. */

#include "glimits.j"
#include "top.h"

/* Structure definitions. */

struct _ffewhere_file_
  {
    size_t length;
    char text[1];
  };

struct _ffewhere_line_
  {
    ffewhereLine next;
    ffewhereLine previous;
    ffewhereLineNumber line_num;
    ffewhereUses_ uses;
    ffewhereLength_ length;
    char content[1];
  };

/* Global objects accessed by users of this module. */

extern struct _ffewhere_line_ ffewhere_unknown_line_;

/* Declare functions with prototypes. */

void ffewhere_file_kill (ffewhereFile wf);
ffewhereFile ffewhere_file_new (char *name, size_t length);
void ffewhere_file_set (ffewhereFile wf, bool have_num, ffewhereLineNumber ln);
void ffewhere_init_1 (void);
char *ffewhere_line_content (ffewhereLine l);
ffewhereFile ffewhere_line_file (ffewhereLine l);
ffewhereLineNumber ffewhere_line_filelinenum (ffewhereLine l);
void ffewhere_line_kill (ffewhereLine l);
ffewhereLine ffewhere_line_new (ffewhereLineNumber ln);
ffewhereLine ffewhere_line_use (ffewhereLine wl);
void ffewhere_set_from_track (ffewhereLine *wol, ffewhereColumn *woc,
		     ffewhereLine wrl, ffewhereColumn wrc, ffewhereTrack wt,
			      ffewhereIndex i);
void ffewhere_track (ffewhereLine *wl, ffewhereColumn *wc, ffewhereTrack wt,
	   ffewhereIndex i, ffewhereLineNumber ln, ffewhereColumnNumber cn);
void ffewhere_track_clear (ffewhereTrack wt, ffewhereIndex length);
void ffewhere_track_copy (ffewhereTrack dwt, ffewhereTrack swt,
			  ffewhereIndex start, ffewhereIndex length);
void ffewhere_track_kill (ffewhereLine wrl, ffewhereColumn wrc, ffewhereTrack wt,
			  ffewhereIndex length);

/* Define macros. */

#define ffewhere_column_is_unknown(c) (c == FFEWHERE_columnUNKNOWN)
#define ffewhere_column_kill(c) ((void) 0)
#define ffewhere_column_new(cn) (cn)
#define ffewhere_column_number(c) (c)
#define ffewhere_column_unknown() (FFEWHERE_columnUNKNOWN)
#define ffewhere_column_use(c) (c)
#define ffewhere_file_name(f) ((f)->text)
#define ffewhere_file_namelen(f) ((f)->length)
#define ffewhere_init_0()
#define ffewhere_init_2()
#define ffewhere_init_3()
#define ffewhere_init_4()
#define ffewhere_line_filename(l) (ffewhere_line_file(l)->text)
#define ffewhere_line_is_unknown(l) (l == FFEWHERE_lineUNKNOWN)
#define ffewhere_line_number(l) ((l)->line_num)
#define ffewhere_line_unknown() (FFEWHERE_lineUNKNOWN)
#define ffewhere_terminate_0()
#define ffewhere_terminate_1()
#define ffewhere_terminate_2()
#define ffewhere_terminate_3()
#define ffewhere_terminate_4()

/* End of #include file. */

#endif