]> andersk Git - splint.git/blame - src/Headers/fileloc.h
Removed the unused data type environmentTable.
[splint.git] / src / Headers / fileloc.h
CommitLineData
885824d3 1/*
2** Copyright (C) University of Virginia, Massachusetts Institue of Technology 1994-2000.
3** See ../LICENSE for license information.
4**
5*/
6/*
7** fileloc.h
8*/
9
10# ifndef FILELOC_H
11# define FILELOC_H
12
13# include "fileId.h"
14
15typedef enum
16{
17 FL_NORMAL, FL_SPEC, FL_LIB, FL_STDLIB, FL_STDHDR, FL_IMPORT, FL_BUILTIN,
4cccc6ad 18 FL_PREPROC, FL_RC, FL_EXTERNAL,
19 FL_POST, FL_SIDE
885824d3 20} flkind;
21
4cccc6ad 22/*added fl_post and fl_side for use with constraint generation
23 DRL 8/22/2000
24*/
25
26
885824d3 27struct __fileloc
28{
29 flkind kind;
30 fileId fid;
31 int lineno;
32 int column;
33} ;
34
35/* typedef in forwardTypes */
36typedef /*@only@*/ fileloc o_fileloc;
37
38extern fileloc fileloc_update (/*@only@*/ fileloc p_old, fileloc p_fnew)
39 /*@modifies p_old@*/ ;
40
41extern fileloc fileloc_create (fileId p_fid, int p_line, int p_col) /*@*/ ;
42extern bool fileloc_isSystemFile (fileloc p_f1) /*@*/ ;
43
44# ifndef NOLCL
45extern fileloc fileloc_createSpec (fileId p_fid, int p_line, int p_col) /*@*/ ;
46# endif
47
48extern fileloc fileloc_createLib (cstring p_ln) /*@*/ ;
49extern fileloc fileloc_createRc (cstring p_name) /*@*/ ;
50extern fileloc fileloc_decColumn (fileloc p_f, int p_x) /*@*/ ;
51extern void fileloc_subColumn (fileloc p_f, int p_x) /*@modifies p_f@*/ ;
52extern fileloc fileloc_getBuiltin (void) /*@*/ ;
53extern /*@observer@*/ fileloc fileloc_observeBuiltin (void) /*@*/ ;
54extern fileloc fileloc_createBuiltin (void) /*@*/ ;
55
56# ifndef NOLCL
57extern fileloc fileloc_createImport (cstring p_fname, int p_lineno) /*@*/ ;
58# endif
59
60extern bool fileloc_isSpecialFile (fileloc p_f) /*@*/ ;
61extern bool fileloc_sameBaseFile (fileloc p_f1, fileloc p_f2) /*@*/ ;
62extern /*@observer@*/ cstring fileloc_filename (fileloc p_f) /*@*/ ;
63extern int fileloc_column (fileloc p_f) /*@*/ ;
64extern cstring fileloc_unparse (fileloc p_f) /*@*/ ;
65extern cstring fileloc_unparseRaw (cstring p_fname, int p_lineno) /*@*/ ;
66extern cstring fileloc_unparseRawCol (cstring p_fname, int p_lineno, int p_col) /*@*/ ;
67extern bool fileloc_sameFile (fileloc p_f1, fileloc p_f2) /*@*/ ;
68extern void fileloc_free (/*@only@*/ fileloc p_f);
69extern void fileloc_reallyFree (/*@only@*/ fileloc p_f);
70extern int fileloc_lineno (fileloc p_f) /*@*/ ;
71extern bool fileloc_equal (fileloc p_f1, fileloc p_f2) /*@*/ ;
72extern bool fileloc_lessthan (fileloc p_f1, fileloc p_f2) /*@*/ ;
73extern int fileloc_compare (fileloc p_f1, fileloc p_f2) /*@*/ ;
74extern /*@observer@*/ cstring fileloc_getBase (fileloc p_f) /*@*/ ;
75extern bool fileloc_isHeader (fileloc p_f) /*@*/ ;
76extern bool fileloc_isSpec (fileloc p_f) /*@*/ ;
77extern bool fileloc_isRealSpec (fileloc p_f) /*@*/ ;
78extern fileloc fileloc_copy (fileloc p_f) /*@*/ ;
79extern cstring fileloc_unparseDirect (fileloc p_fl) /*@*/ ;
80extern bool fileloc_notAfter (fileloc p_f1, fileloc p_f2) /*@*/ ;
81extern bool fileloc_almostSameFile (fileloc p_f1, fileloc p_f2) /*@*/ ;
82extern fileloc fileloc_noColumn (fileloc p_f) /*@*/ ;
83extern /*@observer@*/ fileloc fileloc_getExternal (void) /*@*/ ;
84extern fileloc fileloc_createExternal (void) /*@*/ ;
85
86extern bool fileloc_isExternal (/*@sef@*/ fileloc p_f) /*@*/;
87# define fileloc_isExternal(f) \
88 (fileloc_isDefined(f) && ((f)->kind == FL_EXTERNAL))
89
90extern /*@falsenull@*/ bool fileloc_isDefined (/*@null@*/ fileloc p_f) /*@*/ ;
91extern /*@truenull@*/ bool fileloc_isUndefined (/*@null@*/ fileloc p_f) /*@*/ ;
92extern bool fileloc_isInvalid (/*@sef@*/ /*@null@*/ fileloc p_f) /*@*/ ;
93
94/*@constant null fileloc fileloc_undefined; @*/
95# define fileloc_undefined ((fileloc)0)
96# define fileloc_isDefined(f) ((f) != fileloc_undefined)
97# define fileloc_isUndefined(f) ((f) == fileloc_undefined)
98# define fileloc_isInvalid(f) (!(fileloc_isValid(f)))
99
100extern bool fileloc_isLib (fileloc p_f) /*@*/ ;
101extern bool fileloc_isRealLib (fileloc p_f) /*@*/ ;
102
103# ifndef NOLCL
104extern fileloc fileloc_fromTok (ltoken p_t) /*@*/ ;
105# endif
106
107/*@constant int UNKNOWN_LINE; @*/
108# define UNKNOWN_LINE (0)
109
110/*@constant int UNKNOWN_COLUMN; @*/
111# define UNKNOWN_COLUMN (0)
112
113extern /*@unused@*/ bool fileloc_linenoDefined (/*@sef@*/ fileloc p_f) /*@*/ ;
114extern /*@unused@*/ bool fileloc_columnDefined (/*@sef@*/ fileloc p_f) /*@*/ ;
115
116# define fileloc_linenoDefined(f) \
117 (fileloc_isValid (f) && (f)->lineno != UNKNOWN_LINE)
118
119# define fileloc_columnDefined(f) \
120 (fileloc_isValid (f) && (f)->column != UNKNOWN_COLUMN)
121
122# ifndef NOLCL
123extern void fileloc_setColumnUndefined (/*@sef@*/ fileloc p_f) /*@modifies p_f@*/;
124# define fileloc_setColumnUndefined(f) \
125 (fileloc_isDefined(f) ? (f)->column = UNKNOWN_COLUMN : UNKNOWN_COLUMN)
126# endif
127
128extern /*@falsenull@*/ bool fileloc_isValid (/*@sef@*/ fileloc p_f);
129# define fileloc_isValid(f) \
130 (fileloc_isDefined(f) && ((f)->lineno >= 0))
131
132extern bool fileloc_isImport (/*@sef@*/ fileloc p_fl);
133# define fileloc_isImport(fl) (fileloc_isDefined(fl) && (fl)->kind == FL_IMPORT)
134
135extern bool fileloc_isPreproc (/*@sef@*/ fileloc p_fl);
136# define fileloc_isPreproc(fl) (fileloc_isDefined(fl) && (fl)->kind == FL_PREPROC)
137
138extern void fileloc_setLineno (/*@sef@*/ fileloc p_f, int p_i) /*@modifies p_f@*/ ;
139# define fileloc_setLineno(fl, i) \
140 (fileloc_isDefined(fl) ? ((fl)->lineno = (i), (fl)->column = 1) : (i))
141
142extern void fileloc_nextLine (/*@sef@*/ fileloc p_f) /*@modifies p_f@*/ ;
143# define fileloc_nextLine(fl) \
144 (fileloc_isDefined(fl) ? ((fl)->lineno++, (fl)->column = 1) : 0)
145
146extern void fileloc_addLine (/*@sef@*/ fileloc p_f, int p_i) /*@modifies p_f@*/ ;
147# define fileloc_addLine(fl, i) \
148 (fileloc_isDefined(fl) ? ((fl)->lineno += (i), (fl)->column = 1) : (i))
149
150extern fileId fileloc_fileId (/*@sef@*/ fileloc p_fl) /*@*/ ;
151# define fileloc_fileId(fl) \
152 (fileloc_isDefined (fl) ? (fl)->fid : fileId_invalid)
153
154extern void fileloc_setColumn (/*@sef@*/ fileloc p_fl, int p_i) /*@modifies p_fl@*/ ;
155# define fileloc_setColumn(fl, i) \
156 (fileloc_isDefined (fl) ? ((fl)->column = (i)) : (i))
157
158extern void fileloc_addColumn (/*@sef@*/ fileloc p_fl, int p_i) /*@modifies p_fl@*/ ;
159# define fileloc_addColumn(fl, i) \
160 (fileloc_isDefined (fl) ? ((fl)->column += (i)) : (i))
161
162extern void fileloc_incColumn (/*@sef@*/ fileloc p_fl) /*@modifies p_fl@*/ ;
163# define fileloc_incColumn(fl) \
164 (fileloc_isDefined (fl) ? ((fl)->column++) : 0)
165
166extern bool fileloc_isBuiltin (/*@sef@*/ fileloc p_fl) /*@*/ ;
167# define fileloc_isBuiltin(fl) \
168 (fileloc_isDefined (fl) && ((fl)->kind == FL_BUILTIN))
169
170extern fileloc fileloc_updateFileId (/*@only@*/ fileloc p_old, fileId p_s) /*@*/ ;
171extern fileloc fileloc_makePreproc (fileloc p_loc) /*@*/ ;
172extern fileloc fileloc_makePreprocPrevious (fileloc p_loc) /*@*/ ;
173
174# ifndef NOLCL
175extern bool fileloc_isStandardLibrary (fileloc p_f) /*@*/ ;
176# endif
177
178extern bool fileloc_isStandardLib (fileloc p_f) /*@*/ ;
179extern cstring fileloc_unparseFilename (fileloc p_f) /*@*/ ;
180extern bool fileloc_withinLines (fileloc p_f1, fileloc p_f2, int p_n) /*@*/ ;
181extern bool fileloc_isUser (fileloc p_f) /*@*/ ;
182extern bool fileloc_sameModule (fileloc p_f1, fileloc p_f2) /*@*/ ;
183
184# else
185# error "Multiple include"
186# endif
187
188
189
190
191
192
This page took 0.216715 seconds and 5 git commands to generate.