Commit | Line | Data |
---|---|---|
6fa6bfa1 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 | ||
93 | extern uint64_t bt_component_source_get_output_port_count( | |
94 | const bt_component_source *component); | |
95 | ||
96 | extern const bt_port_output * | |
97 | bt_component_source_borrow_output_port_by_name_const( | |
98 | const bt_component_source *component, const char *name); | |
99 | ||
100 | extern const bt_port_output * | |
101 | bt_component_source_borrow_output_port_by_index_const( | |
102 | const bt_component_source *component, uint64_t index); | |
103 | ||
104 | extern void bt_component_source_get_ref( | |
105 | const bt_component_source *component_source); | |
106 | ||
107 | extern void bt_component_source_put_ref( | |
108 | const bt_component_source *component_source); | |
109 | ||
110 | /* From component-filter-const.h */ | |
111 | ||
112 | const bt_component *bt_component_filter_as_component_const( | |
113 | const bt_component_filter *component); | |
114 | ||
115 | extern uint64_t bt_component_filter_get_input_port_count( | |
116 | const bt_component_filter *component); | |
117 | ||
118 | extern const bt_port_input * | |
119 | bt_component_filter_borrow_input_port_by_name_const( | |
120 | const bt_component_filter *component, const char *name); | |
121 | ||
122 | extern const bt_port_input * | |
123 | bt_component_filter_borrow_input_port_by_index_const( | |
124 | const bt_component_filter *component, uint64_t index); | |
125 | ||
126 | extern uint64_t bt_component_filter_get_output_port_count( | |
127 | const bt_component_filter *component); | |
128 | ||
129 | extern const bt_port_output * | |
130 | bt_component_filter_borrow_output_port_by_name_const( | |
131 | const bt_component_filter *component, const char *name); | |
132 | ||
133 | extern const bt_port_output * | |
134 | bt_component_filter_borrow_output_port_by_index_const( | |
135 | const bt_component_filter *component, uint64_t index); | |
136 | ||
137 | extern void bt_component_filter_get_ref( | |
138 | const bt_component_filter *component_filter); | |
139 | ||
140 | extern void bt_component_filter_put_ref( | |
141 | const bt_component_filter *component_filter); | |
142 | ||
143 | /* From component-sink-const.h */ | |
144 | ||
145 | const bt_component *bt_component_sink_as_component_const( | |
146 | const bt_component_sink *component); | |
147 | ||
148 | extern uint64_t bt_component_sink_get_input_port_count( | |
149 | const bt_component_sink *component); | |
150 | ||
151 | extern const bt_port_input * | |
152 | bt_component_sink_borrow_input_port_by_name_const( | |
153 | const bt_component_sink *component, const char *name); | |
154 | ||
155 | extern const bt_port_input * | |
156 | bt_component_sink_borrow_input_port_by_index_const( | |
157 | const bt_component_sink *component, uint64_t index); | |
158 | ||
159 | extern void bt_component_sink_get_ref( | |
160 | const bt_component_sink *component_sink); | |
161 | ||
162 | extern void bt_component_sink_put_ref( | |
163 | const bt_component_sink *component_sink); | |
164 | ||
165 | /* From self-component.h */ | |
166 | ||
167 | typedef enum bt_self_component_status { | |
168 | BT_SELF_COMPONENT_STATUS_OK = 0, | |
169 | BT_SELF_COMPONENT_STATUS_END = 1, | |
170 | BT_SELF_COMPONENT_STATUS_AGAIN = 11, | |
171 | BT_SELF_COMPONENT_STATUS_REFUSE_PORT_CONNECTION = 111, | |
172 | BT_SELF_COMPONENT_STATUS_ERROR = -1, | |
173 | BT_SELF_COMPONENT_STATUS_NOMEM = -12, | |
174 | } bt_self_component_status; | |
175 | ||
176 | const bt_component *bt_self_component_as_component( | |
177 | bt_self_component *self_component); | |
178 | ||
179 | extern void *bt_self_component_get_data( | |
180 | const bt_self_component *self_component); | |
181 | ||
182 | extern void bt_self_component_set_data( | |
183 | bt_self_component *self_component, void *data); | |
184 | ||
185 | /* From self-component-source.h */ | |
186 | ||
187 | bt_self_component *bt_self_component_source_as_self_component( | |
188 | bt_self_component_source *self_comp_source); | |
189 | ||
190 | const bt_component_source * | |
191 | bt_self_component_source_as_component_source( | |
192 | bt_self_component_source *self_comp_source); | |
193 | ||
194 | extern bt_self_component_port_output * | |
195 | bt_self_component_source_borrow_output_port_by_name( | |
196 | bt_self_component_source *self_component, | |
197 | const char *name); | |
198 | ||
199 | extern bt_self_component_port_output * | |
200 | bt_self_component_source_borrow_output_port_by_index( | |
201 | bt_self_component_source *self_component, | |
202 | uint64_t index); | |
203 | ||
204 | extern bt_self_component_status | |
205 | bt_self_component_source_add_output_port( | |
206 | bt_self_component_source *self_component, | |
207 | const char *name, void *user_data, | |
208 | bt_self_component_port_output **OUT); | |
209 | ||
210 | /* From self-component-filter.h */ | |
211 | ||
212 | bt_self_component *bt_self_component_filter_as_self_component( | |
213 | bt_self_component_filter *self_comp_filter); | |
214 | ||
215 | const bt_component_filter * | |
216 | bt_self_component_filter_as_component_filter( | |
217 | bt_self_component_filter *self_comp_filter); | |
218 | ||
219 | extern bt_self_component_port_output * | |
220 | bt_self_component_filter_borrow_output_port_by_name( | |
221 | bt_self_component_filter *self_component, | |
222 | const char *name); | |
223 | ||
224 | extern bt_self_component_port_output * | |
225 | bt_self_component_filter_borrow_output_port_by_index( | |
226 | bt_self_component_filter *self_component, | |
227 | uint64_t index); | |
228 | ||
229 | extern bt_self_component_status | |
230 | bt_self_component_filter_add_output_port( | |
231 | bt_self_component_filter *self_component, | |
232 | const char *name, void *data, | |
233 | bt_self_component_port_output **OUT); | |
234 | ||
235 | extern bt_self_component_port_input * | |
236 | bt_self_component_filter_borrow_input_port_by_name( | |
237 | bt_self_component_filter *self_component, | |
238 | const char *name); | |
239 | ||
240 | extern bt_self_component_port_input * | |
241 | bt_self_component_filter_borrow_input_port_by_index( | |
242 | bt_self_component_filter *self_component, | |
243 | uint64_t index); | |
244 | ||
245 | extern bt_self_component_status | |
246 | bt_self_component_filter_add_input_port( | |
247 | bt_self_component_filter *self_component, | |
248 | const char *name, void *data, | |
249 | bt_self_component_port_input **OUT); | |
250 | ||
251 | /* From self-component-sink.h */ | |
252 | ||
253 | bt_self_component *bt_self_component_sink_as_self_component( | |
254 | bt_self_component_sink *self_comp_sink); | |
255 | ||
256 | const bt_component_sink * | |
257 | bt_self_component_sink_as_component_sink( | |
258 | bt_self_component_sink *self_comp_sink); | |
259 | ||
260 | extern bt_self_component_port_input * | |
261 | bt_self_component_sink_borrow_input_port_by_name( | |
262 | bt_self_component_sink *self_component, | |
263 | const char *name); | |
264 | ||
265 | extern bt_self_component_port_input * | |
266 | bt_self_component_sink_borrow_input_port_by_index( | |
267 | bt_self_component_sink *self_component, uint64_t index); | |
268 | ||
269 | extern bt_self_component_status | |
270 | bt_self_component_sink_add_input_port( | |
271 | bt_self_component_sink *self_component, | |
272 | const char *name, void *user_data, | |
273 | bt_self_component_port_input **OUT); |