From bddd6fb07906e660260ef0fced05440ecac8d9e9 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 24 Oct 2009 02:23:22 -0400 Subject: switching to git --- wrapper/plugin-parse.h | 100 ++++--------------------------------------------- 1 file changed, 8 insertions(+), 92 deletions(-) (limited to 'wrapper/plugin-parse.h') diff --git a/wrapper/plugin-parse.h b/wrapper/plugin-parse.h index 8a565db..67ee06f 100644 --- a/wrapper/plugin-parse.h +++ b/wrapper/plugin-parse.h @@ -29,105 +29,21 @@ #include "rvs.h" #include "plugins.h" +extern void -plugin_parse_comment (FILE *file) -{ - char c; - while ( (c=getc(file)) != EOF ) { - if ( c == '\n' ) { - ungetc (c, file); - break; - } - } -} +plugin_parse_comment (FILE *file); +extern char -plugin_parse_escape(FILE *file) -{ - char c=getc(file); - switch (c) { - case 'n': - c = '\n'; - case '\\': - case '#': - case ':': - break; - default: - error(EXIT_FAILURE,0,"syntax error"); - break; - } - return c; -} - -#define _parse_share(string) \ - case '#':\ - plugin_parse_comment(file);\ - break;\ - case '\\':\ - c[0]=plugin_parse_escape(file);\ - default:\ - stradds(&nbytes,string,(char *)&c);\ - break; +plugin_parse_escape(FILE *file); +extern char * -plugin_parse_depend (FILE *file) -{ - size_t nbytes = 10; - char *string = (char *)xmalloc(nbytes); - string[0]='\0'; - - char c[2] = " \0"; - while ( (c[0]=getc(file)) != EOF ) { - switch (c[0]) { - case '\n': - ungetc (c[0], file); - return string; - break; - _parse_share(&string) - } - } - return string; -} +plugin_parse_depend (FILE *file); +extern struct plugin_command * -plugin_parse (FILE *file) -{ - struct plugin_command *command; - - char c[2] = " \0"; - c[0]=getc(file); - - if (c[0]==EOF) - command=NULL; - else { - ungetc (c[0], file); - command=plugin_mk_command(); - - size_t nbytes = 10; - command->name = (char *)xmalloc(nbytes); - command->name[0]='\0'; - - while ( (c[0]=getc(file)) != EOF ) { - switch (c[0]) { - case '\n': - /*if (strlen(command->name)==0) {*/ - if (command->name[0]=='\0') { - plugin_free_command(command); - return plugin_parse(file); - } else - command->next=plugin_parse( - file); - break; - case ':': - command->depends=plugin_parse_depend( - file); - break; - _parse_share(&(command->name)) - } - } - } - return command; -} +plugin_parse (struct plugin *plugin, FILE *file); #endif -- cgit v1.2.3-2-g168b