Commit | Line | Data |
---|---|---|
6945df9a SM |
1 | /* |
2 | * The MIT License (MIT) | |
3 | * | |
4 | * Copyright (c) 2017 Philippe Proulx <pproulx@efficios.com> | |
5 | * | |
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy | |
7 | * of this software and associated documentation files (the "Software"), to deal | |
8 | * in the Software without restriction, including without limitation the rights | |
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
10 | * copies of the Software, and to permit persons to whom the Software is | |
11 | * furnished to do so, subject to the following conditions: | |
12 | * | |
13 | * The above copyright notice and this permission notice shall be included in | |
14 | * all copies or substantial portions of the Software. | |
15 | * | |
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | |
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | |
22 | * THE SOFTWARE. | |
23 | */ | |
24 | ||
25 | /* Output argument typemap for self port output (always appends) */ | |
26 | %typemap(in, numinputs=0) | |
27 | (bt_self_component_port_input **OUT) | |
28 | (bt_self_component_port_input *temp_self_port = NULL) { | |
29 | $1 = &temp_self_port; | |
30 | } | |
31 | ||
32 | %typemap(argout) bt_self_component_port_input **OUT { | |
33 | if (*$1) { | |
34 | /* SWIG_Python_AppendOutput() steals the created object */ | |
35 | $result = SWIG_Python_AppendOutput($result, | |
36 | SWIG_NewPointerObj(SWIG_as_voidptr(*$1), | |
37 | SWIGTYPE_p_bt_self_component_port_input, 0)); | |
38 | } else { | |
39 | /* SWIG_Python_AppendOutput() steals Py_None */ | |
40 | Py_INCREF(Py_None); | |
41 | $result = SWIG_Python_AppendOutput($result, Py_None); | |
42 | } | |
43 | } | |
44 | ||
45 | /* Output argument typemap for self port output (always appends) */ | |
46 | %typemap(in, numinputs=0) | |
47 | (bt_self_component_port_output **OUT) | |
48 | (bt_self_component_port_output *temp_self_port = NULL) { | |
49 | $1 = &temp_self_port; | |
50 | } | |
51 | ||
52 | %typemap(argout) (bt_self_component_port_output **OUT) { | |
53 | if (*$1) { | |
54 | /* SWIG_Python_AppendOutput() steals the created object */ | |
55 | $result = SWIG_Python_AppendOutput($result, | |
56 | SWIG_NewPointerObj(SWIG_as_voidptr(*$1), | |
57 | SWIGTYPE_p_bt_self_component_port_output, 0)); | |
58 | } else { | |
59 | /* SWIG_Python_AppendOutput() steals Py_None */ | |
60 | Py_INCREF(Py_None); | |
61 | $result = SWIG_Python_AppendOutput($result, Py_None); | |
62 | } | |
63 | } | |
64 | ||
65 | /* From component-const.h */ | |
66 | ||
67 | extern const char *bt_component_get_name(const bt_component *component); | |
68 | ||
69 | extern const bt_component_class *bt_component_borrow_class_const( | |
70 | const bt_component *component); | |
71 | ||
72 | extern bt_component_class_type bt_component_get_class_type( | |
73 | const bt_component *component); | |
74 | ||
75 | bt_bool bt_component_is_source(const bt_component *component); | |
76 | ||
77 | bt_bool bt_component_is_filter(const bt_component *component); | |
78 | ||
79 | bt_bool bt_component_is_sink(const bt_component *component); | |
80 | ||
81 | extern bt_bool bt_component_graph_is_canceled( | |
82 | const bt_component *component); | |
83 | ||
84 | extern void bt_component_get_ref(const bt_component *component); | |
85 | ||
86 | extern void bt_component_put_ref(const bt_component *component); | |
87 | ||
88 | /* From component-source-const.h */ | |
89 | ||
90 | const bt_component *bt_component_source_as_component_const( | |
91 | const bt_component_source *component); | |
92 | ||
752d0e47 SM |
93 | extern const bt_component_class_source * |
94 | bt_component_source_borrow_class_const( | |
95 | const bt_component_source *component); | |
96 | ||
6945df9a SM |
97 | extern uint64_t bt_component_source_get_output_port_count( |
98 | const bt_component_source *component); | |
99 | ||
100 | extern const bt_port_output * | |
101 | bt_component_source_borrow_output_port_by_name_const( | |
102 | const bt_component_source *component, const char *name); | |
103 | ||
104 | extern const bt_port_output * | |
105 | bt_component_source_borrow_output_port_by_index_const( | |
106 | const bt_component_source *component, uint64_t index); | |
107 | ||
108 | extern void bt_component_source_get_ref( | |
109 | const bt_component_source *component_source); | |
110 | ||
111 | extern void bt_component_source_put_ref( | |
112 | const bt_component_source *component_source); | |
113 | ||
114 | /* From component-filter-const.h */ | |
115 | ||
116 | const bt_component *bt_component_filter_as_component_const( | |
117 | const bt_component_filter *component); | |
118 | ||
752d0e47 SM |
119 | extern const bt_component_class_filter * |
120 | bt_component_filter_borrow_class_const( | |
121 | const bt_component_filter *component); | |
122 | ||
6945df9a SM |
123 | extern uint64_t bt_component_filter_get_input_port_count( |
124 | const bt_component_filter *component); | |
125 | ||
126 | extern const bt_port_input * | |
127 | bt_component_filter_borrow_input_port_by_name_const( | |
128 | const bt_component_filter *component, const char *name); | |
129 | ||
130 | extern const bt_port_input * | |
131 | bt_component_filter_borrow_input_port_by_index_const( | |
132 | const bt_component_filter *component, uint64_t index); | |
133 | ||
134 | extern uint64_t bt_component_filter_get_output_port_count( | |
135 | const bt_component_filter *component); | |
136 | ||
137 | extern const bt_port_output * | |
138 | bt_component_filter_borrow_output_port_by_name_const( | |
139 | const bt_component_filter *component, const char *name); | |
140 | ||
141 | extern const bt_port_output * | |
142 | bt_component_filter_borrow_output_port_by_index_const( | |
143 | const bt_component_filter *component, uint64_t index); | |
144 | ||
145 | extern void bt_component_filter_get_ref( | |
146 | const bt_component_filter *component_filter); | |
147 | ||
148 | extern void bt_component_filter_put_ref( | |
149 | const bt_component_filter *component_filter); | |
150 | ||
151 | /* From component-sink-const.h */ | |
152 | ||
153 | const bt_component *bt_component_sink_as_component_const( | |
154 | const bt_component_sink *component); | |
155 | ||
752d0e47 SM |
156 | extern const bt_component_class_sink * |
157 | bt_component_sink_borrow_class_const( | |
158 | const bt_component_sink *component); | |
159 | ||
6945df9a SM |
160 | extern uint64_t bt_component_sink_get_input_port_count( |
161 | const bt_component_sink *component); | |
162 | ||
163 | extern const bt_port_input * | |
164 | bt_component_sink_borrow_input_port_by_name_const( | |
165 | const bt_component_sink *component, const char *name); | |
166 | ||
167 | extern const bt_port_input * | |
168 | bt_component_sink_borrow_input_port_by_index_const( | |
169 | const bt_component_sink *component, uint64_t index); | |
170 | ||
171 | extern void bt_component_sink_get_ref( | |
172 | const bt_component_sink *component_sink); | |
173 | ||
174 | extern void bt_component_sink_put_ref( | |
175 | const bt_component_sink *component_sink); | |
176 | ||
177 | /* From self-component.h */ | |
178 | ||
179 | typedef enum bt_self_component_status { | |
180 | BT_SELF_COMPONENT_STATUS_OK = 0, | |
181 | BT_SELF_COMPONENT_STATUS_END = 1, | |
182 | BT_SELF_COMPONENT_STATUS_AGAIN = 11, | |
183 | BT_SELF_COMPONENT_STATUS_REFUSE_PORT_CONNECTION = 111, | |
184 | BT_SELF_COMPONENT_STATUS_ERROR = -1, | |
185 | BT_SELF_COMPONENT_STATUS_NOMEM = -12, | |
186 | } bt_self_component_status; | |
187 | ||
188 | const bt_component *bt_self_component_as_component( | |
189 | bt_self_component *self_component); | |
190 | ||
191 | extern void *bt_self_component_get_data( | |
192 | const bt_self_component *self_component); | |
193 | ||
194 | extern void bt_self_component_set_data( | |
195 | bt_self_component *self_component, void *data); | |
196 | ||
197 | /* From self-component-source.h */ | |
198 | ||
199 | bt_self_component *bt_self_component_source_as_self_component( | |
200 | bt_self_component_source *self_comp_source); | |
201 | ||
202 | const bt_component_source * | |
203 | bt_self_component_source_as_component_source( | |
204 | bt_self_component_source *self_comp_source); | |
205 | ||
206 | extern bt_self_component_port_output * | |
207 | bt_self_component_source_borrow_output_port_by_name( | |
208 | bt_self_component_source *self_component, | |
209 | const char *name); | |
210 | ||
211 | extern bt_self_component_port_output * | |
212 | bt_self_component_source_borrow_output_port_by_index( | |
213 | bt_self_component_source *self_component, | |
214 | uint64_t index); | |
215 | ||
216 | extern bt_self_component_status | |
217 | bt_self_component_source_add_output_port( | |
218 | bt_self_component_source *self_component, | |
219 | const char *name, void *user_data, | |
220 | bt_self_component_port_output **OUT); | |
221 | ||
222 | /* From self-component-filter.h */ | |
223 | ||
224 | bt_self_component *bt_self_component_filter_as_self_component( | |
225 | bt_self_component_filter *self_comp_filter); | |
226 | ||
227 | const bt_component_filter * | |
228 | bt_self_component_filter_as_component_filter( | |
229 | bt_self_component_filter *self_comp_filter); | |
230 | ||
231 | extern bt_self_component_port_output * | |
232 | bt_self_component_filter_borrow_output_port_by_name( | |
233 | bt_self_component_filter *self_component, | |
234 | const char *name); | |
235 | ||
236 | extern bt_self_component_port_output * | |
237 | bt_self_component_filter_borrow_output_port_by_index( | |
238 | bt_self_component_filter *self_component, | |
239 | uint64_t index); | |
240 | ||
241 | extern bt_self_component_status | |
242 | bt_self_component_filter_add_output_port( | |
243 | bt_self_component_filter *self_component, | |
244 | const char *name, void *data, | |
245 | bt_self_component_port_output **OUT); | |
246 | ||
247 | extern bt_self_component_port_input * | |
248 | bt_self_component_filter_borrow_input_port_by_name( | |
249 | bt_self_component_filter *self_component, | |
250 | const char *name); | |
251 | ||
252 | extern bt_self_component_port_input * | |
253 | bt_self_component_filter_borrow_input_port_by_index( | |
254 | bt_self_component_filter *self_component, | |
255 | uint64_t index); | |
256 | ||
257 | extern bt_self_component_status | |
258 | bt_self_component_filter_add_input_port( | |
259 | bt_self_component_filter *self_component, | |
260 | const char *name, void *data, | |
261 | bt_self_component_port_input **OUT); | |
262 | ||
263 | /* From self-component-sink.h */ | |
264 | ||
265 | bt_self_component *bt_self_component_sink_as_self_component( | |
266 | bt_self_component_sink *self_comp_sink); | |
267 | ||
268 | const bt_component_sink * | |
269 | bt_self_component_sink_as_component_sink( | |
270 | bt_self_component_sink *self_comp_sink); | |
271 | ||
272 | extern bt_self_component_port_input * | |
273 | bt_self_component_sink_borrow_input_port_by_name( | |
274 | bt_self_component_sink *self_component, | |
275 | const char *name); | |
276 | ||
277 | extern bt_self_component_port_input * | |
278 | bt_self_component_sink_borrow_input_port_by_index( | |
279 | bt_self_component_sink *self_component, uint64_t index); | |
280 | ||
281 | extern bt_self_component_status | |
282 | bt_self_component_sink_add_input_port( | |
283 | bt_self_component_sink *self_component, | |
284 | const char *name, void *user_data, | |
285 | bt_self_component_port_input **OUT); |