bugfix, load the whole array
Signed-off-by: Mislav Novakovic <mislav.novakovic@sartura.hr>
diff --git a/src/plugin_config.h.in b/src/plugin_config.h.in
index afc6b5b..ebe5bb1 100644
--- a/src/plugin_config.h.in
+++ b/src/plugin_config.h.in
@@ -30,6 +30,63 @@
@EXTERN_EXTENSIONS_LIST@
@EXTERN_USER_TYPE_LIST@
+int lytype_size(struct lytype_plugin_list plugin[]) {
+ struct lytype_plugin_list *tmp;
+ int i = 0;
+ while (1) {
+ tmp = &plugin[i];
+ if (!tmp) break;
+ if (!tmp->module && !tmp->revision && !tmp->name && !tmp->store_clb && !tmp->free_clb) break;
+ i++;
+ }
+
+ return i;
+}
+
+void lytype_add(struct lytype_plugin_list *type_plugins, uint16_t *type_plugins_count, struct lytype_plugin_list plugin[]) {
+ struct lytype_plugin_list *tmp;
+ int i = 0;
+ while (1) {
+ tmp = &plugin[i];
+ if (!tmp) break;
+ if (!tmp->module && !tmp->revision && !tmp->name && !tmp->store_clb && !tmp->free_clb) break;
+ i++;
+ memcpy(&type_plugins[*type_plugins_count], tmp, sizeof *tmp);
+ (*type_plugins_count)++;
+ }
+
+ return;
+}
+
+
+int lyext_size(struct lyext_plugin_list plugin[]) {
+ struct lyext_plugin_list *tmp;
+ int i = 0;
+ while (1) {
+ tmp = &plugin[i];
+ if (!tmp) break;
+ if (!tmp->module && !tmp->revision && !tmp->name && !tmp->plugin) break;
+ i++;
+ }
+
+ return i;
+}
+
+void lyext_add(struct lyext_plugin_list *ext_plugins, uint16_t *ext_plugins_count, struct lyext_plugin_list plugin[]) {
+ struct lyext_plugin_list *tmp;
+ int i = 0;
+ while (1) {
+ tmp = &plugin[i];
+ if (!tmp) break;
+ if (!tmp->module && !tmp->revision && !tmp->name && !tmp->plugin) break;
+ i++;
+ memcpy(&ext_plugins[*ext_plugins_count], tmp, sizeof *tmp);
+ (*ext_plugins_count)++;
+ }
+
+ return;
+}
+
struct lyext_plugin_list *static_load_lyext_plugins(uint16_t *count)
{
struct lyext_plugin_list *plugin;
@@ -41,7 +98,7 @@
return NULL;
}
- *count = size;
+ *count = 0;
@MEMCPY_EXTENSIONS_LIST@
return plugin;
}
@@ -57,7 +114,7 @@
return NULL;
}
- *count = size;
+ *count = 0;
@MEMCPY_USER_TYPE_LIST@
return plugin;
}