Added options to make Robodoc more customizable.
[robodoc.git] / Source / document.h
1 #ifndef ROBODOC_DOCUMENT_H
2 #define ROBODOC_DOCUMENT_H
3 // vi: spell ff=unix
4 /*
5 Copyright (C) 1994-2007  Frans Slothouber, Jacco van Weert, Petteri Kettunen,
6 Bernd Koesling, Thomas Aglassinger, Anthon Pang, Stefan Kost, David Druffner,
7 Sasha Vasko, Kai Hofmann, Thierry Pierron, Friedrich Haase, and Gergely Budai.
8
9 This file is part of ROBODoc
10
11 ROBODoc is free software; you can redistribute it and/or modify
12 it under the terms of the GNU General Public License as published by
13 the Free Software Foundation; either version 3 of the License, or
14 (at your option) any later version.
15
16 This program is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19 GNU General Public License for more details.
20
21 You should have received a copy of the GNU General Public License
22 along with this program.  If not, see <http://www.gnu.org/licenses/>.
23
24 */
25
26
27 #include <stdio.h>
28 #include "robodoc.h"
29
30 /****s* Document/RB_Document
31  * NAME
32  *   RB_Document -- Information store.
33  * FUNCTION
34  *   A document is a collection of source files and documentation
35  *   files.  Depending on the mode that is used there is either a
36  *   single documentation file or there is one documentation file for
37  *   each source file.  This mapping is stored in RB_Document.  For
38  *   each source file there is an RB_Part. It points to the source
39  *   file, the documentation file, and contains all the headers that
40  *   were found in the source file.
41  *
42  * ATTRIBUTES
43  *   * links    -- linked list of all links.
44  *   * parts    -- linked list of all parts.
45  *   * no_headers -- total number of headers
46  *   * headers  -- array of pointers to all the headers.
47  *   * srctree  -- the list of all sourcefiles in the srcroot.
48  *   * doctype  -- the kind of documentation to be generated.
49  *   * actions  -- what to de while analysing en generating.
50  *   * srcroot  -- root dir for the sourcecode.
51  *   * docroot  -- root dir for the documentation.
52  *   * charset  -- the character set used for HTML and XML
53  *               documentation.
54  *   * first_section_level -- level of the first section, 
55  *                            Defaults to 1 so the first section will
56  *                            be 1.
57  *                            If set to 2 the first section will be 1.1
58  *   * extension -- the extension used for the documentation
59  *                files.
60  *   * css      -- the cascading style sheet to be used.
61  *   * cur_part -- unused   TODO remove.
62  * SOURCE
63  */
64
65 struct RB_Document
66 {
67     struct RB_Part     *cur_part;
68     struct RB_Part     *parts;
69     struct RB_link     *links;
70     unsigned long       no_headers;
71     struct RB_header  **headers;
72     struct RB_Directory *srctree;
73     T_RB_DocType        doctype;        /* HTML RTF etc */
74     actions_t           actions;
75     int                 first_section_level;  /* TODO document use of first_section_level in manual */
76     long                debugmode;      /* TODO This should not be in document */
77     char               *singledoc_name;
78     struct RB_Path     *srcroot;        /* TODO Better make this a char* */
79     struct RB_Path     *docroot;        /* TODO Better make this a char* */
80     char               *charset;        /* HTML, XML? */
81     char               *css;
82     char               *extension;
83     char               *compress;
84     char               *section;
85     /* Docbook specific */
86     char               *doctype_name;    /* name part of the <!DOCTYPE> to be used with docbook output */
87     char               *doctype_location;/* location part of the <!DOCTYPE> to be used with docbook output */
88 };
89
90 /*****/
91
92 struct RB_Document *RB_Get_RB_Document(
93     void );
94 void                RB_Free_RB_Document(
95     struct RB_Document *document );
96 void                RB_Document_Add_Part(
97     struct RB_Document *document,
98     struct RB_Part *part );
99 void                RB_Document_Dump(
100     struct RB_Document *document );
101 void                RB_Document_Determine_DocFilePaths(
102     struct RB_Document *document );
103 void                RB_Document_Determine_DocFileNames(
104     struct RB_Document *document );
105 void                RB_Document_Create_DocFilePaths(
106     struct RB_Document *document );
107 FILE               *RB_Open_SingleDocumentation(
108     struct RB_Document *document );
109 void                RB_Document_Create_Parts(
110     struct RB_Document *document );
111 void                RB_Document_Collect_Headers(
112     struct RB_Document *document );
113 void                RB_Document_Link_Headers(
114     struct RB_Document *document );
115 void                RB_Fill_Header_Filename(
116     struct RB_Document *document );
117
118 struct RB_header   *RB_Document_Check_For_Duplicate(
119     struct RB_Document *arg_document,
120     struct RB_header *hdr );
121
122 void                RB_Document_Sort_Headers(
123     struct RB_Document *document );
124
125 void                RB_Document_Split_Parts(
126     struct RB_Document *document );
127
128 #endif /* ROBODOC_DOCUMENT_H */