File: items.h

package info (click to toggle)
robodoc 4.99.40-1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 1,560 kB
  • ctags: 978
  • sloc: ansic: 14,067; sh: 3,711; perl: 155; makefile: 108
file content (153 lines) | stat: -rw-r--r-- 4,547 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
#ifndef ROBODOC_ITEMS_H
#define ROBODOC_ITEMS_H

/*
Copyright (C) 1994-2007  Frans Slothouber, Jacco van Weert, Petteri Kettunen,
Bernd Koesling, Thomas Aglassinger, Anthon Pang, Stefan Kost, David Druffner,
Sasha Vasko, Kai Hofmann, Thierry Pierron, Friedrich Haase, and Gergely Budai.

This file is part of ROBODoc

ROBODoc is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.

*/


#include "robodoc.h"

/****t* Items/ItemTypes 
 * NAME 
 *   ItemTypes -- enumeration of item types
 * FUNCTION
 *   Defines a number of item types. There are two kind of items:
 *   * the SOURCE item which is always available,
 *   * and items defined by the user (or through the default items).
 * NOTES
 *   Never check an item type against SOURCECODE_ITEM directily!
 *   Use Works_Like_SourceItem() function instead.
 * SOURCE
 */

enum ItemType
{ POSSIBLE_ITEM = -2, NO_ITEM = -1, SOURCECODE_ITEM = 0, OTHER_ITEM };

/*****/

/* This should be an enum */
#define RBILA_BEGIN_PARAGRAPH  ( 1 <<  1 )
#define RBILA_END_PARAGRAPH    ( 1 <<  2 )
#define RBILA_BEGIN_LIST       ( 1 <<  3 )
#define RBILA_END_LIST         ( 1 <<  4 )
#define RBILA_BEGIN_LIST_ITEM  ( 1 <<  5 )
#define RBILA_END_LIST_ITEM    ( 1 <<  6 )
#define RBILA_BEGIN_PRE        ( 1 <<  7 )
#define RBILA_END_PRE          ( 1 <<  8 )
#define RBILA_BEGIN_SOURCE     ( 1 <<  9 )
#define RBILA_END_SOURCE       ( 1 << 10 )

/****s* Items/ItemLineKind
 * FUNCTION
 *   Holds the type of an item line
 * SOURCE
 */

enum ItemLineKind
{
    ITEM_LINE_RAW,              /* A line that does not start with a remark marker */
    ITEM_LINE_PLAIN,            /* A line that starts with a remark marker */
    ITEM_LINE_PIPE,             /* A line that starts with a remark marked and is
                                   followed by a pipe marker. */
    ITEM_LINE_END,              /* The last line of an item */

    ITEM_LINE_TOOL_START,       /* Start line of a tool item */
    ITEM_LINE_TOOL_BODY,        /* Body of a tool item */
    ITEM_LINE_TOOL_END,         /* End line of a tool item */
    ITEM_LINE_EXEC,             /* Exec item */
    ITEM_LINE_DOT_START,        /* Similar to TOOL_START but use DOT tool */
    ITEM_LINE_DOT_END,          /* End line of a DOT item */
    ITEM_LINE_DOT_FILE          /* DOT file to include */
};

/*****/

/****s* Items/RB_Item_Line
 * FUNCTION
 *   Holds the attributes and the content of an item line
 *  ATTRIBUTES
 *    * line        -- The contents of the item line
 *    * kind        -- The type of the line (see: ItemLineKind)
 *    * format      -- Formatting attributes for the line
 *    * pipe_mode   -- The output mode
 *    * line_number -- The original source line number of the line
 * SOURCE
 */

struct RB_Item_Line
{
    char               *line;
    enum ItemLineKind   kind;
    long                format;
    T_RB_DocType        pipe_mode;
    int                 line_number;
};

/******/

/****s* Items/RB_Item
 * FUNCTION
 *   Keeps track of where items start end end in the header.
 *   The index numbers point to the lines array in
 *   RB_header.
 * SOURCE
 */

struct RB_Item
{
    struct RB_Item     *next;
    enum ItemType       type;
    int                 no_lines;
    struct RB_Item_Line **lines;
    int                 begin_index;
    int                 end_index;
    int                 max_line_number;
};

/******/



int                 RB_Get_Item_Type(
    char * );
int                 RB_Get_Item_Attr(
    char *cmp_name );
enum ItemType       RB_Is_ItemName(
    char *line );
int                 RB_Ignore_Last_Item(
    void );
char               *RB_Get_Item_Name(
    void );
struct RB_Item     *RB_Create_Item(
    enum ItemType arg_item_type );
int                 Is_Ignore_Item(
    char *name );
int                 Works_Like_SourceItem(
    enum ItemType item_type );

int                 Is_Preformatted_Item(
    enum ItemType item_type );

int                 Is_Format_Item(
    enum ItemType item_type );

#endif /* ROBODOC_ITEMS_H */