int8_t action_type;
} LTTNG_PACKED;
+LTTNG_HIDDEN
+void lttng_action_init(struct lttng_action *action,
+ enum lttng_action_type type,
+ action_validate_cb validate,
+ action_serialize_cb serialize,
+ action_destroy_cb destroy);
+
LTTNG_HIDDEN
bool lttng_action_validate(struct lttng_action *action);
return action->type;
}
+LTTNG_HIDDEN
+void lttng_action_init(
+ struct lttng_action *action,
+ enum lttng_action_type type,
+ action_validate_cb validate,
+ action_serialize_cb serialize,
+ action_destroy_cb destroy)
+{
+ action->type = type;
+ action->validate = validate;
+ action->serialize = serialize;
+ action->destroy = destroy;
+}
+
void lttng_action_destroy(struct lttng_action *action)
{
if (!action) {
goto end;
}
- notify->parent.type = LTTNG_ACTION_TYPE_NOTIFY;
- notify->parent.serialize = lttng_action_notify_serialize;
- notify->parent.destroy = lttng_action_notify_destroy;
+ lttng_action_init(¬ify->parent, LTTNG_ACTION_TYPE_NOTIFY, NULL,
+ lttng_action_notify_serialize,
+ lttng_action_notify_destroy);
end:
return ¬ify->parent;
}