Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Sunxi Tools
Commits
650b1dfa
Commit
650b1dfa
authored
May 11, 2012
by
Alejandro Mery
Browse files
script_fex: move parser from fex2bin.c and make fexc use it
parent
02a8f0ab
Changes
5
Hide whitespace changes
Inline
Side-by-side
Makefile
View file @
650b1dfa
...
@@ -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)
...
...
fexc.c
View file @
650b1dfa
...
@@ -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
,
...
...
fexc.h
View file @
650b1dfa
...
@@ -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
fex2bin
.c
→
script_fex
.c
View file @
650b1dfa
...
@@ -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 "
fex2bi
n.h"
#include "
commo
n.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
;
...
...
script_fex.h
0 → 100644
View file @
650b1dfa
/*
* 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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment