bitu_plugin_t * bitu_plugin_ctx_find_for_cmdline (bitu_plugin_ctx_t *plugin_ctx, const char *cmdline) { void *iter; bitu_plugin_t *plugin = NULL; /* Iterating over all loaded plugins and looking for one that matches * the received command line. The first one that matches will be * returned. */ if ((iter = hashtable_iter (plugin_ctx->plugins)) == NULL) return NULL; do { plugin = hashtable_iter_value (iter); if (plugin && plugin->match && plugin->match (cmdline)) return plugin; } while ((iter = hashtable_iter_next (plugin_ctx->plugins, iter))); /* It was not possible to match the command line in any plugin. We'll * have to parse the command line, get the plugin name and try to * execute it. */ if (bitu_util_extract_params (cmdline, NULL, NULL, NULL) == TA_OK) if ((plugin = bitu_plugin_ctx_find (plugin_ctx, cmdline)) != NULL) return plugin; return NULL; }
json_t *json_object_iter_value(void *iter) { if(!iter) return NULL; return (json_t *)hashtable_iter_value(iter); }
void *pc_map_iter_value(void *iter) { return hashtable_iter_value(iter); }