lib: strictly type function return status enumerations
[babeltrace.git] / include / babeltrace2 / graph / component-class.h
1 #ifndef BABELTRACE_GRAPH_COMPONENT_CLASS_H
2 #define BABELTRACE_GRAPH_COMPONENT_CLASS_H
3
4 /*
5 * Copyright 2017-2018 Philippe Proulx <pproulx@efficios.com>
6 * Copyright 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 *
8 * Permission is hereby granted, free of charge, to any person obtaining a copy
9 * of this software and associated documentation files (the "Software"), to deal
10 * in the Software without restriction, including without limitation the rights
11 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 * copies of the Software, and to permit persons to whom the Software is
13 * furnished to do so, subject to the following conditions:
14 *
15 * The above copyright notice and this permission notice shall be included in
16 * all copies or substantial portions of the Software.
17 *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24 * SOFTWARE.
25 */
26
27 /* For bt_component_class */
28 #include <babeltrace2/types.h>
29
30 /* For __BT_FUNC_STATUS_* */
31 #define __BT_FUNC_STATUS_ENABLE
32 #include <babeltrace2/func-status.h>
33 #undef __BT_FUNC_STATUS_ENABLE
34
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38
39 typedef enum bt_component_class_init_method_status {
40 BT_COMPONENT_CLASS_INIT_METHOD_STATUS_OK = __BT_FUNC_STATUS_OK,
41 BT_COMPONENT_CLASS_INIT_METHOD_STATUS_ERROR = __BT_FUNC_STATUS_ERROR,
42 BT_COMPONENT_CLASS_INIT_METHOD_STATUS_MEMORY_ERROR = __BT_FUNC_STATUS_MEMORY_ERROR,
43 } bt_component_class_init_method_status;
44
45 typedef enum bt_component_class_port_connected_method_status {
46 BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_OK = __BT_FUNC_STATUS_OK,
47 BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_ERROR = __BT_FUNC_STATUS_ERROR,
48 BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_MEMORY_ERROR = __BT_FUNC_STATUS_MEMORY_ERROR,
49 } bt_component_class_port_connected_method_status;
50
51 typedef enum bt_component_class_query_method_status {
52 BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_OK = __BT_FUNC_STATUS_OK,
53 BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_AGAIN = __BT_FUNC_STATUS_AGAIN,
54 BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_ERROR = __BT_FUNC_STATUS_ERROR,
55 BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_MEMORY_ERROR = __BT_FUNC_STATUS_MEMORY_ERROR,
56 BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_INVALID_OBJECT = __BT_FUNC_STATUS_INVALID_OBJECT,
57 BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_INVALID_PARAMS = __BT_FUNC_STATUS_INVALID_PARAMS,
58 } bt_component_class_query_method_status;
59
60 typedef enum bt_component_class_message_iterator_init_method_status {
61 BT_COMPONENT_CLASS_MESSAGE_ITERATOR_INIT_METHOD_STATUS_OK = __BT_FUNC_STATUS_OK,
62 BT_COMPONENT_CLASS_MESSAGE_ITERATOR_INIT_METHOD_STATUS_ERROR = __BT_FUNC_STATUS_ERROR,
63 BT_COMPONENT_CLASS_MESSAGE_ITERATOR_INIT_METHOD_STATUS_MEMORY_ERROR = __BT_FUNC_STATUS_MEMORY_ERROR,
64 } bt_component_class_message_iterator_init_method_status;
65
66 typedef enum bt_component_class_message_iterator_next_method_status {
67 BT_COMPONENT_CLASS_MESSAGE_ITERATOR_NEXT_METHOD_STATUS_OK = __BT_FUNC_STATUS_OK,
68 BT_COMPONENT_CLASS_MESSAGE_ITERATOR_NEXT_METHOD_STATUS_AGAIN = __BT_FUNC_STATUS_AGAIN,
69 BT_COMPONENT_CLASS_MESSAGE_ITERATOR_NEXT_METHOD_STATUS_ERROR = __BT_FUNC_STATUS_ERROR,
70 BT_COMPONENT_CLASS_MESSAGE_ITERATOR_NEXT_METHOD_STATUS_MEMORY_ERROR = __BT_FUNC_STATUS_MEMORY_ERROR,
71 BT_COMPONENT_CLASS_MESSAGE_ITERATOR_NEXT_METHOD_STATUS_END = __BT_FUNC_STATUS_END,
72 } bt_component_class_message_iterator_next_method_status;
73
74 typedef enum bt_component_class_message_iterator_seek_beginning_method_status {
75 BT_COMPONENT_CLASS_MESSAGE_ITERATOR_SEEK_BEGINNING_METHOD_STATUS_OK = __BT_FUNC_STATUS_OK,
76 BT_COMPONENT_CLASS_MESSAGE_ITERATOR_SEEK_BEGINNING_METHOD_STATUS_AGAIN = __BT_FUNC_STATUS_AGAIN,
77 BT_COMPONENT_CLASS_MESSAGE_ITERATOR_SEEK_BEGINNING_METHOD_STATUS_ERROR = __BT_FUNC_STATUS_ERROR,
78 BT_COMPONENT_CLASS_MESSAGE_ITERATOR_SEEK_BEGINNING_METHOD_STATUS_MEMORY_ERROR = __BT_FUNC_STATUS_MEMORY_ERROR,
79 } bt_component_class_message_iterator_seek_beginning_method_status;
80
81 typedef enum bt_component_class_message_iterator_seek_ns_from_origin_method_status {
82 BT_COMPONENT_CLASS_MESSAGE_ITERATOR_SEEK_NS_FROM_ORIGIN_METHOD_STATUS_OK = __BT_FUNC_STATUS_OK,
83 BT_COMPONENT_CLASS_MESSAGE_ITERATOR_SEEK_NS_FROM_ORIGIN_METHOD_STATUS_AGAIN = __BT_FUNC_STATUS_AGAIN,
84 BT_COMPONENT_CLASS_MESSAGE_ITERATOR_SEEK_NS_FROM_ORIGIN_METHOD_STATUS_ERROR = __BT_FUNC_STATUS_ERROR,
85 BT_COMPONENT_CLASS_MESSAGE_ITERATOR_SEEK_NS_FROM_ORIGIN_METHOD_STATUS_MEMORY_ERROR = __BT_FUNC_STATUS_MEMORY_ERROR,
86 } bt_component_class_message_iterator_seek_ns_from_origin_method_status;
87
88 typedef enum bt_component_class_set_method_status {
89 BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK = __BT_FUNC_STATUS_OK,
90 } bt_component_class_set_method_status;
91
92 typedef enum bt_component_class_set_description_status {
93 BT_COMPONENT_CLASS_SET_DESCRIPTION_STATUS_OK = __BT_FUNC_STATUS_OK,
94 BT_COMPONENT_CLASS_SET_DESCRIPTION_STATUS_MEMORY_ERROR = __BT_FUNC_STATUS_MEMORY_ERROR,
95 } bt_component_class_set_description_status;
96
97 extern bt_component_class_set_description_status
98 bt_component_class_set_description(bt_component_class *component_class,
99 const char *description);
100
101 typedef enum bt_component_class_set_help_status {
102 BT_COMPONENT_CLASS_SET_HELP_STATUS_OK = __BT_FUNC_STATUS_OK,
103 BT_COMPONENT_CLASS_SET_HELP_STATUS_MEMORY_ERROR = __BT_FUNC_STATUS_MEMORY_ERROR,
104 } bt_component_class_set_help_status;
105
106 extern bt_component_class_set_help_status bt_component_class_set_help(
107 bt_component_class *component_class,
108 const char *help);
109
110 #ifdef __cplusplus
111 }
112 #endif
113
114 #include <babeltrace2/undef-func-status.h>
115
116 #endif /* BABELTRACE_GRAPH_COMPONENT_CLASS_H */
This page took 0.032043 seconds and 4 git commands to generate.