17 #ifndef _GTG_OTF_STRUCTS_H_
18 #define _GTG_OTF_STRUCTS_H_
25 #define MAX_PROCESS 64
123 #define ContainerType_NIL 0
124 #define Container_NIL 0
125 #define StateType_NIL 0
127 #define EntityValue_NIL 0
128 #define EventType_NIL 0
129 #define LinkType_NIL 0
130 #define VariableType_NIL 0
131 #define Variable_NIL 0
133 #define init_ContainerType(var)\
136 (var).alias = NULL; \
137 (var).id = ContainerType_NIL; \
138 GTG_LIST_INIT(&(var).token); \
141 #define init_Container(var) \
144 (var).alias = NULL; \
145 (var).ctType = ContainerType_NIL; \
146 (var).id = Container_NIL; \
147 GTG_LIST_INIT(&(var).token); \
148 GTG_STACK_INIT(&(var).state_stack.token); \
151 #define init_StateType(var) \
154 (var).alias = NULL; \
156 (var).id = StateType_NIL; \
157 GTG_LIST_INIT(&(var).token); \
160 #define init_EntityValue(var) \
163 (var).alias = NULL; \
165 (var).id = EntityValue_NIL; \
166 GTG_LIST_INIT(&(var).token); \
169 #define init_EventType(var) \
172 (var).alias = NULL; \
173 (var).contType = ContainerType_NIL; \
174 (var).id = EventType_NIL; \
175 GTG_LIST_INIT(&(var).token); \
178 #define init_LinkType(var) \
181 (var).alias = NULL; \
182 (var).contType = ContainerType_NIL; \
183 (var).srcType = ContainerType_NIL; \
184 (var).destType = ContainerType_NIL; \
185 (var).id = LinkType_NIL; \
186 GTG_LIST_INIT(&(var).token); \
189 #define init_VariableType(var) \
192 (var).alias = NULL; \
193 (var).contType = ContainerType_NIL; \
194 (var).id = VariableType_NIL; \
195 GTG_LIST_INIT(&(var).token); \
198 #define init_Variable(var) \
200 (var).parent = Container_NIL; \
201 (var).parent = VariableType_NIL; \
203 (var).id = Variable_NIL; \
204 GTG_LIST_INIT(&(var).token); \
207 #define init_State(var) \
209 (var).value = EntityValue_NIL; \
210 (var).cont = Container_NIL; \
211 (var).stateType = StateType_NIL; \
212 GTG_STACK_INIT(&(var).token); \
216 #define alloc_struct(ptr, type, list_head) \
218 ptr = (type*) malloc(sizeof(type)); \
219 GTG_LIST_INIT(&(ptr->token)); \
220 ptr->id = (gtg_list_entry((list_head)->prev, type, token)->id) + 1; \
221 gtg_list_add_tail(&(ptr->token), list_head); \
224 #define alloc_init_struct(type, ptr, list_head, _name_, _alias_) \
226 alloc_struct(ptr, type, list_head); \
227 (ptr)->name = (char *)malloc(sizeof(char)*(strlen(_name_)+1)); \
228 strcpy((ptr)->name, _name_); \
229 (ptr)->alias = (char *)malloc(sizeof(char)*(strlen(_alias_)+1)); \
230 strcpy((ptr)->alias, _alias_); \
233 #define alloc_Variable(_ptr_, _id_, _parent_, _type_, _value_) \
235 (_ptr_) = (Variable_t*) malloc(sizeof(Variable_t)); \
236 init_Variable(*(_ptr_)); \
237 (_ptr_)->id = _id_; \
238 (_ptr_)->parent = _parent_; \
239 (_ptr_)->type = _type_; \
240 (_ptr_)->value = _value_; \
243 #define alloc_State(_ptr_, _value_, _cont_, _stateType_) \
245 _ptr_ = (State_t*) malloc(sizeof(State_t)); \
246 init_State(*(_ptr_)); \
247 (_ptr_)->value = _value_; \
248 (_ptr_)->cont = _cont_; \
249 (_ptr_)->stateType = _stateType_; \
252 #define free_struct(_type_, _list_head_)\
255 gtg_list_for_each_entry_safe(ptr, tmp, &(_list_head_).token, token) { \
256 gtg_list_del(&(ptr->token));\
struct EventType EventType_t
struct StateType StateType_t
struct VariableType VariableType_t
struct ContainerType ContainerType_t
struct Variable Variable_t
struct otf_color * otf_color_t
Definition: GTGOTF_Structs.h:121
struct Container Container_t
struct EntityValue EntityValue_t
struct LinkType LinkType_t
double varPrec
Use the double precision type for time and value.
Definition: GTGTypes.h:28
Definition: GTGOTF_Structs.h:45
int id
Definition: GTGOTF_Structs.h:48
struct gtg_list token
Definition: GTGOTF_Structs.h:49
char * alias
Definition: GTGOTF_Structs.h:47
char * name
Definition: GTGOTF_Structs.h:46
Definition: GTGOTF_Structs.h:53
int id
Definition: GTGOTF_Structs.h:57
int ctType
Definition: GTGOTF_Structs.h:56
char * name
Definition: GTGOTF_Structs.h:54
char * alias
Definition: GTGOTF_Structs.h:55
struct gtg_list token
Definition: GTGOTF_Structs.h:58
State_t state_stack
Definition: GTGOTF_Structs.h:59
Definition: GTGOTF_Structs.h:63
struct gtg_list token
Definition: GTGOTF_Structs.h:68
char * name
Definition: GTGOTF_Structs.h:64
int id
Definition: GTGOTF_Structs.h:67
char * alias
Definition: GTGOTF_Structs.h:65
int groupId
Definition: GTGOTF_Structs.h:66
Definition: GTGOTF_Structs.h:72
char * name
Definition: GTGOTF_Structs.h:73
int id
Definition: GTGOTF_Structs.h:76
char * alias
Definition: GTGOTF_Structs.h:74
struct gtg_list token
Definition: GTGOTF_Structs.h:77
int contType
Definition: GTGOTF_Structs.h:75
Definition: GTGOTF_Structs.h:81
int srcType
Definition: GTGOTF_Structs.h:85
int contType
Definition: GTGOTF_Structs.h:84
struct gtg_list token
Definition: GTGOTF_Structs.h:88
char * alias
Definition: GTGOTF_Structs.h:83
char * name
Definition: GTGOTF_Structs.h:82
int destType
Definition: GTGOTF_Structs.h:86
int id
Definition: GTGOTF_Structs.h:87
Definition: GTGOTF_Structs.h:91
varPrec time
Definition: GTGOTF_Structs.h:92
int src
Definition: GTGOTF_Structs.h:93
Definition: GTGOTF_Structs.h:28
char * name
Definition: GTGOTF_Structs.h:29
int id
Definition: GTGOTF_Structs.h:32
struct gtg_list token
Definition: GTGOTF_Structs.h:33
int groupId
Definition: GTGOTF_Structs.h:31
char * alias
Definition: GTGOTF_Structs.h:30
Definition: GTGOTF_Structs.h:37
int cont
Definition: GTGOTF_Structs.h:39
int stateType
Definition: GTGOTF_Structs.h:40
gtg_stack token
Definition: GTGOTF_Structs.h:41
int value
Definition: GTGOTF_Structs.h:38
Definition: GTGOTF_Structs.h:98
char * alias
Definition: GTGOTF_Structs.h:100
struct gtg_list token
Definition: GTGOTF_Structs.h:103
char * name
Definition: GTGOTF_Structs.h:99
int contType
Definition: GTGOTF_Structs.h:101
int id
Definition: GTGOTF_Structs.h:102
Definition: GTGOTF_Structs.h:106
struct gtg_list token
Definition: GTGOTF_Structs.h:111
int parent
Definition: GTGOTF_Structs.h:107
int type
Definition: GTGOTF_Structs.h:108
uint64_t value
Definition: GTGOTF_Structs.h:109
int id
Definition: GTGOTF_Structs.h:110
Definition: GTGOTF_Structs.h:114
char * colorID
Definition: GTGOTF_Structs.h:115
uint8_t green
Definition: GTGOTF_Structs.h:117
uint8_t blue
Definition: GTGOTF_Structs.h:118
uint8_t red
Definition: GTGOTF_Structs.h:116