Commit 315a590a authored by Alejandro Mery's avatar Alejandro Mery
Browse files

bin2fex: renamed script_* structs to script_bin_*

parent fa9dede4
...@@ -57,9 +57,9 @@ static int find_full_match(const char *s, size_t l, const char **list) ...@@ -57,9 +57,9 @@ static int find_full_match(const char *s, size_t l, const char **list)
/** /**
*/ */
static inline int decompile_gpio(struct script_section *section, static inline int decompile_gpio(struct script_bin_section *section,
struct script_section_entry *entry, struct script_bin_entry *entry,
struct script_gpio_value *gpio, struct script_bin_gpio_value *gpio,
int length, FILE *out) int length, FILE *out)
{ {
int ok = 1; int ok = 1;
...@@ -110,8 +110,8 @@ static int decompile_single_mode(const char *name) ...@@ -110,8 +110,8 @@ static int decompile_single_mode(const char *name)
else else
return -1; return -1;
} }
static inline int decompile_single(struct script_section *section, static inline int decompile_single(struct script_bin_section *section,
struct script_section_entry *entry, struct script_bin_entry *entry,
int32_t *d, int32_t *d,
int length, FILE *out) int length, FILE *out)
{ {
...@@ -142,10 +142,10 @@ static inline int decompile_single(struct script_section *section, ...@@ -142,10 +142,10 @@ static inline int decompile_single(struct script_section *section,
/** /**
*/ */
static int decompile_section(void *bin, size_t UNUSED(bin_size), static int decompile_section(void *bin, size_t UNUSED(bin_size),
struct script_section *section, struct script_bin_section *section,
FILE *out) FILE *out)
{ {
struct script_section_entry *entry = PTR(bin, section->offset<<2); struct script_bin_entry *entry = PTR(bin, section->offset<<2);
int ok = 1; int ok = 1;
fprintf(out, "[%s]\n", section->name); fprintf(out, "[%s]\n", section->name);
...@@ -195,8 +195,8 @@ static int decompile(void *bin, size_t bin_size, FILE *out) ...@@ -195,8 +195,8 @@ static int decompile(void *bin, size_t bin_size, FILE *out)
{ {
int i; int i;
struct { struct {
struct script_head head; struct script_bin_head head;
struct script_section sections[]; struct script_bin_section sections[];
} *script = bin; } *script = bin;
pr_info("version: %d.%d.%d\n", script->head.version[0], pr_info("version: %d.%d.%d\n", script->head.version[0],
...@@ -206,7 +206,7 @@ static int decompile(void *bin, size_t bin_size, FILE *out) ...@@ -206,7 +206,7 @@ static int decompile(void *bin, size_t bin_size, FILE *out)
/* TODO: SANITY: compare head.sections with bin_size */ /* TODO: SANITY: compare head.sections with bin_size */
for (i=0; i < script->head.sections; i++) { for (i=0; i < script->head.sections; i++) {
struct script_section *section = &script->sections[i]; struct script_bin_section *section = &script->sections[i];
if (!decompile_section(bin, bin_size, section, out)) if (!decompile_section(bin, bin_size, section, out))
return 1; /* failure */ return 1; /* failure */
......
...@@ -19,24 +19,24 @@ ...@@ -19,24 +19,24 @@
#include <stdint.h> #include <stdint.h>
struct script_head { struct script_bin_head {
int32_t sections; int32_t sections;
int32_t version[3]; int32_t version[3];
}; };
struct script_section { struct script_bin_section {
char name[32]; char name[32];
int32_t length; int32_t length;
int32_t offset; int32_t offset;
}; };
struct script_section_entry { struct script_bin_entry {
char name[32]; char name[32];
int32_t offset; int32_t offset;
int32_t pattern; int32_t pattern;
}; };
struct script_gpio_value { struct script_bin_gpio_value {
int32_t port; int32_t port;
int32_t port_num; int32_t port_num;
int32_t mul_sel; int32_t mul_sel;
......
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