X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=ltt%2Fbranches%2Fpoly%2Finclude%2Fltt%2Ftype.h;h=de1fd03ccb576df9e38286530a91da8b2db2afb0;hb=86fd9e018236796824f8e4ffe05b3f553c67ad7b;hp=a65a3200313552a792497b203b506a7f21884f75;hpb=66f52ff0ba9c55af63cb0b30d94a57fb1030a292;p=lttv.git diff --git a/ltt/branches/poly/include/ltt/type.h b/ltt/branches/poly/include/ltt/type.h index a65a3200..de1fd03c 100644 --- a/ltt/branches/poly/include/ltt/type.h +++ b/ltt/branches/poly/include/ltt/type.h @@ -1,16 +1,37 @@ +#ifndef TYPE_H +#define TYPE_H #include -/* All event types and data types belong to their facilities and - are released at the same time. All fields belong to their tracefile and + +/* Different types allowed */ + +typedef enum _ltt_type_enum +{ LTT_INT, LTT_UINT, LTT_FLOAT, LTT_STRING, LTT_ENUM, LTT_ARRAY, + LTT_SEQUENCE, LTT_STRUCT +} ltt_type_enum; + + +/* All event types, data types and fields belong to their trace and are released at the same time. */ +/* Obtain the name, description, facility, facility relative id, global id, + type and root field for an eventtype */ + char *ltt_eventtype_name(ltt_eventtype *et); char *ltt_eventtype_description(ltt_eventtype *et); +ltt_facility *ltt_eventtype_facility(ltt_eventtype *et); + +unsigned *ltt_eventtype_relative_id(ltt_eventtype *et); + +unsigned *ltt_eventtype_id(ltt_eventtype *et); + ltt_type *ltt_eventtype_type(ltt_eventtype *et); +ltt_field *ltt_eventtype_field(ltt_eventtype *et); + /* obtain the type name and size. The size is the number of bytes for primitive types (INT, UINT, FLOAT, ENUM), or the size for the unsigned @@ -18,9 +39,9 @@ ltt_type *ltt_eventtype_type(ltt_eventtype *et); char *ltt_type_name(ltt_type *t); -ltt_type_enum *ltt_type_class(ltt_type *t); +ltt_type_enum ltt_type_class(ltt_type *t); -unsigned ltt_type_size(ltt_type *t); +unsigned ltt_type_size(ltt_tracefile * tf, ltt_type *t); /* The type of nested elements for arrays and sequences. */ @@ -54,7 +75,7 @@ char *ltt_enum_string_get(ltt_type *t, unsigned i); sequences simply point to one nested field representing the currently selected element among all the (identically typed) elements. For structures, a nested field exists for each data member. Each field stores the - platform/tracefile specific offset values (for efficient access) and + platform/trace specific offset values (for efficient access) and points back to the corresponding ltt_type for the rest. */ ltt_field *ltt_field_element(ltt_field *f); @@ -63,3 +84,4 @@ ltt_field *ltt_field_member(ltt_field *f, unsigned i); ltt_type *ltt_field_type(ltt_field *f); +#endif // TYPE_H