/*default.h*/ typedef int (* PluginMethodInitFunc)(); typedef int (* PluginMethodCloseFunc)(); typedef int (* PluginMethodCmdFunc)(char *str); typedef struct PluginMethod { PluginMethodInitFunc init; PluginMethodCloseFunc close; PluginMethodCmdFunc send_cmd; }PluginMethod; /*default.c*/ #include #include "default.h" int dummy_plugin_close() { printf("Plugin Exit"); return 1; } int dummy_plugin_send_cmd(char *cmd) { printf("sending:%s",cmd); return 1; } int dummy_plugin_init() { printf("\nPlugin Init\n"); return 1; } static PluginMethod method = { dummy_plugin_init, dummy_plugin_close, dummy_plugin_send_cmd };