-static
-struct bt_plugin **bt_plugin_create_all_from_sections(
- struct bt_plugin_shared_lib_handle *shared_lib_handle,
- struct __bt_plugin_descriptor const * const *descriptors_begin,
- struct __bt_plugin_descriptor const * const *descriptors_end,
- struct __bt_plugin_descriptor_attribute const * const *attrs_begin,
- struct __bt_plugin_descriptor_attribute const * const *attrs_end,
- struct __bt_plugin_component_class_descriptor const * const *cc_descriptors_begin,
- struct __bt_plugin_component_class_descriptor const * const *cc_descriptors_end,
- struct __bt_plugin_component_class_descriptor_attribute const * const *cc_descr_attrs_begin,
- struct __bt_plugin_component_class_descriptor_attribute const * const *cc_descr_attrs_end)
-{
- size_t descriptor_count;
- size_t attrs_count;
- size_t cc_descriptors_count;
- size_t cc_descr_attrs_count;
- size_t i;
- struct bt_plugin **plugins = NULL;
-
- descriptor_count = descriptors_end - descriptors_begin;
- attrs_count = attrs_end - attrs_begin;
- cc_descriptors_count = cc_descriptors_end - cc_descriptors_begin;
- cc_descr_attrs_count = cc_descr_attrs_end - cc_descr_attrs_begin;
- printf_verbose("Section: Plugin descriptors: [%p - %p], (%zu elements)\n",
- descriptors_begin, descriptors_end, descriptor_count);
- printf_verbose("Section: Plugin descriptor attributes: [%p - %p], (%zu elements)\n",
- attrs_begin, attrs_end, attrs_count);
- printf_verbose("Section: Plugin component class descriptors: [%p - %p], (%zu elements)\n",
- cc_descriptors_begin, cc_descriptors_end, cc_descriptors_count);
- printf_verbose("Section: Plugin component class descriptor attributes: [%p - %p], (%zu elements)\n",
- cc_descr_attrs_begin, cc_descr_attrs_end, cc_descr_attrs_count);
- plugins = calloc(descriptor_count + 1, sizeof(*plugins));
- if (!plugins) {
- goto error;