*
* 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
*/
#include "python-complements.h"
#include <babeltrace/ctf-ir/event-types-internal.h>
#include <babeltrace/ctf-ir/event-fields-internal.h>
#include <babeltrace/ctf-ir/event-types.h>
+#include <babeltrace/ctf-ir/event.h>
+#include <babeltrace/ctf-ir/clock-internal.h>
/* List-related functions
----------------------------------------------------
index);
return !ret ? type : NULL;
}
+
+const char *_bt_python_ctf_event_class_get_field_name(
+ struct bt_ctf_event_class *event_class, size_t index)
+{
+ int ret;
+ const char *name;
+ struct bt_ctf_field_type *type;
+
+ ret = bt_ctf_event_class_get_field(event_class, &name, &type,
+ index);
+ if (ret) {
+ name = NULL;
+ goto end;
+ }
+
+ bt_ctf_field_type_put(type);
+end:
+ return name;
+}
+
+struct bt_ctf_field_type *_bt_python_ctf_event_class_get_field_type(
+ struct bt_ctf_event_class *event_class, size_t index)
+{
+ int ret;
+ const char *name;
+ struct bt_ctf_field_type *type;
+
+ ret = bt_ctf_event_class_get_field(event_class, &name, &type,
+ index);
+ return !ret ? type : NULL;
+}
+
+int _bt_python_ctf_clock_get_uuid_index(struct bt_ctf_clock *clock,
+ size_t index, unsigned char *value)
+{
+ int ret = 0;
+ const unsigned char *uuid;
+
+ if (index >= 16) {
+ ret = -1;
+ goto end;
+ }
+
+ uuid = bt_ctf_clock_get_uuid(clock);
+ if (!uuid) {
+ ret = -1;
+ goto end;
+ }
+
+ *value = uuid[index];
+end:
+ return ret;
+}
+
+int _bt_python_ctf_clock_set_uuid_index(struct bt_ctf_clock *clock,
+ size_t index, unsigned char value)
+{
+ int ret = 0;
+
+ if (index >= 16) {
+ ret = -1;
+ goto end;
+ }
+
+ clock->uuid[index] = value;
+end:
+ return ret;
+}