Expose functions used to add entries to the zip file.

Currently only dumpstate.cpp is using the new functions and variables
used to add an entry to the zip file so they're defined locally, but
they should be exposed through the .h so they can be used by the
device-specific dumpstate_board() implementations.

This CL moves the following definitions to the .h:

- bugreport_dir
- ZIP_ROOT_DIR
- add_zip_entry()
- add_zip_entry_from_fd()

It also refactored functions that were taking a specific file location
to use bugreport_dir instead, to avoid pollution on main().

BUG: 28867848
Change-Id: Ic5faa203b0863bc950d640f22fb91977e52b6bfc
diff --git a/cmds/dumpstate/dumpstate.h b/cmds/dumpstate/dumpstate.h
index c51c79a..94bfc5a 100644
--- a/cmds/dumpstate/dumpstate.h
+++ b/cmds/dumpstate/dumpstate.h
@@ -81,6 +81,18 @@
  * idioms (like using std::string instead of char*, removing varargs, etc...) */
 extern int do_update_progress, progress, weight_total;
 
+/* full path of the directory where the bugreport files will be written */
+extern std::string bugreport_dir;
+
+/* root dir for all files copied as-is into the bugreport. */
+extern const std::string ZIP_ROOT_DIR;
+
+/* adds a new entry to the existing zip file. */
+bool add_zip_entry(const std::string& entry_name, const std::string& entry_path);
+
+/* adds a new entry to the existing zip file. */
+bool add_zip_entry_from_fd(const std::string& entry_name, int fd);
+
 /* prints the contents of a file */
 int dump_file(const char *title, const char *path);