From 3bf2b0e63052bb5537398f38ecc5b19fec7dec39 Mon Sep 17 00:00:00 2001 From: bigbiff bigbiff Date: Mon, 21 Jan 2013 21:26:43 -0500 Subject: change tar create to pthread Change-Id: I5a33d207ec6683de20da37e6f4f174c67785fc52 --- twrpTar.hpp | 37 +++++++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 14 deletions(-) (limited to 'twrpTar.hpp') diff --git a/twrpTar.hpp b/twrpTar.hpp index 554a01dbd..db9cf9bb8 100644 --- a/twrpTar.hpp +++ b/twrpTar.hpp @@ -32,30 +32,39 @@ using namespace std; class twrpTar { public: - int create(string dir, string fn); - int createTGZ(string dir, string fn); - int extract(string rootDir, string fn); + int extract(); int compress(string fn); - int extractTGZ(string rootdir, string fn); int uncompress(string fn); int addFilesToExistingTar(vector files, string tarFile); - int createTar(string dir, string fn); - int openTar(string rootdir, string fn, bool gzip); + int createTar(); int addFile(string fn, bool include_root); - int closeTar(string fn, bool gzip); - int Split_Archive(string Path, string fn); + int closeTar(bool gzip); + int createTarGZThread(); + int createTarThread(); + int extractTarThread(); + int splitArchiveThread(); + void setfn(string fn); + void setdir(string dir); private: + int createTGZ(); + int create(); + int Split_Archive(); int removeEOT(string tarFile); - int extractTar(string rootdir, string fn); - int tarDirs(string dir, string fn, bool include_root); - int Generate_Multiple_Archives(string Path, string fn); - - private: + int extractTar(); + int tarDirs(bool include_root); + int Generate_Multiple_Archives(string Path); + string Strip_Root_Dir(string Path); + int extractTGZ(); + int openTar(bool gzip); int has_data_media; int Archive_File_Count; unsigned long long Archive_Current_Size; - string Strip_Root_Dir(string Path); TAR *t; FILE* p; int fd; + string tardir; + string tarfn; + string basefn; + typedef int (twrpTar::*ThreadPtr)(void); + typedef void* (*PThreadPtr)(void*); }; -- cgit v1.2.3