forked from enlightenment/efl
eolian gen2: parse input file properly
This commit is contained in:
parent
a9b83ea28b
commit
9edee0a8e6
|
@ -3,6 +3,7 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#include <libgen.h>
|
||||||
|
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
|
|
||||||
|
@ -279,25 +280,35 @@ main(int argc, char **argv)
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!eolian_file_parse(input))
|
||||||
|
{
|
||||||
|
fprintf(stderr, "eolian: could not parse file '%s'\n", input);
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
char *inoext = strdup(input);
|
char *inoext = strdup(input);
|
||||||
inoext[ext - input] = '\0';
|
inoext[ext - input] = '\0';
|
||||||
_fill_all_outs(outs, inoext);
|
_fill_all_outs(outs, inoext);
|
||||||
free(inoext);
|
|
||||||
|
inoext[ext - input] = '.';
|
||||||
|
char *eobn = basename(inoext);
|
||||||
|
|
||||||
if (!gen_what)
|
if (!gen_what)
|
||||||
gen_what = GEN_H | GEN_H_LEGACY | GEN_C;
|
gen_what = GEN_H | GEN_H_LEGACY | GEN_C;
|
||||||
|
|
||||||
Eina_Bool succ = EINA_TRUE;
|
Eina_Bool succ = EINA_TRUE;
|
||||||
if (gen_what & GEN_H)
|
if (gen_what & GEN_H)
|
||||||
succ = _write_header(outs[_get_bit_pos(GEN_H)], input, EINA_FALSE);
|
succ = _write_header(outs[_get_bit_pos(GEN_H)], eobn, EINA_FALSE);
|
||||||
if (succ && (gen_what & GEN_H_LEGACY))
|
if (succ && (gen_what & GEN_H_LEGACY))
|
||||||
succ = _write_header(outs[_get_bit_pos(GEN_H_LEGACY)], input, EINA_TRUE);
|
succ = _write_header(outs[_get_bit_pos(GEN_H_LEGACY)], eobn, EINA_TRUE);
|
||||||
if (succ && (gen_what & GEN_H_STUB))
|
if (succ && (gen_what & GEN_H_STUB))
|
||||||
succ = _write_stub_header(outs[_get_bit_pos(GEN_H_STUB)], input);
|
succ = _write_stub_header(outs[_get_bit_pos(GEN_H_STUB)], eobn);
|
||||||
if (succ && (gen_what & GEN_C))
|
if (succ && (gen_what & GEN_C))
|
||||||
succ = _write_source(outs[_get_bit_pos(GEN_C)], input);
|
succ = _write_source(outs[_get_bit_pos(GEN_C)], eobn);
|
||||||
if (succ && (gen_what & GEN_C_IMPL))
|
if (succ && (gen_what & GEN_C_IMPL))
|
||||||
succ = _write_impl(outs[_get_bit_pos(GEN_C_IMPL)], input);
|
succ = _write_impl(outs[_get_bit_pos(GEN_C_IMPL)], eobn);
|
||||||
|
|
||||||
|
free(inoext);
|
||||||
|
|
||||||
if (!succ)
|
if (!succ)
|
||||||
goto end;
|
goto end;
|
||||||
|
|
Loading…
Reference in New Issue