]> andersk Git - splint.git/blame - src/Headers/globals.h
Fixed line numbering when multi-line macro parameters are used.
[splint.git] / src / Headers / globals.h
CommitLineData
885824d3 1/*
28bf4b0b 2** Copyright (C) University of Virginia, Massachusetts Institue of Technology 1994-2001.
885824d3 3** See ../LICENSE for license information.
4**
5*/
6# ifndef GLOBALS_H
7# define GLOBALS_H
8
9extern /*@owned@*/ fileloc g_currentloc;
10
11/* stream for error messages */
15b3d2b2 12extern /*:open:*/ FILE *g_msgstream;
885824d3 13
14/*@-ansireserved@*/
15/* This macro is defined by flex. */
16/*@constant external int ECHO@*/
17/*@=ansireserved@*/
18
19/*@-redecl@*/
20/*@-incondefs@*/
21/*@-namechecks@*/
a956d444 22/*@-declundef@*/ /* Might not process grammar files */
23extern /*@dependent@*/ /*@open@*/ FILE *yyin;
24extern /*@dependent@*/ /*@open@*/ /*@unused@*/ FILE *yyout;
25extern /*@unused@*/ int yyleng;
885824d3 26/*@=incondefs@*/
27
885824d3 28extern int yydebug;
29/*@=redecl@*/
a956d444 30/*@=declundef@*/
885824d3 31/*@=namechecks@*/
32
33extern /*@observer@*/ cstring g_codeFile;
34extern int g_codeLine;
35
36extern /*@observer@*/ cstring g_prevCodeFile;
37extern int g_prevCodeLine;
38
39extern /*@observer@*/ char *g_localSpecPath;
40
41# ifndef NOLCL
42extern /*@only@*/ cstring g_currentSpec;
43extern /*@null@*/ /*@only@*/ char *g_currentSpecName;
44# endif
45
46extern void setCodePoint (void);
47# define setCodePoint() \
48 (g_prevCodeFile = g_codeFile, g_prevCodeLine = g_codeLine, \
49 g_codeFile = cstring_makeLiteralTemp (__FILE__), g_codeLine = __LINE__)
50
51extern void printCodePoint (void);
52
53extern fileId currentFile (void) /*@globals g_currentloc; @*/ ;
54# define currentFile() (fileloc_fileId (g_currentloc))
55
56extern int currentColumn (void) /*@globals g_currentloc; @*/ ;
57# define currentColumn() (fileloc_column(g_currentloc))
58
59extern void incColumn (void)
28bf4b0b 60 /*@globals g_currentloc; @*/
885824d3 61 /*@modifies g_currentloc@*/ ;
62# define incColumn() (fileloc_incColumn(g_currentloc))
63
64extern void decColumn (void)
28bf4b0b 65 /*@globals g_currentloc; @*/
885824d3 66 /*@modifies g_currentloc@*/ ;
67# define decColumn() (fileloc_addColumn(g_currentloc, -1))
68
69extern void incLine (void)
28bf4b0b 70 /*@globals g_currentloc; @*/
885824d3 71 /*@modifies g_currentloc; @*/ ;
72# define incLine() (fileloc_nextLine(g_currentloc))
73
74extern void decLine (void)
28bf4b0b 75 /*@globals g_currentloc; @*/
885824d3 76 /*@modifies g_currentloc; @*/ ;
77# define decLine() (fileloc_addLine (g_currentloc, -1))
78
79extern void beginLine (void)
28bf4b0b 80 /*@globals g_currentloc; @*/
885824d3 81 /*@modifies g_currentloc; @*/ ;
82# define beginLine() (fileloc_setColumn(g_currentloc, 1))
83
84extern void addColumn (int p_n)
28bf4b0b 85 /*@globals g_currentloc; @*/
885824d3 86 /*@modifies g_currentloc; @*/ ;
87# define addColumn(n) (fileloc_addColumn(g_currentloc, n))
88
89extern void setLine (int p_n)
90 /*@globals fileloc g_currentloc; @*/
91 /*@modifies g_currentloc; @*/ ;
92# define setLine(n) (fileloc_setLineno(g_currentloc, n))
93
94extern void setColumn (int p_n)
95 /*@globals fileloc g_currentloc; @*/
96 /*@modifies g_currentloc; @*/ ;
97# define setColumn(n) (fileloc_setColumn(g_currentloc, n))
98
99# ifndef NOLCL
100extern void setSpecFileId (fileId p_s)
101 /*@globals fileloc g_currentloc; @*/
102 /*@modifies g_currentloc; @*/ ;
103# define setSpecFileId(s) \
104 (fileloc_reallyFree (g_currentloc), g_currentloc = fileloc_createSpec (s, 1, 1))
105# endif
106
107extern void setFileLine (fileId p_s, int p_line)
108 /*@globals fileloc g_currentloc; @*/
109 /*@modifies g_currentloc; @*/ ;
110# define setFileLine(s, line) \
111 (context_setFilename(s, line))
112
113# else
114# error "Multiple include"
115# endif
116
117
118
119
120
121
This page took 0.097786 seconds and 5 git commands to generate.