File: roboconfig.h

package info (click to toggle)
robodoc 4.99.34-3
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 1,468 kB
  • ctags: 1,009
  • sloc: ansic: 14,040; sh: 3,635; makefile: 163; perl: 155
file content (172 lines) | stat: -rw-r--r-- 5,253 bytes parent folder | download
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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
#ifndef ROBODOC_CONFIG_H
#define ROBODOC_CONFIG_H
// vi: spell ff=unix
//
typedef enum
{
    CFL_REMARK = 0,
    CFL_PARAMETER,
    CFL_SECTION,
    CFL_EMPTYLINE,
    CFL_UNKNOWN
} T_Line_Kind;

typedef enum
{
    SK_ITEMS = 0,
    SK_IGNOREITEMS,
    SK_OPTIONS,
    SK_HEADERTYPES,
    SK_IGNORE_FILES,
    SK_ACCEPT_FILES,
    SK_HEADER_MARKERS,
    SK_REMARK_MARKERS,
    SK_END_MARKERS,
    SK_REMARK_BEGIN_MARKERS,
    SK_REMARK_END_MARKERS,
    SK_SOURCE_ITEMS,
    SK_KEYWORDS,
    SK_SOURCE_LINE_COMMENTS,
    SK_HEADER_IGNORE_CHARS,
    SK_HEADER_SEPARATE_CHARS,
    SK_PREFORMATTED_ITEMS,
    SK_FORMAT_ITEMS,
    SK_ITEM_ORDER,
    SK_UNKNOWN
} T_Block_Kind;


/****s* Configuration/keywords_hash_s
 * FUNCTION
 *    Structure for a keyword hash table row.
 * ATTRIBUTES
 *    o keyword -- pointer to the keyword
 *    o next    -- pointer to next entry in the row
 * SOURCE
 */
struct keywords_hash_s
{
    struct keywords_hash_s *next;
    char               *keyword;
};

/*****/


/****s* Configuration/Parameters
 * FUNCTION
 *    Structure to store all the paramters found in a block in the
 *    robodoc configuation file.
 * ATTRIBUTES
 *    o number -- the number of parameters found.
 *    o size   -- the maximum size of the names array.
 *    o names  -- an array with the values of the parameters.
 * NOTES
 *    Find a better name for the attribute 'names'
 * SOURCE
 */

struct Parameters
{
    unsigned int        number;
    unsigned int        size;
    char              **names;
};

/*****/


/****s* Configuration/RB_Configuration
 * FUNCTION
 *   All the data from the robodoc.rc file is stored in this
 *   structure.
 * ATTRIBUTES
 *   o items                 -- an array with names that robodoc recognizes as
 *                              items.  Alsways includes the name "SOURCE" as
 *                              the first element.
 *   o ignore_items          -- an array with the names of items that ROBODoc
 *                              should ignore.
 *   o source_items          -- an array with the names of items that work
 *                              similar to the built-in SOURCE item.
 *   o preformatted_items    -- item names that will be automatically
 *                              preformatted
 *   o format_items          -- item names that should be formatted by the
 *                              browser
 *   o item_order            -- an array with item names that
 *                              indicates which items should be displayed first.
 *   o options               -- Array with all options specified both on the
 *                              commandline as well as in the robodoc.rc file.
 *   o custom_headertypes    -- list with custom header types.
 *   o ignore_files          -- list with wildcard expressions that specifies
 *                              files and directories that robodoc should skip
 *                              while scanning the source tree.
 *   o header_markers        -- list with markers that mark the begin of a
 *                              header.
 *   o remark_markers        -- list with markers that mark a remark.
 *   o end_markers           -- list with markers that markt the end of a
 *                              header.
 *   o remark_begin_markers  -- list of markers that mark the begin of
 *                              a remark.  For instance (*
 *   o remakr_end_markers    -- list of markers that mark the end of a
 *                              remark.  For instance   *)
 *   o keywords              -- source keywords to recognise (and colorise)
 *   o source_line_comments  -- comment markers that span until the end of line
 *   o header_ignore_chars   -- characters for beginning of header remarks
 *   o header_separate_chars -- characters that separates header artifacts
 *
 * SOURCE
 */

struct RB_Configuration
{
    struct Parameters   items;
    struct Parameters   ignore_items;
    struct Parameters   source_items;
    struct Parameters   preformatted_items;
    struct Parameters   format_items;
    struct Parameters   item_order;

    struct Parameters   options;

    struct Parameters   ignore_files;
    struct Parameters   accept_files;

    struct Parameters   custom_headertypes;
    struct Parameters   header_markers;
    struct Parameters   remark_markers;
    struct Parameters   end_markers;
    struct Parameters   remark_begin_markers;
    struct Parameters   remark_end_markers;

    struct Parameters   keywords;
    struct Parameters   source_line_comments;
    struct Parameters   header_ignore_chars;
    struct Parameters   header_separate_chars;
};

/*******/

char               *ReadConfiguration(
    unsigned int argc,
    char **argv,
    char *filename );
void                Free_Configuration(
    void );
void                Install_C_Syntax(
    void );
char               *Find_Keyword(
    char *keyword,
    int len );
char               *Find_Parameter_Exact(
    struct Parameters *params,
    char *paramname );
char               *Find_Parameter_Partial(
    struct Parameters *params,
    char *paramname );
char               *Find_Parameter_Char(
    struct Parameters *params,
    char param );

extern struct RB_Configuration configuration;

#endif