예제 #1
0
파일: loader.c 프로젝트: clarete/bitu
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;
}
예제 #2
0
파일: value.c 프로젝트: fizx/node-avro
json_t *json_object_iter_value(void *iter)
{
    if(!iter)
        return NULL;

    return (json_t *)hashtable_iter_value(iter);
}
예제 #3
0
파일: map.c 프로젝트: h31h31/libpomelo
void *pc_map_iter_value(void *iter) {
  return hashtable_iter_value(iter);
}