summaryrefslogtreecommitdiffstats
path: root/common.h
diff options
context:
space:
mode:
authorTao Bao <tbao@google.com>2018-04-26 01:47:04 +0200
committerTao Bao <tbao@google.com>2018-05-01 06:04:55 +0200
commit2ac56afc7b3df1989f164b18d24295422a020788 (patch)
treeaed13ef5811e7844f128f44b7f830fa2aacb5f86 /common.h
parentMerge "Drop '#include "ui.h"' from device.h." am: 2de12da142 (diff)
downloadandroid_bootable_recovery-2ac56afc7b3df1989f164b18d24295422a020788.tar
android_bootable_recovery-2ac56afc7b3df1989f164b18d24295422a020788.tar.gz
android_bootable_recovery-2ac56afc7b3df1989f164b18d24295422a020788.tar.bz2
android_bootable_recovery-2ac56afc7b3df1989f164b18d24295422a020788.tar.lz
android_bootable_recovery-2ac56afc7b3df1989f164b18d24295422a020788.tar.xz
android_bootable_recovery-2ac56afc7b3df1989f164b18d24295422a020788.tar.zst
android_bootable_recovery-2ac56afc7b3df1989f164b18d24295422a020788.zip
Diffstat (limited to '')
-rw-r--r--common.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/common.h b/common.h
index 4228e71de..33c5ba08f 100644
--- a/common.h
+++ b/common.h
@@ -37,9 +37,13 @@ extern std::string stage;
// The reason argument provided in "--reason=".
extern const char* reason;
-// fopen a file, mounting volumes and making parent dirs as necessary.
+// fopen(3)'s the given file, by mounting volumes and making parent dirs as necessary. Returns the
+// file pointer, or nullptr on error.
FILE* fopen_path(const std::string& path, const char* mode);
+// In turn fflush(3)'s, fsync(3)'s and fclose(3)'s the given stream.
+void check_and_fclose(FILE* fp, const std::string& name);
+
void ui_print(const char* format, ...) __printflike(1, 2);
bool is_ro_debuggable();