[Autosec-devel] sonar/src plugin.c,1.30,1.31 plugin.h,1.39,1.40 sonar.c,1.41,1.42
Brought to you by:
red0x
From: red0x <re...@us...> - 2004-04-08 19:24:19
|
Update of /cvsroot/autosec/sonar/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18810/src Modified Files: plugin.c plugin.h sonar.c Log Message: Removed old, manky plugin options parsing routines Index: plugin.h =================================================================== RCS file: /cvsroot/autosec/sonar/src/plugin.h,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** plugin.h 31 Mar 2004 20:49:08 -0000 1.39 --- plugin.h 8 Apr 2004 19:11:03 -0000 1.40 *************** *** 196,202 **** int (*plugin_destroy) (void); - /// Argument handler XXX: soon to be removed - int (*plugin_args) (char opt, char *optarg); - /// Open the input/output/network source int (*plugin_open) (void *c_data, int i_data); --- 196,199 ---- Index: plugin.c =================================================================== RCS file: /cvsroot/autosec/sonar/src/plugin.c,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** plugin.c 31 Mar 2004 08:53:47 -0000 1.30 --- plugin.c 8 Apr 2004 19:11:03 -0000 1.31 *************** *** 570,624 **** /** - * @fn plugin_command_handler(char opt, char *optarg) - * Call each plugin's plugin_args function to see if it handles this option - * @param opt Option char as passed from getopt - * @param optarg Option argument as passed from getopt - * @return SONAR_ERROR if no plugins handled the argument\n - * SONAR_OK if someone handled it - */ - int plugin_command_handler(char opt, char *optarg) - { - //go through the plugins, and see if this option is handled, first network - // plugins, then input, then output - // else, return SONAR_ERROR - unsigned int plug = 0; - int error = PLUGIN_ERROR; - for(plug = 0; plug < num_inp; plug++) - { - int myerror; - assert(input_list[plug].plug != NULL); - assert(input_list[plug].plug->plugin_args != NULL); - if((myerror = - input_list[plug].plug->plugin_args(opt, - optarg)) != - PLUGIN_ERROR && error == PLUGIN_ERROR) - error = myerror; - } - for(plug = 0; plug < num_out; plug++) - { - int myerror; - assert(output_list[plug].plug != NULL); - assert(output_list[plug].plug->plugin_args != NULL); - if((myerror = - output_list[plug].plug->plugin_args(opt, - optarg)) != - PLUGIN_ERROR && error == PLUGIN_ERROR) - error = myerror; - } - for(plug = 0; plug < num_net; plug++) - { - int myerror; - assert(network_list[plug].plug != NULL); - assert(network_list[plug].plug->plugin_args != NULL); - if((myerror = - network_list[plug].plug->plugin_args(opt, - optarg)) != - PLUGIN_ERROR && error == PLUGIN_ERROR) - error = myerror; - } - return error; - } - - /** * @fn plugin_message_hook(char *msg, va_list *ap) * Call each output plugin's output function if its ready --- 570,573 ---- Index: sonar.c =================================================================== RCS file: /cvsroot/autosec/sonar/src/sonar.c,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** sonar.c 31 Mar 2004 11:48:52 -0000 1.41 --- sonar.c 8 Apr 2004 19:11:03 -0000 1.42 *************** *** 316,330 **** } break; - case 'p': - plugin = (char *) optarg; - log_write(LOG_CONSOLE, "Passing arguments this way is soon " - "to be deprecated\n"); - log_write(LOG_DBUG, "plugin_command_handler(%c, %s);\n", - *plugin, (char *) (plugin + 1)); - - if(plugin_command_handler(*plugin,(char *) (plugin + 1)) - == SONAR_ERROR) - sonar_usage("Argument not handled by plugin(s)"); - break; case 'v': if(optarg != NULL) --- 316,319 ---- |