7c6b3cd7 |
1 | #ifndef TYPE_H |
2 | #define TYPE_H |
975e44c7 |
3 | |
1b82f325 |
4 | |
5 | /* Different types allowed */ |
6 | |
963b5f2d |
7 | #include <ltt/ltt.h> |
8 | |
1b82f325 |
9 | |
10 | /* All event types, data types and fields belong to their trace and |
975e44c7 |
11 | are released at the same time. */ |
12 | |
1b82f325 |
13 | /* Obtain the name, description, facility, facility relative id, global id, |
14 | type and root field for an eventtype */ |
15 | |
290dfc8c |
16 | char *ltt_eventtype_name(LttEventType *et); |
975e44c7 |
17 | |
290dfc8c |
18 | char *ltt_eventtype_description(LttEventType *et); |
975e44c7 |
19 | |
290dfc8c |
20 | LttFacility *ltt_eventtype_facility(LttEventType *et); |
1b82f325 |
21 | |
33690006 |
22 | unsigned ltt_eventtype_relative_id(LttEventType *et); |
1b82f325 |
23 | |
33690006 |
24 | unsigned ltt_eventtype_id(LttEventType *et); |
1b82f325 |
25 | |
290dfc8c |
26 | LttType *ltt_eventtype_type(LttEventType *et); |
975e44c7 |
27 | |
290dfc8c |
28 | LttField *ltt_eventtype_field(LttEventType *et); |
1b82f325 |
29 | |
975e44c7 |
30 | |
31 | /* obtain the type name and size. The size is the number of bytes for |
32 | primitive types (INT, UINT, FLOAT, ENUM), or the size for the unsigned |
33 | integer length count for sequences. */ |
34 | |
290dfc8c |
35 | char *ltt_type_name(LttType *t); |
975e44c7 |
36 | |
290dfc8c |
37 | LttTypeEnum ltt_type_class(LttType *t); |
975e44c7 |
38 | |
963b5f2d |
39 | unsigned ltt_type_size(LttTrace *trace, LttType *t); |
975e44c7 |
40 | |
41 | |
42 | /* The type of nested elements for arrays and sequences. */ |
43 | |
290dfc8c |
44 | LttType *ltt_type_element_type(LttType *t); |
975e44c7 |
45 | |
46 | |
47 | /* The number of elements for arrays. */ |
48 | |
290dfc8c |
49 | unsigned ltt_type_element_number(LttType *t); |
975e44c7 |
50 | |
51 | |
a6bf5e74 |
52 | /* The number of data members for structures and unions. */ |
975e44c7 |
53 | |
290dfc8c |
54 | unsigned ltt_type_member_number(LttType *t); |
975e44c7 |
55 | |
56 | |
57 | /* The type of a data member in a structure. */ |
58 | |
5fb21f61 |
59 | LttType *ltt_type_member_type(LttType *t, unsigned i, char ** name); |
975e44c7 |
60 | |
61 | |
62 | /* For enumerations, obtain the symbolic string associated with a value |
63 | (0 to n - 1 for an enumeration of n elements). */ |
64 | |
290dfc8c |
65 | char *ltt_enum_string_get(LttType *t, unsigned i); |
975e44c7 |
66 | |
67 | |
68 | /* The fields form a tree representing a depth first search of the |
69 | corresponding event type directed acyclic graph. Fields for arrays and |
70 | sequences simply point to one nested field representing the currently |
71 | selected element among all the (identically typed) elements. For structures, |
72 | a nested field exists for each data member. Each field stores the |
1b82f325 |
73 | platform/trace specific offset values (for efficient access) and |
290dfc8c |
74 | points back to the corresponding LttType for the rest. */ |
975e44c7 |
75 | |
290dfc8c |
76 | LttField *ltt_field_element(LttField *f); |
975e44c7 |
77 | |
290dfc8c |
78 | LttField *ltt_field_member(LttField *f, unsigned i); |
975e44c7 |
79 | |
290dfc8c |
80 | LttType *ltt_field_type(LttField *f); |
975e44c7 |
81 | |
a5dcde2f |
82 | int ltt_field_size(LttField * f); |
83 | |
7c6b3cd7 |
84 | #endif // TYPE_H |