X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=src%2Fbindings%2Fpython%2Fbt2%2Fbt2%2Fnative_bt.i;h=21a869e606376d4bc9101f92a31d44aae8fc47de;hb=900eef7317d3e8b350a93fb8782639845c62c2bd;hp=de9ff3c32bb5269ce36382ea5918e217fcfec395;hpb=f3c9a159782f70dbd0e5dedb37e4a1ef8a6d304e;p=babeltrace.git diff --git a/src/bindings/python/bt2/bt2/native_bt.i b/src/bindings/python/bt2/bt2/native_bt.i index de9ff3c3..21a869e6 100644 --- a/src/bindings/python/bt2/bt2/native_bt.i +++ b/src/bindings/python/bt2/bt2/native_bt.i @@ -1,25 +1,7 @@ /* - * The MIT License (MIT) + * SPDX-License-Identifier: MIT * * Copyright (c) 2016 Philippe Proulx - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. */ #ifndef SWIGPYTHON @@ -139,6 +121,16 @@ typedef uint64_t bt_listener_id; SWIG_From_unsigned_SS_long_SS_long((uint64_t) (*$1))); } +/* Output argument typemap for initialized bt_boot output parameter (always appends) */ +%typemap(in, numinputs=0) (bt_bool *) (bt_bool temp) { + $1 = &temp; +} + +%typemap(argout) bt_bool * { + $result = SWIG_Python_AppendOutput(resultobj, + SWIG_From_bool(*$1)); +} + /* Input argument typemap for UUID bytes */ %typemap(in) bt_uuid { $1 = (unsigned char *) PyBytes_AsString($input); @@ -190,6 +182,15 @@ typedef uint64_t bt_listener_id; void bt_bt2_init_from_bt2(void); void bt_bt2_exit_handler(void); +/* + * These functions cause some -Wformat-nonliteral warnings, but we don't need + * them. Ignore them, so that we can keep the warning turned on. + */ +%ignore bt_current_thread_error_append_cause_from_component; +%ignore bt_current_thread_error_append_cause_from_component_class; +%ignore bt_current_thread_error_append_cause_from_message_iterator; +%ignore bt_current_thread_error_append_cause_from_unknown; + /* * Define `__BT_IN_BABELTRACE_H` to allow specific headers to be * included. This remains defined as long as we don't include the main @@ -197,8 +198,14 @@ void bt_bt2_exit_handler(void); */ #define __BT_IN_BABELTRACE_H -/* Property enumeration */ -%include +/* + * Define `__BT_ATTR_FORMAT_PRINTF` to nothing, otherwise SWIG fails to parse + * the included header files that use it. + */ +#define __BT_ATTR_FORMAT_PRINTF(_string_index, _first_to_check) + +/* Common types */ +%include /* Common function status codes */ %include @@ -222,6 +229,7 @@ void bt_bt2_exit_handler(void); %include "native_bt_logging.i" %include "native_bt_message.i" %include "native_bt_message_iterator.i" +%include "native_bt_mip.i" %include "native_bt_packet.i" %include "native_bt_plugin.i" %include "native_bt_port.i" @@ -232,3 +240,13 @@ void bt_bt2_exit_handler(void); %include "native_bt_trace_class.i" %include "native_bt_value.i" %include "native_bt_version.i" + +%{ + +/* + * This function is defined by SWIG. Declare here to avoid a + * -Wmissing-prototypes warning. + */ +PyObject *SWIG_init(void); + +%}