System/SysMon: rework the code to handle negative result of Entries - Visible
[AROS.git] / tools / cxref / datatype.h
blob2bc08f11f097544de8d76cbbc43a253f2fde1a53
1 /***************************************
2 $Header$
4 C Cross Referencing & Documentation tool. Version 1.5.
6 Definition of the different variables types that are used.
7 ******************/ /******************
8 Written by Andrew M. Bishop
10 This file Copyright 1995,96,97,99 Andrew M. Bishop
11 It may be distributed under the GNU Public License, version 2, or
12 any higher version. See section COPYING of the GNU Public license
13 for conditions under which this file may be redistributed.
14 ***************************************/
17 #ifndef DATA_TYPE_H
18 #define DATA_TYPE_H /*+ To stop multiple inclusions. +*/
20 /*+ A pointer type to file information. +*/
21 typedef struct _File *File;
23 /*+ A pointer type to #include information. +*/
24 typedef struct _Include *Include;
26 /*+ A pointer type to #define information. +*/
27 typedef struct _Define *Define;
29 /*+ A pointer type to typedef information. +*/
30 typedef struct _Typedef *Typedef;
32 /*+ A pointer type to variable information. +*/
33 typedef struct _Variable *Variable;
35 /*+ A pointer type to function information. +*/
36 typedef struct _Function *Function;
38 /*+ A pointer type to struct and union information. +*/
39 typedef struct _StructUnion *StructUnion;
41 /*+ A data structure to contain lists of strings, eg functions that are called. +*/
42 typedef struct _StringList
44 int n; /*+ The number of strings in the list. +*/
45 char** s; /*+ The strings. +*/
47 *StringList;
49 /*+ A data structure to contain two lists of strings, eg arguments and comments. +*/
50 typedef struct _StringList2
52 int n; /*+ The number of strings in the list. +*/
53 char** s1; /*+ The first set of strings. +*/
54 char** s2; /*+ The second set of strings. +*/
56 *StringList2;
59 /*+ A data structure to contain a complete file worth of information. +*/
60 struct _File
62 char* comment; /*+ The file comment. +*/
64 char* name; /*+ The name of the file. +*/
66 Include includes; /*+ A linked list of include files. +*/
68 Define defines; /*+ A linked list of #defines. +*/
70 Typedef typedefs; /*+ A linked list of type definitions. +*/
72 Variable variables; /*+ A linked list of variable definitions. +*/
74 Function functions; /*+ A linked list of function prototypes. +*/
76 StringList inc_in; /*+ The files that this file is included in. +*/
78 StringList2 f_refs; /*+ The functions that are referenced. +*/
79 StringList2 v_refs; /*+ The variables that are referenced. +*/
82 /*+ A data structure to contain information about a #include. +*/
83 struct _Include
85 char* comment; /*+ The comment for the include file. +*/
87 char* name; /*+ The name of the included file. +*/
89 int scope; /*+ The type of file, LOCAL or GLOBAL. +*/
91 Include includes; /*+ The files that are include by this file. +*/
93 Include next; /*+ A pointer to the next item. +*/
96 /*+ A data structure to contain information about a #define. +*/
97 struct _Define
99 char* comment; /*+ The comment for the #define. +*/
101 char* name; /*+ The name that is defined. +*/
102 char* value; /*+ The value that is defined (if simple). +*/
104 StringList2 args; /*+ The arguments to the #define function. +*/
106 int lineno; /*+ The line number that this definition appears on. +*/
108 Define next; /*+ A pointer to the next item. +*/
111 /*+ A data structure to contain the information for a typedef. +*/
112 struct _Typedef
114 char* comment; /*+ The comment for the type definition. +*/
116 char* name; /*+ The name of the defined type. +*/
118 char* type; /*+ The type of the definition. +*/
119 StructUnion sutype; /*+ The type of the definition if it is a locally declared struct / union. +*/
120 Typedef typexref; /*+ The type of the definition if it is not locally declared or a repeat definition. +*/
122 int lineno; /*+ The line number that this type definition appears on. +*/
124 Typedef next; /*+ A pointer to the next item. +*/
127 /*+ A data structure to contain the information for a variable. +*/
128 struct _Variable
130 char* comment; /*+ The comment for the variable. +*/
132 char* name; /*+ The name of the variable. +*/
134 char* type; /*+ The type of the variable. +*/
136 int scope; /*+ The scope of the variable, STATIC, GLOBAL or EXTERNAL +*/
138 char* defined; /*+ The name of the file that the variable is defined in as global if extern here. +*/
140 char* incfrom; /*+ The name of the file that the variable is included from if any. +*/
142 StringList2 visible; /*+ The names of the files that the variable is visible in. +*/
143 StringList2 used; /*+ The names of the files that the variable is used in. +*/
145 int lineno; /*+ The line number that this variable definition appears on. +*/
147 Variable next; /*+ A pointer to the next item. +*/
150 /*+ A data structure to contain information for a function definition. +*/
151 struct _Function
153 char* comment; /*+ The comment for the function. +*/
155 char* name; /*+ The name of the function. +*/
157 char* type; /*+ The return type of the function. +*/
158 char* cret; /*+ A comment for the returned value. +*/
160 char* protofile; /*+ The name of the file where the function is prototyped +*/
162 char* incfrom; /*+ The name of the file that the function is included from if any. +*/
164 StringList2 args; /*+ The arguments to the function. +*/
166 int scope; /*+ The scope of the function, LOCAL or GLOBAL. +*/
168 StringList protos; /*+ The functions that are prototyped within this function. +*/
170 StringList2 calls; /*+ The functions that are called from this function. +*/
171 StringList2 called; /*+ The names of the functions that call this one. +*/
172 StringList2 used; /*+ The places that the function is used, (references not direct calls). +*/
174 StringList2 v_refs; /*+ The variables that are referenced from this function. +*/
175 StringList2 f_refs; /*+ The functions that are referenced from this function. +*/
177 int lineno; /*+ The line number that this function definition appears on. +*/
179 Function next; /*+ A pointer to the next item. +*/
182 /*+ A data structure to contain a structure definition to allow structures to be matched to their typedefs (if any). +*/
183 struct _StructUnion
185 char* comment; /*+ The comment for the struct or union or simple component. +*/
187 char* name; /*+ The name of the struct or union or simple component. +*/
189 int n_comp; /*+ The number of sub-components (if none then it is simple). +*/
190 StructUnion* comps; /*+ The sub-components. +*/
194 /*++++++++++++++++++++++++++++++++++++++
195 A function to add a pointer to the end of a linked list.
197 dst The destination, where the pointer is to be added to.
199 type The type of the pointer.
201 src The pointer that is to be added to the end of the linked list.
202 ++++++++++++++++++++++++++++++++++++++*/
204 #define AddToLinkedList(dst,type,src) { \
205 if(dst) \
207 type temp=dst; \
208 while(temp && temp->next) \
209 temp=temp->next; \
210 temp->next=src; \
212 else \
213 dst=src; \
215 #endif /* DATA_TYPE_H */