Cleanup C++ headers

This commit is contained in:
topjohnwu
2025-06-16 02:25:38 -07:00
parent 12340c9bd5
commit 1460317ebd
20 changed files with 14 additions and 48 deletions
+5
View File
@@ -43,6 +43,11 @@ static size_t restore(int fd, const char *filename) {
return size;
}
static bool check_env(const char *name) {
const char *val = getenv(name);
return val != nullptr && val == "true"sv;
}
void dyn_img_hdr::print() const {
uint32_t ver = header_version();
fprintf(stderr, "%-*s [%u]\n", PADDING, "HEADER_VER", ver);
-11
View File
@@ -1,9 +1,5 @@
#pragma once
#include <sys/types.h>
#include <base.hpp>
#define HEADER_FILE "header"
#define KERNEL_FILE "kernel"
#define RAMDISK_FILE "ramdisk.cpio"
@@ -21,10 +17,3 @@ void repack(const char *src_img, const char *out_img, bool skip_comp = false);
int verify(const char *image, const char *cert);
int sign(const char *image, const char *name, const char *cert, const char *key);
int split_image_dtb(const char *filename, bool skip_decomp = false);
int dtb_commands(int argc, char *argv[]);
static inline bool check_env(const char *name) {
using namespace std::string_view_literals;
const char *val = getenv(name);
return val != nullptr && val == "true"sv;
}