| 1 | /* |
| 2 | * python-complements.h |
| 3 | * |
| 4 | * Babeltrace Python module complements header, required for Python bindings |
| 5 | * |
| 6 | * Copyright 2012 EfficiOS Inc. |
| 7 | * |
| 8 | * Author: Danny Serres <danny.serres@efficios.com> |
| 9 | * |
| 10 | * Permission is hereby granted, free of charge, to any person obtaining a copy |
| 11 | * of this software and associated documentation files (the "Software"), to deal |
| 12 | * in the Software without restriction, including without limitation the rights |
| 13 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 14 | * copies of the Software, and to permit persons to whom the Software is |
| 15 | * furnished to do so, subject to the following conditions: |
| 16 | * |
| 17 | * The above copyright notice and this permission notice shall be included in |
| 18 | * all copies or substantial portions of the Software. |
| 19 | * |
| 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 21 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 22 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 23 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 24 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 25 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 26 | */ |
| 27 | |
| 28 | #include <stdio.h> |
| 29 | #include <glib.h> |
| 30 | #include <babeltrace/babeltrace.h> |
| 31 | #include <babeltrace/format.h> |
| 32 | #include <babeltrace/ctf-ir/metadata.h> |
| 33 | #include <babeltrace/ctf/events.h> |
| 34 | #include <babeltrace/iterator-internal.h> |
| 35 | #include <babeltrace/ctf/events-internal.h> |
| 36 | #include <babeltrace/ctf-writer/event-fields.h> |
| 37 | #include <babeltrace/ctf-writer/clock.h> |
| 38 | |
| 39 | /* ctf-field-list */ |
| 40 | struct bt_definition **_bt_python_field_listcaller( |
| 41 | const struct bt_ctf_event *ctf_event, |
| 42 | const struct bt_definition *scope, |
| 43 | unsigned int *len); |
| 44 | struct bt_definition *_bt_python_field_one_from_list( |
| 45 | struct bt_definition **list, int index); |
| 46 | |
| 47 | /* event_decl_list */ |
| 48 | struct bt_ctf_event_decl **_bt_python_event_decl_listcaller( |
| 49 | int handle_id, |
| 50 | struct bt_context *ctx, |
| 51 | unsigned int *len); |
| 52 | struct bt_ctf_event_decl *_bt_python_decl_one_from_list( |
| 53 | struct bt_ctf_event_decl **list, int index); |
| 54 | |
| 55 | /* decl_fields */ |
| 56 | struct bt_ctf_field_decl **_by_python_field_decl_listcaller( |
| 57 | struct bt_ctf_event_decl *event_decl, |
| 58 | enum bt_ctf_scope scope, |
| 59 | unsigned int *len); |
| 60 | struct bt_ctf_field_decl *_bt_python_field_decl_one_from_list( |
| 61 | struct bt_ctf_field_decl **list, int index); |
| 62 | |
| 63 | /* definitions */ |
| 64 | struct definition_array *_bt_python_get_array_from_def( |
| 65 | struct bt_definition *field); |
| 66 | struct definition_sequence *_bt_python_get_sequence_from_def( |
| 67 | struct bt_definition *field); |
| 68 | struct bt_declaration *_bt_python_get_array_element_declaration( |
| 69 | struct bt_declaration *field); |
| 70 | struct bt_declaration *_bt_python_get_sequence_element_declaration( |
| 71 | struct bt_declaration *field); |
| 72 | const char *_bt_python_get_array_string(struct bt_definition *field); |
| 73 | const char *_bt_python_get_sequence_string(struct bt_definition *field); |
| 74 | |
| 75 | /* ctf ir */ |
| 76 | int _bt_python_field_integer_get_signedness(const struct bt_ctf_field *field); |
| 77 | enum ctf_type_id _bt_python_get_field_type(const struct bt_ctf_field *field); |
| 78 | const char *_bt_python_ctf_field_type_enumeration_get_mapping( |
| 79 | struct bt_ctf_field_type *enumeration, size_t index, |
| 80 | int64_t *range_start, int64_t *range_end); |
| 81 | const char *_bt_python_ctf_field_type_enumeration_get_mapping_unsigned( |
| 82 | struct bt_ctf_field_type *enumeration, size_t index, |
| 83 | uint64_t *range_start, uint64_t *range_end); |
| 84 | const char *_bt_python_ctf_field_type_structure_get_field_name( |
| 85 | struct bt_ctf_field_type *structure, size_t index); |
| 86 | struct bt_ctf_field_type *_bt_python_ctf_field_type_structure_get_field_type( |
| 87 | struct bt_ctf_field_type *structure, size_t index); |
| 88 | const char *_bt_python_ctf_field_type_variant_get_field_name( |
| 89 | struct bt_ctf_field_type *variant, size_t index); |
| 90 | struct bt_ctf_field_type *_bt_python_ctf_field_type_variant_get_field_type( |
| 91 | struct bt_ctf_field_type *variant, size_t index); |
| 92 | const char *_bt_python_ctf_event_class_get_field_name( |
| 93 | struct bt_ctf_event_class *event_class, size_t index); |
| 94 | struct bt_ctf_field_type *_bt_python_ctf_event_class_get_field_type( |
| 95 | struct bt_ctf_event_class *event_class, size_t index); |
| 96 | int _bt_python_ctf_clock_get_uuid_index(struct bt_ctf_clock *clock, |
| 97 | size_t index, unsigned char *value); |
| 98 | int _bt_python_ctf_clock_set_uuid_index(struct bt_ctf_clock *clock, |
| 99 | size_t index, unsigned char value); |
| 100 | |
| 101 | /* iterator */ |
| 102 | struct bt_iter_pos *_bt_python_create_iter_pos(void); |