diff options
author | Luke Shumaker <luke@HP-dv6426us-u904> | 2009-10-24 02:23:22 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2015-06-26 00:30:16 -0600 |
commit | bddd6fb07906e660260ef0fced05440ecac8d9e9 (patch) | |
tree | 882c913e0cb2e89537747b90f8c47a65d5cd15d0 /wrapper/plugin-find.h | |
parent | 1eddff249b2c7ce54544b840562e782501d47924 (diff) |
switching to git
Diffstat (limited to 'wrapper/plugin-find.h')
-rw-r--r-- | wrapper/plugin-find.h | 70 |
1 files changed, 10 insertions, 60 deletions
diff --git a/wrapper/plugin-find.h b/wrapper/plugin-find.h index 1a5096b..0185117 100644 --- a/wrapper/plugin-find.h +++ b/wrapper/plugin-find.h @@ -37,78 +37,28 @@ struct plugin_command_list /*-----------------------------function-----------------------------*/ /* returns first plugin with `name' (duplicates are... unwise) */ +extern struct plugin * -plugin_find_plugin(struct plugin *node, char *name) -{ - - if (node==NULL) - return node; - else { - if (strcmp(node->name,name) == 0) - return node; - else - return plugin_find_plugin(node->next,name); - } -} +plugin_find_plugin(struct plugin *node, char *name); /* returns plugin `name within plugin `node' */ +extern struct plugin_command * -plugin_find_plugin_command(struct plugin_command *node, char *name) -{ - if (node==NULL) - return node; - else { - if (strcmp(node->name,name) == 0) - return node; - else - return plugin_find_plugin_command(node->next,name); - } -} +plugin_find_plugin_command(struct plugin_command *node, char *name); /* returns the first command with `name' it finds */ +extern struct plugin_command * -plugin_find_command(struct plugin *plugin, char *name) -{ - if (plugin==NULL) - return NULL; - else { - struct plugin_command *ret; - ret=plugin_find_plugin_command(plugin->commands,name); - if (ret == NULL) - ret=plugin_find_command(plugin->next,name); - return ret; - } -} +plugin_find_command(struct plugin *plugin, char *name); /* returns a linked list of all commands with `name' it finds */ +extern struct plugin_command_list * -plugin_find_commands(struct plugin *plugin, char *name) -{ - if (plugin==NULL) - return NULL; - else { - struct plugin_command *command; - command=plugin_find_command(plugin,name); - struct plugin_command_list *node; - if (command==NULL) - node=plugin_find_commands(plugin->next,name); - else { - node=xmalloc( sizeof *node ); - node->command=command; - node->next=plugin_find_commands(plugin->next,name); - } - return node; - } -} +plugin_find_commands(struct plugin *plugin, char *name); +extern void -plugin_free_list(struct plugin_command_list *node) -{ - if (node!=NULL) { - plugin_free_list(node->next); - xfree(node); - } -} +plugin_free_list(struct plugin_command_list *node); #endif |