| 1 | #ifndef TYPE_H |
| 2 | #define TYPE_H |
| 3 | |
| 4 | #include <ltt/ltt.h> |
| 5 | |
| 6 | /* All event types and data types belong to their facilities and |
| 7 | are released at the same time. All fields belong to their tracefile and |
| 8 | are released at the same time. */ |
| 9 | |
| 10 | char *ltt_eventtype_name(ltt_eventtype *et); |
| 11 | |
| 12 | char *ltt_eventtype_description(ltt_eventtype *et); |
| 13 | |
| 14 | ltt_type *ltt_eventtype_type(ltt_eventtype *et); |
| 15 | |
| 16 | |
| 17 | /* obtain the type name and size. The size is the number of bytes for |
| 18 | primitive types (INT, UINT, FLOAT, ENUM), or the size for the unsigned |
| 19 | integer length count for sequences. */ |
| 20 | |
| 21 | char *ltt_type_name(ltt_type *t); |
| 22 | |
| 23 | ltt_type_enum ltt_type_class(ltt_type *t); |
| 24 | |
| 25 | unsigned ltt_type_size(ltt_tracefile * tf, ltt_type *t); |
| 26 | |
| 27 | |
| 28 | /* The type of nested elements for arrays and sequences. */ |
| 29 | |
| 30 | ltt_type *ltt_type_element_type(ltt_type *t); |
| 31 | |
| 32 | |
| 33 | /* The number of elements for arrays. */ |
| 34 | |
| 35 | unsigned ltt_type_element_number(ltt_type *t); |
| 36 | |
| 37 | |
| 38 | /* The number of data members for structures. */ |
| 39 | |
| 40 | unsigned ltt_type_member_number(ltt_type *t); |
| 41 | |
| 42 | |
| 43 | /* The type of a data member in a structure. */ |
| 44 | |
| 45 | ltt_type *ltt_type_member_type(ltt_type *t, unsigned i); |
| 46 | |
| 47 | |
| 48 | /* For enumerations, obtain the symbolic string associated with a value |
| 49 | (0 to n - 1 for an enumeration of n elements). */ |
| 50 | |
| 51 | char *ltt_enum_string_get(ltt_type *t, unsigned i); |
| 52 | |
| 53 | |
| 54 | /* The fields form a tree representing a depth first search of the |
| 55 | corresponding event type directed acyclic graph. Fields for arrays and |
| 56 | sequences simply point to one nested field representing the currently |
| 57 | selected element among all the (identically typed) elements. For structures, |
| 58 | a nested field exists for each data member. Each field stores the |
| 59 | platform/tracefile specific offset values (for efficient access) and |
| 60 | points back to the corresponding ltt_type for the rest. */ |
| 61 | |
| 62 | ltt_field *ltt_field_element(ltt_field *f); |
| 63 | |
| 64 | ltt_field *ltt_field_member(ltt_field *f, unsigned i); |
| 65 | |
| 66 | ltt_type *ltt_field_type(ltt_field *f); |
| 67 | |
| 68 | #endif // TYPE_H |