Rename: field type -> field class
[babeltrace.git] / plugins / ctf / common / metadata / ctf-meta-update-value-storing-indexes.c
index fe7c4ce9cba5f30756daf8139211a731c1bf86d9..3e01537ac6a34ce0c04637cba5c751782c9b72f6 100644 (file)
@@ -26,7 +26,7 @@
 #include "ctf-meta-visitors.h"
 
 static
-int update_field_type_stored_value_index(struct ctf_field_type *ft,
+int update_field_class_stored_value_index(struct ctf_field_class *fc,
                struct ctf_trace_class *tc,
                struct ctf_stream_class *sc,
                struct ctf_event_class *ec)
@@ -34,30 +34,30 @@ int update_field_type_stored_value_index(struct ctf_field_type *ft,
        int ret = 0;
        uint64_t i;
        struct ctf_field_path *field_path = NULL;
-       struct ctf_field_type_int *tgt_ft = NULL;
+       struct ctf_field_class_int *tgt_fc = NULL;
        uint64_t *stored_value_index = NULL;
 
-       if (!ft) {
+       if (!fc) {
                goto end;
        }
 
-       switch (ft->id) {
-       case CTF_FIELD_TYPE_ID_VARIANT:
+       switch (fc->id) {
+       case CTF_FIELD_CLASS_ID_VARIANT:
        {
-               struct ctf_field_type_variant *var_ft = (void *) ft;
+               struct ctf_field_class_variant *var_fc = (void *) fc;
 
-               field_path = &var_ft->tag_path;
-               stored_value_index = &var_ft->stored_tag_index;
-               tgt_ft = (void *) var_ft->tag_ft;
+               field_path = &var_fc->tag_path;
+               stored_value_index = &var_fc->stored_tag_index;
+               tgt_fc = (void *) var_fc->tag_fc;
                break;
        }
-       case CTF_FIELD_TYPE_ID_SEQUENCE:
+       case CTF_FIELD_CLASS_ID_SEQUENCE:
        {
-               struct ctf_field_type_sequence *seq_ft = (void *) ft;
+               struct ctf_field_class_sequence *seq_fc = (void *) fc;
 
-               field_path = &seq_ft->length_path;
-               stored_value_index = &seq_ft->stored_length_index;
-               tgt_ft = seq_ft->length_ft;
+               field_path = &seq_fc->length_path;
+               stored_value_index = &seq_fc->stored_length_index;
+               tgt_fc = seq_fc->length_fc;
                break;
        }
        default:
@@ -65,31 +65,31 @@ int update_field_type_stored_value_index(struct ctf_field_type *ft,
        }
 
        if (field_path) {
-               BT_ASSERT(tgt_ft);
-               BT_ASSERT(tgt_ft->base.base.id == CTF_FIELD_TYPE_ID_INT ||
-                       tgt_ft->base.base.id == CTF_FIELD_TYPE_ID_ENUM);
-               if (tgt_ft->storing_index >= 0) {
+               BT_ASSERT(tgt_fc);
+               BT_ASSERT(tgt_fc->base.base.id == CTF_FIELD_CLASS_ID_INT ||
+                       tgt_fc->base.base.id == CTF_FIELD_CLASS_ID_ENUM);
+               if (tgt_fc->storing_index >= 0) {
                        /* Already storing its value */
-                       *stored_value_index = (uint64_t) tgt_ft->storing_index;
+                       *stored_value_index = (uint64_t) tgt_fc->storing_index;
                } else {
                        /* Not storing its value: allocate new index */
-                       tgt_ft->storing_index = tc->stored_value_count;
-                       *stored_value_index = (uint64_t) tgt_ft->storing_index;
+                       tgt_fc->storing_index = tc->stored_value_count;
+                       *stored_value_index = (uint64_t) tgt_fc->storing_index;
                        tc->stored_value_count++;
                }
        }
 
-       switch (ft->id) {
-       case CTF_FIELD_TYPE_ID_STRUCT:
+       switch (fc->id) {
+       case CTF_FIELD_CLASS_ID_STRUCT:
        {
-               struct ctf_field_type_struct *struct_ft = (void *) ft;
+               struct ctf_field_class_struct *struct_fc = (void *) fc;
 
-               for (i = 0; i < struct_ft->members->len; i++) {
-                       struct ctf_named_field_type *named_ft =
-                               ctf_field_type_struct_borrow_member_by_index(
-                                       struct_ft, i);
+               for (i = 0; i < struct_fc->members->len; i++) {
+                       struct ctf_named_field_class *named_fc =
+                               ctf_field_class_struct_borrow_member_by_index(
+                                       struct_fc, i);
 
-                       ret = update_field_type_stored_value_index(named_ft->ft,
+                       ret = update_field_class_stored_value_index(named_fc->fc,
                                tc, sc, ec);
                        if (ret) {
                                goto end;
@@ -98,16 +98,16 @@ int update_field_type_stored_value_index(struct ctf_field_type *ft,
 
                break;
        }
-       case CTF_FIELD_TYPE_ID_VARIANT:
+       case CTF_FIELD_CLASS_ID_VARIANT:
        {
-               struct ctf_field_type_variant *var_ft = (void *) ft;
+               struct ctf_field_class_variant *var_fc = (void *) fc;
 
-               for (i = 0; i < var_ft->options->len; i++) {
-                       struct ctf_named_field_type *named_ft =
-                               ctf_field_type_variant_borrow_option_by_index(
-                                       var_ft, i);
+               for (i = 0; i < var_fc->options->len; i++) {
+                       struct ctf_named_field_class *named_fc =
+                               ctf_field_class_variant_borrow_option_by_index(
+                                       var_fc, i);
 
-                       ret = update_field_type_stored_value_index(named_ft->ft,
+                       ret = update_field_class_stored_value_index(named_fc->fc,
                                tc, sc, ec);
                        if (ret) {
                                goto end;
@@ -116,12 +116,12 @@ int update_field_type_stored_value_index(struct ctf_field_type *ft,
 
                break;
        }
-       case CTF_FIELD_TYPE_ID_ARRAY:
-       case CTF_FIELD_TYPE_ID_SEQUENCE:
+       case CTF_FIELD_CLASS_ID_ARRAY:
+       case CTF_FIELD_CLASS_ID_SEQUENCE:
        {
-               struct ctf_field_type_array_base *array_ft = (void *) ft;
+               struct ctf_field_class_array_base *array_fc = (void *) fc;
 
-               ret = update_field_type_stored_value_index(array_ft->elem_ft,
+               ret = update_field_class_stored_value_index(array_fc->elem_fc,
                        tc, sc, ec);
                if (ret) {
                        goto end;
@@ -143,8 +143,8 @@ int ctf_trace_class_update_value_storing_indexes(struct ctf_trace_class *ctf_tc)
        uint64_t i;
 
        if (!ctf_tc->is_translated) {
-               update_field_type_stored_value_index(
-                       ctf_tc->packet_header_ft, ctf_tc, NULL, NULL);
+               update_field_class_stored_value_index(
+                       ctf_tc->packet_header_fc, ctf_tc, NULL, NULL);
        }
 
        for (i = 0; i < ctf_tc->stream_classes->len; i++) {
@@ -152,12 +152,12 @@ int ctf_trace_class_update_value_storing_indexes(struct ctf_trace_class *ctf_tc)
                struct ctf_stream_class *sc = ctf_tc->stream_classes->pdata[i];
 
                if (!sc->is_translated) {
-                       update_field_type_stored_value_index(sc->packet_context_ft,
+                       update_field_class_stored_value_index(sc->packet_context_fc,
                                ctf_tc, sc, NULL);
-                       update_field_type_stored_value_index(sc->event_header_ft,
+                       update_field_class_stored_value_index(sc->event_header_fc,
                                ctf_tc, sc, NULL);
-                       update_field_type_stored_value_index(
-                               sc->event_common_context_ft, ctf_tc, sc, NULL);
+                       update_field_class_stored_value_index(
+                               sc->event_common_context_fc, ctf_tc, sc, NULL);
                }
 
                for (j = 0; j < sc->event_classes->len; j++) {
@@ -165,10 +165,10 @@ int ctf_trace_class_update_value_storing_indexes(struct ctf_trace_class *ctf_tc)
                                sc->event_classes->pdata[j];
 
                        if (!ec->is_translated) {
-                               update_field_type_stored_value_index(
-                                       ec->spec_context_ft, ctf_tc, sc, ec);
-                               update_field_type_stored_value_index(
-                                       ec->payload_ft, ctf_tc, sc, ec);
+                               update_field_class_stored_value_index(
+                                       ec->spec_context_fc, ctf_tc, sc, ec);
+                               update_field_class_stored_value_index(
+                                       ec->payload_fc, ctf_tc, sc, ec);
                        }
                }
        }
This page took 0.027862 seconds and 4 git commands to generate.