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
ln -s $< $@
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
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(filter %.c,$^) $(LIBS)
......
......@@ -19,7 +19,6 @@
#include <errno.h>
#include <libgen.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
......@@ -33,14 +32,6 @@ enum 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,
......
......@@ -20,8 +20,10 @@
#include "common.h"
#include <stdint.h>
#include <stdio.h>
#include "script.h"
#include "script_bin.h"
#include "script_fex.h"
#endif
......@@ -14,19 +14,16 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "fex2bin.h"
#include "common.h"
#include <ctype.h>
#include <errno.h>
#include <limits.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.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
......@@ -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];
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