Public feed #891175

alok

public c v1 · immutable
Raw Edit
·published 2008-02-04 12:57 UTC
rendered paste body
/*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<stdio.h>                                                                                                                              #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                                                                                                                        };