summaryrefslogtreecommitdiff
path: root/wrapper/plugin-parse.c
diff options
context:
space:
mode:
Diffstat (limited to 'wrapper/plugin-parse.c')
-rw-r--r--wrapper/plugin-parse.c30
1 files changed, 22 insertions, 8 deletions
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 <stdio.h>
+
+/* these 2 are only used in _plugin_parse_escape */
+#include <stdlib.h>
+#include <error.h>
+
+#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
+