summaryrefslogtreecommitdiff
path: root/wrapper/plugin-parse.h
diff options
context:
space:
mode:
authorLuke Shumaker <luke@HP-dv6426us-u904>2009-10-24 02:23:22 -0400
committerLuke Shumaker <lukeshu@sbcglobal.net>2015-06-26 00:30:16 -0600
commitbddd6fb07906e660260ef0fced05440ecac8d9e9 (patch)
tree882c913e0cb2e89537747b90f8c47a65d5cd15d0 /wrapper/plugin-parse.h
parent1eddff249b2c7ce54544b840562e782501d47924 (diff)
switching to git
Diffstat (limited to 'wrapper/plugin-parse.h')
-rw-r--r--wrapper/plugin-parse.h100
1 files changed, 8 insertions, 92 deletions
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