Commit 650b1dfa authored by Alejandro Mery's avatar Alejandro Mery
Browse files

script_fex: move parser from fex2bin.c and make fexc use it

parent 02a8f0ab
...@@ -18,7 +18,8 @@ fex2bin bin2fex: fexc ...@@ -18,7 +18,8 @@ fex2bin bin2fex: fexc
ln -s $< $@ ln -s $< $@
fexc: script.h script.c \ fexc: script.h script.c \
script_bin.h script_bin.c script_bin.h script_bin.c \
script_fex.h script_fex.c
%: %.c %.h %: %.c %.h
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(filter %.c,$^) $(LIBS) $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(filter %.c,$^) $(LIBS)
......
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
#include <errno.h> #include <errno.h>
#include <libgen.h> #include <libgen.h>
#include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>
...@@ -33,14 +32,6 @@ enum script_format { ...@@ -33,14 +32,6 @@ enum script_format {
BIN_SCRIPT_FORMAT, BIN_SCRIPT_FORMAT,
}; };
/*
*/
static int script_parse_fex(FILE *UNUSED(in), const char *UNUSED(filename),
struct script *UNUSED(script))
{
return 0;
}
/* /*
*/ */
static inline int script_parse(enum script_format format, static inline int script_parse(enum script_format format,
......
...@@ -20,8 +20,10 @@ ...@@ -20,8 +20,10 @@
#include "common.h" #include "common.h"
#include <stdint.h> #include <stdint.h>
#include <stdio.h>
#include "script.h" #include "script.h"
#include "script_bin.h" #include "script_bin.h"
#include "script_fex.h"
#endif #endif
...@@ -14,19 +14,16 @@ ...@@ -14,19 +14,16 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "fex2bin.h" #include "common.h"
#include <ctype.h> #include <ctype.h>
#include <errno.h> #include <stdint.h>
#include <limits.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <fcntl.h>
#include "script_bin.h" #include "script.h"
#include "script_fex.h"
#define MAX_LINE 255 #define MAX_LINE 255
...@@ -54,7 +51,7 @@ static inline char *rtrim(const char *s, char *p) ...@@ -54,7 +51,7 @@ static inline char *rtrim(const char *s, char *p)
/** /**
*/ */
static int parse_fex(FILE *in, const char *filename, struct script *script) int script_parse_fex(FILE *in, const char *filename, struct script *script)
{ {
char buffer[MAX_LINE+1]; char buffer[MAX_LINE+1];
int ok = 1; int ok = 1;
......
/*
* Copyright (C) 2012 Alejandro Mery <amery@geeks.cl>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _SUBXI_TOOLS_SCRIPT_FEX_H
#define _SUBXI_TOOLS_SCRIPT_FEX_H
int script_parse_fex(FILE *in, const char *filename, struct script *script);
#endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment