1
0
Fork 0
forked from len0rd/rockbox

sbtools: now generate a db file along with with elf/rsrc files

Now always generate a "make.db" file which aims at being the exact
representation of the file, ie running sbtoelf and elftosb using
the generated command file should produce the exact same file
(except for the random paddings). We still miss the support
for some option parsing to achieve that though.

Change-Id: Ib7d6b241f7855fd35225df8ab8e0711f69d9ee5a
This commit is contained in:
Amaury Pouly 2013-08-22 00:58:19 +02:00
parent e64008bf9a
commit 81f97f67e2
6 changed files with 315 additions and 9 deletions

View file

@ -107,12 +107,29 @@ struct cmd_file_t
struct cmd_section_t *section_list;
};
typedef void (*db_color_printf)(void *u, bool err, color_t c, const char *f, ...);
struct cmd_source_t *db_find_source_by_id(struct cmd_file_t *cmd_file, const char *id);
struct cmd_option_t *db_find_option_by_id(struct cmd_option_t *opt, const char *name);
bool db_parse_sb_version(struct sb_version_t *ver, char *str);
bool db_generate_sb_version(struct sb_version_t *ver, char *str, int size);
void db_generate_default_sb_version(struct sb_version_t *ver);
struct cmd_file_t *db_parse_file(const char *file);
/* NOTE: db_add_{str_opt,int_opt,source,extern_source} add at the beginning of the list */
void db_add_str_opt(struct cmd_option_t **opt, const char *name, const char *str);
void db_add_int_opt(struct cmd_option_t **opt, const char *name, uint32_t value);
void db_add_source(struct cmd_file_t *cmd_file, const char *identifier, const char *filename);
void db_add_inst_id(struct cmd_section_t *cmd_section, enum cmd_inst_type_t type,
const char *identifier, uint32_t argument);
void db_add_inst_addr(struct cmd_section_t *cmd_section, enum cmd_inst_type_t type,
uint32_t addr, uint32_t argument);
struct cmd_section_t *db_add_section(struct cmd_file_t *cmd_file, uint32_t identifier, bool data);
void db_add_extern_source(struct cmd_file_t *cmd_file, const char *identifier, int extern_nr);
bool db_generate_file(struct cmd_file_t *file, const char *filename, void *user, db_color_printf printf);
void db_free_option_list(struct cmd_option_t *opt_list);
void db_free(struct cmd_file_t *file);
/* standard implementation: user is unused*/
void db_std_printf(void *user, bool error, color_t c, const char *fmt, ...);
#endif /* __DBPARSER__ */