X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=blobdiff_plain;f=bindings%2Fpython%2Fpython-complements.c;h=53b616b4ca42740010118f63101281f0e4b7517e;hp=aa65555eaa8f4f1c440b2534b31cc377544bff50;hb=3c2ce778cc0d5e5be91e2fd1d176365a2ad65aa3;hpb=4191bcd2fbb6a1be731af94bb83a828a1471ef67 diff --git a/bindings/python/python-complements.c b/bindings/python/python-complements.c index aa65555e..53b616b4 100644 --- a/bindings/python/python-complements.c +++ b/bindings/python/python-complements.c @@ -119,3 +119,21 @@ struct bt_ctf_field_decl *_bt_python_field_decl_one_from_list( { return list[index]; } + +struct definition_array *_bt_python_get_array_from_def( + struct bt_definition *field) +{ + const struct bt_declaration *array_decl; + struct definition_array *array = NULL; + + if (!field) { + goto end; + } + + array_decl = bt_ctf_get_decl_from_def(field); + if (bt_ctf_field_type(array_decl) == CTF_TYPE_ARRAY) { + array = container_of(field, struct definition_array, p); + } +end: + return array; +}