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
1fc1addd
Commit
1fc1addd
authored
May 11, 2012
by
Alejandro Mery
Browse files
fexc: finish main()
parent
5ebef7dc
Changes
1
Show whitespace changes
Inline
Side-by-side
fexc.c
View file @
1fc1addd
...
...
@@ -23,6 +23,27 @@
#include <string.h>
#include <unistd.h>
/*
*/
static
struct
script
*
script_new
(
void
)
{
return
NULL
;
}
static
void
script_delete
(
struct
script
*
UNUSED
(
script
))
{
}
static
int
script_parse
(
int
UNUSED
(
mode
),
const
char
*
UNUSED
(
filename
),
struct
script
*
UNUSED
(
script
))
{
return
0
;
}
static
int
script_generate
(
int
UNUSED
(
mode
),
const
char
*
UNUSED
(
filename
),
struct
script
*
UNUSED
(
script
))
{
return
0
;
}
/*
*/
static
inline
void
app_usage
(
const
char
*
arg0
,
int
mode
)
...
...
@@ -54,11 +75,12 @@ int main(int argc, char *argv[])
static
const
char
*
formats
[]
=
{
"fex"
,
"bin"
,
NULL
};
int
infmt
=
0
,
outfmt
=
1
;
const
char
*
filename
[]
=
{
"stdin"
,
"stdout"
};
struct
script
*
script
;
int
app_mode
=
app_choose_mode
(
argv
[
0
]);
const
char
*
opt_string
=
"I:O:vq?"
+
((
app_mode
==
0
)
?
0
:
4
);
int
opt
;
int
opt
,
ret
=
1
;
int
verbose
=
0
;
if
(
app_mode
==
2
)
/* bin2fex */
...
...
@@ -99,7 +121,7 @@ int main(int argc, char *argv[])
default:
show_usage:
app_usage
(
argv
[
0
],
app_mode
);
exit
(
1
)
;
goto
done
;
}
}
...
...
@@ -120,5 +142,14 @@ show_usage:
formats
[
infmt
],
filename
[
0
],
formats
[
outfmt
],
filename
[
1
]);
return
0
;
if
((
script
=
script_new
())
==
NULL
)
{
perror
(
"malloc"
);
goto
done
;
}
else
if
(
script_parse
(
infmt
,
filename
[
0
],
script
)
&&
script_generate
(
outfmt
,
filename
[
1
],
script
))
{
ret
=
0
;
}
script_delete
(
script
);
done:
return
ret
;
}
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