From 3420365915d2a9ca75c7ec18d72ff7c1955de757 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 6 Sep 2009 21:02:08 -0400 Subject: I'm going to come out and say it, I fucked it up :( --- wrapper/plugin-parse.c | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) (limited to 'wrapper/plugin-parse.c') diff --git a/wrapper/plugin-parse.c b/wrapper/plugin-parse.c index 7fd04bb..8560dfd 100644 --- a/wrapper/plugin-parse.c +++ b/wrapper/plugin-parse.c @@ -20,7 +20,17 @@ #ifndef FILE_plugin_parse_c_SEEN #define FILE_plugin_parse_c_SEEN -void _plugin_parse_comment (FILE *file) +#include + +/* these 2 are only used in _plugin_parse_escape */ +#include +#include + +#include "rvs.h" +#include "plugin.h" + +void +_plugin_parse_comment (FILE *file) { char c; while ( (c=getc(file)) != EOF ) { @@ -31,7 +41,8 @@ void _plugin_parse_comment (FILE *file) } } -char _plugin_parse_escape(FILE *file) +char +_plugin_parse_escape(FILE *file) { char c=getc(file); switch (c) { @@ -48,7 +59,8 @@ char _plugin_parse_escape(FILE *file) return c; } -char *_plugin_parse_depend (FILE *file) +char * +_plugin_parse_depend (FILE *file) { size_t nbytes = 10; char *string = (char *)xmalloc(nbytes); @@ -78,7 +90,8 @@ char *_plugin_parse_depend (FILE *file) return string; } -struct plugin_command *_plugin_parse (struct plugin *plugin, FILE *file) +struct plugin_command * +_plugin_parse (FILE *file) { struct plugin_command *command=mkcommand(); @@ -95,13 +108,12 @@ struct plugin_command *_plugin_parse (struct plugin *plugin, FILE *file) } while ( (c[0]=getc(file)) != EOF ) { if (c[0] == '\n') { - if (strcmp(string,"")==0) { + if (strlen(string)==0) { xfree(command); xfree(string); - command=_plugin_parse(plugin, file); + command=_plugin_parse(file); } else { command->name=string; - command->p_next=_plugin_parse(plugin, file); } break; } else { @@ -114,7 +126,8 @@ struct plugin_command *_plugin_parse (struct plugin *plugin, FILE *file) _plugin_parse_comment(file); break; case ':': - command->depends=_plugin_parse_depend(file); + command->depends=_plugin_parse_depend( + file); break; default: stradds(&nbytes,&string,cs); @@ -126,3 +139,4 @@ struct plugin_command *_plugin_parse (struct plugin *plugin, FILE *file) } #endif + -- cgit v1.2.3-2-g168b