cli: Move some declarations into `cli.h`
This will help to keep new CLIs clean from internal headers.
Change-Id: I3e5515ae5645fcdce56c13df1ff23de829bbbdb9
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.sourcearcade.org/c/flashprog/+/72989
diff --git a/cli_output.c b/cli_output.c
index 5f02fc3..88ee93a 100644
--- a/cli_output.c
+++ b/cli_output.c
@@ -19,7 +19,9 @@
#include <stdarg.h>
#include <string.h>
#include <errno.h>
+
#include "flash.h"
+#include "cli.h"
enum flashprog_log_level verbose_screen = FLASHPROG_MSG_INFO;
enum flashprog_log_level verbose_logfile = FLASHPROG_MSG_DEBUG2;
diff --git a/include/cli.h b/include/cli.h
index 1ba442b..e9e512c 100644
--- a/include/cli.h
+++ b/include/cli.h
@@ -64,4 +64,10 @@
int flashprog_classic_main(int argc, char *argv[]);
+extern enum flashprog_log_level verbose_screen;
+extern enum flashprog_log_level verbose_logfile;
+int open_logfile(const char * const filename);
+int close_logfile(void);
+void start_logging(void);
+
#endif
diff --git a/include/flash.h b/include/flash.h
index ed4a373..6bbc378 100644
--- a/include/flash.h
+++ b/include/flash.h
@@ -565,11 +565,6 @@
void print_chip_support_status(const struct flashchip *chip);
/* cli_output.c */
-extern enum flashprog_log_level verbose_screen;
-extern enum flashprog_log_level verbose_logfile;
-int open_logfile(const char * const filename);
-int close_logfile(void);
-void start_logging(void);
int flashprog_print_cb(enum flashprog_log_level level, const char *fmt, va_list ap);
void flashprog_progress_cb(enum flashprog_progress_stage, size_t current, size_t total, void *user_data);
/* Let gcc and clang check for correct printf-style format strings. */