| 1 | /* |
| 2 | * SPDX-License-Identifier: MIT |
| 3 | * |
| 4 | * Copyright 2019 Philippe Proulx <pproulx@efficios.com> |
| 5 | */ |
| 6 | |
| 7 | #ifndef BABELTRACE_PLUGINS_TEXT_DETAILS_WRITE_H |
| 8 | #define BABELTRACE_PLUGINS_TEXT_DETAILS_WRITE_H |
| 9 | |
| 10 | #include <glib.h> |
| 11 | #include <babeltrace2/babeltrace.h> |
| 12 | #include <stdbool.h> |
| 13 | |
| 14 | #include "details.h" |
| 15 | |
| 16 | /* Writing context */ |
| 17 | struct details_write_ctx { |
| 18 | /* Weak */ |
| 19 | struct details_comp *details_comp; |
| 20 | |
| 21 | /* Weak (belongs to `details_comp` above) */ |
| 22 | GString *str; |
| 23 | |
| 24 | /* Current indentation level (number of actual spaces) */ |
| 25 | unsigned int indent_level; |
| 26 | }; |
| 27 | |
| 28 | /* |
| 29 | * Writes the message `msg` to the component's output buffer |
| 30 | * (`details_comp->str`). |
| 31 | */ |
| 32 | int details_write_message(struct details_comp *details_comp, |
| 33 | const bt_message *msg); |
| 34 | |
| 35 | #endif /* BABELTRACE_PLUGINS_TEXT_DETAILS_WRITE_H */ |