#include "ctf-meta-visitors.hpp"
-struct ctx
+namespace ctf {
+
+struct MetaTranslateCtx
{
bt_self_component *self_comp;
bt_trace_class *ir_tc;
enum ctf_scope scope;
};
-static inline bt_field_class *ctf_field_class_to_ir(struct ctx *ctx, struct ctf_field_class *fc);
+} /* namespace ctf */
+
+static inline bt_field_class *ctf_field_class_to_ir(ctf::MetaTranslateCtx *ctx,
+ struct ctf_field_class *fc);
static inline void ctf_field_class_int_set_props(struct ctf_field_class_int *fc,
bt_field_class *ir_fc)
bt_field_class_integer_set_preferred_display_base(ir_fc, fc->disp_base);
}
-static inline bt_field_class *ctf_field_class_int_to_ir(struct ctx *ctx,
+static inline bt_field_class *ctf_field_class_int_to_ir(ctf::MetaTranslateCtx *ctx,
struct ctf_field_class_int *fc)
{
bt_field_class *ir_fc;
return ir_fc;
}
-static inline bt_field_class *ctf_field_class_enum_to_ir(struct ctx *ctx,
+static inline bt_field_class *ctf_field_class_enum_to_ir(ctf::MetaTranslateCtx *ctx,
struct ctf_field_class_enum *fc)
{
int ret;
return ir_fc;
}
-static inline bt_field_class *ctf_field_class_float_to_ir(struct ctx *ctx,
+static inline bt_field_class *ctf_field_class_float_to_ir(ctf::MetaTranslateCtx *ctx,
struct ctf_field_class_float *fc)
{
bt_field_class *ir_fc;
return ir_fc;
}
-static inline bt_field_class *ctf_field_class_string_to_ir(struct ctx *ctx,
- struct ctf_field_class_string *)
+static inline bt_field_class *ctf_field_class_string_to_ir(ctf::MetaTranslateCtx *ctx)
{
bt_field_class *ir_fc = bt_field_class_string_create(ctx->ir_tc);
return ir_fc;
}
-static inline void translate_struct_field_class_members(struct ctx *ctx,
+static inline void translate_struct_field_class_members(ctf::MetaTranslateCtx *ctx,
struct ctf_field_class_struct *fc,
bt_field_class *ir_fc, bool,
struct ctf_field_class_struct *)
}
}
-static inline bt_field_class *ctf_field_class_struct_to_ir(struct ctx *ctx,
+static inline bt_field_class *ctf_field_class_struct_to_ir(ctf::MetaTranslateCtx *ctx,
struct ctf_field_class_struct *fc)
{
bt_field_class *ir_fc = bt_field_class_structure_create(ctx->ir_tc);
return ir_fc;
}
-static inline bt_field_class *borrow_ir_fc_from_field_path(struct ctx *ctx,
+static inline bt_field_class *borrow_ir_fc_from_field_path(ctf::MetaTranslateCtx *ctx,
struct ctf_field_path *field_path)
{
bt_field_class *ir_fc = NULL;
return mapping;
}
-static inline bt_field_class *ctf_field_class_variant_to_ir(struct ctx *ctx,
+static inline bt_field_class *ctf_field_class_variant_to_ir(ctf::MetaTranslateCtx *ctx,
struct ctf_field_class_variant *fc)
{
int ret;
return ir_fc;
}
-static inline bt_field_class *ctf_field_class_array_to_ir(struct ctx *ctx,
+static inline bt_field_class *ctf_field_class_array_to_ir(ctf::MetaTranslateCtx *ctx,
struct ctf_field_class_array *fc)
{
bt_field_class *ir_fc;
return ir_fc;
}
-static inline bt_field_class *ctf_field_class_sequence_to_ir(struct ctx *ctx,
+static inline bt_field_class *ctf_field_class_sequence_to_ir(ctf::MetaTranslateCtx *ctx,
struct ctf_field_class_sequence *fc)
{
bt_field_class *ir_fc;
return ir_fc;
}
-static inline bt_field_class *ctf_field_class_to_ir(struct ctx *ctx, struct ctf_field_class *fc)
+static inline bt_field_class *ctf_field_class_to_ir(ctf::MetaTranslateCtx *ctx,
+ struct ctf_field_class *fc)
{
bt_field_class *ir_fc = NULL;
ir_fc = ctf_field_class_float_to_ir(ctx, ctf_field_class_as_float(fc));
break;
case CTF_FIELD_CLASS_TYPE_STRING:
- ir_fc = ctf_field_class_string_to_ir(ctx, ctf_field_class_as_string(fc));
+ ir_fc = ctf_field_class_string_to_ir(ctx);
break;
case CTF_FIELD_CLASS_TYPE_STRUCT:
ir_fc = ctf_field_class_struct_to_ir(ctx, ctf_field_class_as_struct(fc));
return has_immediate_member_in_ir;
}
-static inline bt_field_class *scope_ctf_field_class_to_ir(struct ctx *ctx)
+static inline bt_field_class *scope_ctf_field_class_to_ir(ctf::MetaTranslateCtx *ctx)
{
bt_field_class *ir_fc = NULL;
struct ctf_field_class *fc = NULL;
return ir_fc;
}
-static inline void ctf_event_class_to_ir(struct ctx *ctx)
+static inline void ctf_event_class_to_ir(ctf::MetaTranslateCtx *ctx)
{
int ret;
bt_event_class *ir_ec = NULL;
return;
}
-static inline void ctf_stream_class_to_ir(struct ctx *ctx)
+static inline void ctf_stream_class_to_ir(ctf::MetaTranslateCtx *ctx)
{
int ret;
bt_field_class *ir_fc;
bt_clock_class_set_origin_is_unix_epoch(ir_cc, cc->is_absolute);
}
-static inline int ctf_trace_class_to_ir(struct ctx *ctx)
+static inline int ctf_trace_class_to_ir(ctf::MetaTranslateCtx *ctx)
{
int ret = 0;
uint64_t i;
{
int ret = 0;
uint64_t i;
- struct ctx ctx = {};
+ ctf::MetaTranslateCtx ctx = {};
ctx.self_comp = self_comp;
ctx.tc = tc;