layout: Tidy up the include-args API
Move all forward declarations into `layout.h`, use consistent naming.
Change-Id: I0e87c9d91b9bc4d78f9cee98caff6985803f7be7
Signed-off-by: Nico Huber <nico.h@gmx.de>
Original-Reviewed-on: https://review.coreboot.org/c/flashrom/+/54287
Original-Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Original-Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
Original-Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
Reviewed-on: https://review.coreboot.org/c/flashrom-stable/+/72223
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
diff --git a/cli_classic.c b/cli_classic.c
index c222325..9a6b6c0 100644
--- a/cli_classic.c
+++ b/cli_classic.c
@@ -685,7 +685,7 @@
free(flashes[i].chip);
}
- layout_cleanup(&include_args);
+ cleanup_include_args(&include_args);
free(filename);
free(fmapfile);
free(referencefile);
diff --git a/flash.h b/flash.h
index 4045aca..cda79e3 100644
--- a/flash.h
+++ b/flash.h
@@ -486,10 +486,6 @@
#define msg_pspew(...) print(FLASHROM_MSG_SPEW, __VA_ARGS__) /* programmer debug spew */
#define msg_cspew(...) print(FLASHROM_MSG_SPEW, __VA_ARGS__) /* chip debug spew */
-/* layout.c */
-int register_include_arg(struct layout_include_args **args, char *name);
-void layout_cleanup(struct layout_include_args **args);
-
/* spi.c */
struct spi_command {
unsigned int writecnt;
diff --git a/layout.c b/layout.c
index 79965b3..804e4fe 100644
--- a/layout.c
+++ b/layout.c
@@ -186,7 +186,7 @@
return 0;
}
-void layout_cleanup(struct layout_include_args **args)
+void cleanup_include_args(struct layout_include_args **args)
{
struct layout_include_args *tmp;
diff --git a/layout.h b/layout.h
index d58113f..852b3ef 100644
--- a/layout.h
+++ b/layout.h
@@ -54,7 +54,10 @@
int layout_from_file(struct flashrom_layout **, const char *name);
+int register_include_arg(struct layout_include_args **args, char *arg);
int process_include_args(struct flashrom_layout *l, const struct layout_include_args *const args);
+void cleanup_include_args(struct layout_include_args **args);
+
const struct romentry *layout_next_included_region(const struct flashrom_layout *, chipoff_t);
const struct romentry *layout_next_included(const struct flashrom_layout *, const struct romentry *);
const struct romentry *layout_next(const struct flashrom_layout *, const struct romentry *);