9edb766b0d774935b667ef3d9e1c3b55b7c92cd9
[robodoc.git] / Source / globals.c
1 /*
2 Copyright (C) 1994-2007  Frans Slothouber, Jacco van Weert, Petteri Kettunen,
3 Bernd Koesling, Thomas Aglassinger, Anthon Pang, Stefan Kost, David Druffner,
4 Sasha Vasko, Kai Hofmann, Thierry Pierron, Friedrich Haase, and Gergely Budai.
5
6 This file is part of ROBODoc
7
8 ROBODoc is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 3 of the License, or
11 (at your option) any later version.
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
21 */
22
23
24 /****h* ROBODoc/Globals
25  * FUNCTION
26  *   A number of global variables.
27  * TODO
28  *   Documentation.
29  *****
30  * $Id: globals.c,v 1.22 2007/07/10 19:13:51 gumpu Exp $
31  */
32
33 #include <stdio.h>
34 #include <stdlib.h>
35 #include "robodoc.h"
36 #include "globals.h"
37 #include "links.h"
38
39 #ifdef DMALLOC
40 #include <dmalloc.h>
41 #endif
42
43 int                 number_of_warnings = 0;
44
45 /* Pointer to the name of the current file that is being analysed,
46    use by RB_Panic */
47
48 char               *current_file = 0;
49
50 /****v* Globals/document_title
51  * NAME
52  *   documentat_title -- title for the documentation.
53  * PURPOSE
54  *   Used as the title for master index files or for latex documentation.
55  * SOURCE
56  */
57
58 char               *document_title = NULL;
59
60 /******/
61
62
63 /****v* Globals/output_mode [2.0]
64  * NAME
65  *   output_mode -- the mode of output
66  * FUNCTION
67  *   Controls which type of output will be generated.
68  * SOURCE
69  */
70
71 T_RB_DocType        output_mode = ASCII;
72
73 /*******/
74
75
76 /****v* Globals/course_of_action [2.0]
77  * NAME
78  *   course_of_action
79  * FUNCTION
80  *   Global Variable that defines the course of action.
81  * SOURCE
82  */
83
84 actions_t           course_of_action;
85
86 /*******/
87
88 /****v* Globals/debugmode
89  * NAME
90  *   debugmode
91  * FUNCTION
92  *   A bitfield determining the output levels
93  * SOURCE
94  */
95
96 long                debugmode = 0;
97
98 /*******/
99
100
101 /****v* Globals/line_buffer [2.0]
102  * NAME
103  *   line_buffer -- global line buffer
104  * FUNCTION
105  *   Temporary storage area for lines
106  *   that are read from an input file.
107  * SOURCE
108  */
109
110 char                line_buffer[MAX_LINE_LEN];
111
112 /*******/
113
114 /****v* Globals/myLine
115  * NAME
116  *   myLine -- dynamic buffer for current line
117  * FUNCTION
118  *   Temporary storage area for lines
119  *   that are read from an input file.
120  * SOURCE
121  */
122
123 char               *myLine = NULL;
124
125 /*******/
126
127 /****v* Globals/readChars
128  * NAME
129  *   readChars -- number of characters in the currently bufferd line
130  * FUNCTION
131  *   Temporary storage area for lines
132  *   that are read from an input file.
133  * SOURCE
134  */
135
136 int                 readChars = 0;
137
138 /*******/
139
140 /****v* Globals/line_number [2.0]
141  * NAME
142  *   line_number -- global line counter
143  * PURPOSE
144  *   Keeps track of the number of lines that are read from the source file.
145  * AUTHOR
146  *   Koessi
147  * SOURCE
148  */
149
150 int                 line_number = 0;
151
152 /*******/
153
154 /*
155  * Global variables 
156  */
157 /* TODO  Document these. */
158
159 char               *source_file;        /* DCD */
160 char               *whoami = NULL;      /* me,myself&i */
161 int                 tab_stops[MAX_TABS];        /* Tab stop positions */
162
163 // Number of header item names before linebreak
164 int                 header_breaks = DEFAULT_HEADER_BREAKS;
165
166
167 // Path and filename to dot tool
168 char               *dot_name = DEFAULT_DOT_NAME;
169
170
171 /****i* Globals/RB_Close_The_Shop [3.0b]
172  * NAME
173  *   RB_Close_The_Shop -- free resources.
174  * SYNOPSIS
175  *   void RB_Close_The_Shop ()
176  * FUNCTION
177  *   Frees all resources used by robodoc.
178  * SEE ALSO
179  *   RB_Free_Header(), RB_Free_Link()
180  * SOURCE
181  */
182
183 void RB_Close_The_Shop(
184     void )
185 {
186 /* TODO    if (link_index) { free(link_index); } */
187     if ( myLine )
188     {
189         free( myLine );
190     }
191 }
192
193 /******/