1 // SPDX-License-Identifier: MIT
3 * Copyright 2024 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
6 #ifndef _VISIT_DESCRIPTION_H
7 #define _VISIT_DESCRIPTION_H
9 #include <side/trace.h>
11 struct side_description_visitor
{
12 void (*before_event_func
)(const struct side_event_description
*desc
, void *priv
);
13 void (*after_event_func
)(const struct side_event_description
*desc
, void *priv
);
15 void (*before_static_fields_func
)(const struct side_event_description
*desc
, void *priv
);
16 void (*after_static_fields_func
)(const struct side_event_description
*desc
, void *priv
);
18 /* Stack-copy basic types. */
19 void (*before_field_func
)(const struct side_event_field
*item_desc
, void *priv
);
20 void (*after_field_func
)(const struct side_event_field
*item_desc
, void *priv
);
21 void (*before_elem_func
)(const struct side_type
*type_desc
, void *priv
);
22 void (*after_elem_func
)(const struct side_type
*type_desc
, void *priv
);
23 void (*before_option_func
)(const struct side_variant_option
*option_desc
, void *priv
);
24 void (*after_option_func
)(const struct side_variant_option
*option_desc
, void *priv
);
26 void (*null_type_func
)(const struct side_type
*type_desc
, void *priv
);
27 void (*bool_type_func
)(const struct side_type
*type_desc
, void *priv
);
28 void (*integer_type_func
)(const struct side_type
*type_desc
, void *priv
);
29 void (*byte_type_func
)(const struct side_type
*type_desc
, void *priv
);
30 void (*pointer_type_func
)(const struct side_type
*type_desc
, void *priv
);
31 void (*float_type_func
)(const struct side_type
*type_desc
, void *priv
);
32 void (*string_type_func
)(const struct side_type
*type_desc
, void *priv
);
34 /* Stack-copy compound types. */
35 void (*before_struct_type_func
)(const struct side_type_struct
*side_struct
, void *priv
);
36 void (*after_struct_type_func
)(const struct side_type_struct
*side_struct
, void *priv
);
37 void (*before_variant_type_func
)(const struct side_type_variant
*side_variant
, void *priv
);
38 void (*after_variant_type_func
)(const struct side_type_variant
*side_variant
, void *priv
);
39 void (*before_array_type_func
)(const struct side_type_array
*side_array
, void *priv
);
40 void (*after_array_type_func
)(const struct side_type_array
*side_array
, void *priv
);
41 void (*before_vla_type_func
)(const struct side_type_vla
*side_vla
, void *priv
);
42 void (*after_length_vla_type_func
)(const struct side_type_vla
*side_vla
, void *priv
);
43 void (*after_element_vla_type_func
)(const struct side_type_vla
*side_vla
, void *priv
);
44 void (*before_vla_visitor_type_func
)(const struct side_type_vla_visitor
*side_vla_visitor
, void *priv
);
45 void (*after_length_vla_visitor_type_func
)(const struct side_type_vla_visitor
*side_vla_visitor
, void *priv
);
46 void (*after_element_vla_visitor_type_func
)(const struct side_type_vla_visitor
*side_vla_visitor
, void *priv
);
47 void (*before_optional_type_func
)(const struct side_type
*optional
, void *priv
);
48 void (*after_optional_type_func
)(const struct side_type
*optional
, void *priv
);
50 /* Stack-copy enumeration types. */
51 void (*before_enum_type_func
)(const struct side_type
*type_desc
, void *priv
);
52 void (*after_enum_type_func
)(const struct side_type
*type_desc
, void *priv
);
53 void (*before_enum_bitmap_type_func
)(const struct side_type
*type_desc
, void *priv
);
54 void (*after_enum_bitmap_type_func
)(const struct side_type
*type_desc
, void *priv
);
56 /* Gather basic types. */
57 void (*gather_bool_type_func
)(const struct side_type_gather_bool
*type
, void *priv
);
58 void (*gather_byte_type_func
)(const struct side_type_gather_byte
*type
, void *priv
);
59 void (*gather_integer_type_func
)(const struct side_type_gather_integer
*type
, void *priv
);
60 void (*gather_pointer_type_func
)(const struct side_type_gather_integer
*type
, void *priv
);
61 void (*gather_float_type_func
)(const struct side_type_gather_float
*type
, void *priv
);
62 void (*gather_string_type_func
)(const struct side_type_gather_string
*type
, void *priv
);
64 /* Gather compound types. */
65 void (*before_gather_struct_type_func
)(const struct side_type_gather_struct
*type
, void *priv
);
66 void (*after_gather_struct_type_func
)(const struct side_type_gather_struct
*type
, void *priv
);
67 void (*before_gather_array_type_func
)(const struct side_type_gather_array
*type
, void *priv
);
68 void (*after_gather_array_type_func
)(const struct side_type_gather_array
*type
, void *priv
);
69 void (*before_gather_vla_type_func
)(const struct side_type_gather_vla
*type
, void *priv
);
70 void (*after_length_gather_vla_type_func
)(const struct side_type_gather_vla
*type
, void *priv
);
71 void (*after_element_gather_vla_type_func
)(const struct side_type_gather_vla
*type
, void *priv
);
73 /* Gather enumeration types. */
74 void (*before_gather_enum_type_func
)(const struct side_type_gather_enum
*type
, void *priv
);
75 void (*after_gather_enum_type_func
)(const struct side_type_gather_enum
*type
, void *priv
);
78 void (*dynamic_type_func
)(const struct side_type
*type_desc
, void *priv
);
81 void description_visitor_event(const struct side_description_visitor
*description_visitor
,
82 const struct side_event_description
*desc
, void *priv
);
84 #endif /* _VISIT_DESCRIPTION_H */