OTF_Structs gives the global types and functions needed to have the OTF implementation.
More...
#include <stdint.h>
#include "GTGList.h"
#include "GTGStack.h"
Go to the source code of this file.
Macros |
#define | MAX_PROCESS 64 |
#define | ContainerType_NIL 0 |
#define | Container_NIL 0 |
#define | StateType_NIL 0 |
#define | State_NIL 0 |
#define | EntityValue_NIL 0 |
#define | EventType_NIL 0 |
#define | LinkType_NIL 0 |
#define | VariableType_NIL 0 |
#define | Variable_NIL 0 |
#define | init_ContainerType(var) |
#define | init_Container(var) |
#define | init_StateType(var) |
#define | init_EntityValue(var) |
#define | init_EventType(var) |
#define | init_LinkType(var) |
#define | init_VariableType(var) |
#define | init_Variable(var) |
#define | init_State(var) |
#define | alloc_struct(ptr, type, list_head) |
#define | alloc_init_struct(type, ptr, list_head, _name_, _alias_) |
#define | alloc_Variable(_ptr_, _id_, _parent_, _type_, _value_) |
#define | alloc_State(_ptr_, _value_, _cont_, _stateType_) |
#define | free_struct(_type_, _list_head_) |
Detailed Description
Macro Definition Documentation
#define alloc_init_struct |
( |
|
type, |
|
|
|
ptr, |
|
|
|
list_head, |
|
|
|
_name_, |
|
|
|
_alias_ |
|
) |
| |
Value:do { \
alloc_struct(ptr, type, list_head); \
(ptr)->name = (char *)malloc(sizeof(char)*(strlen(_name_)+1)); \
strcpy((ptr)->name, _name_); \
(ptr)->alias = (char *)malloc(sizeof(char)*(strlen(_alias_)+1)); \
strcpy((ptr)->alias, _alias_); \
}while(0)
#define alloc_State |
( |
|
_ptr_, |
|
|
|
_value_, |
|
|
|
_cont_, |
|
|
|
_stateType_ |
|
) |
| |
Value:do { \
init_State(*(_ptr_)); \
(_ptr_)->value = _value_; \
(_ptr_)->cont = _cont_; \
(_ptr_)->stateType = _stateType_; \
}while(0)
#define alloc_struct |
( |
|
ptr, |
|
|
|
type, |
|
|
|
list_head |
|
) |
| |
Value:do { \
ptr = (type*) malloc(sizeof(type)); \
GTG_LIST_INIT(&(ptr->token)); \
gtg_list_add_tail(&(ptr->token), list_head); \
} while(0)
#define alloc_Variable |
( |
|
_ptr_, |
|
|
|
_id_, |
|
|
|
_parent_, |
|
|
|
_type_, |
|
|
|
_value_ |
|
) |
| |
Value:do { \
init_Variable(*(_ptr_)); \
(_ptr_)->id = _id_; \
(_ptr_)->parent = _parent_; \
(_ptr_)->type = _type_; \
(_ptr_)->value = _value_; \
}while(0)
#define ContainerType_NIL 0 |
#define EntityValue_NIL 0 |
#define free_struct |
( |
|
_type_, |
|
|
|
_list_head_ |
|
) |
| |
Value:do{\
_type_ *ptr, *tmp; \
gtg_list_for_each_entry_safe(ptr, tmp, &(_list_head_).token, token) { \
gtg_list_del(&(ptr->token));\
free(ptr->name);\
free(ptr->alias);\
free(ptr);\
}\
}while(0)
#define init_Container |
( |
|
var | ) |
|
Value:do { \
(var).name = NULL; \
(var).alias = NULL; \
GTG_LIST_INIT(&(var).token); \
GTG_STACK_INIT(&(var).state_stack.token); \
}while(0)
#define init_ContainerType |
( |
|
var | ) |
|
Value:do { \
(var).name = NULL; \
(var).alias = NULL; \
GTG_LIST_INIT(&(var).token); \
}while(0)
#define init_EntityValue |
( |
|
var | ) |
|
Value:do { \
(var).name = NULL; \
(var).alias = NULL; \
(var).groupId = 0; \
GTG_LIST_INIT(&(var).token); \
}while(0)
#define init_EventType |
( |
|
var | ) |
|
Value:do { \
(var).name = NULL; \
(var).alias = NULL; \
GTG_LIST_INIT(&(var).token); \
}while(0)
#define init_LinkType |
( |
|
var | ) |
|
Value:do { \
(var).name = NULL; \
(var).alias = NULL; \
GTG_LIST_INIT(&(var).token); \
}while(0)
#define init_State |
( |
|
var | ) |
|
Value:do { \
GTG_STACK_INIT(&(var).token); \
}while(0)
#define init_StateType |
( |
|
var | ) |
|
Value:do { \
(var).name = NULL; \
(var).alias = NULL; \
(var).groupId = 0; \
GTG_LIST_INIT(&(var).token); \
}while(0)
#define init_Variable |
( |
|
var | ) |
|
Value:do { \
(var).value = 0; \
GTG_LIST_INIT(&(var).token); \
}while(0)
#define init_VariableType |
( |
|
var | ) |
|
Value:do { \
(var).name = NULL; \
(var).alias = NULL; \
GTG_LIST_INIT(&(var).token); \
}while(0)
#define VariableType_NIL 0 |
Typedef Documentation