-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
85 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
|
||
#include "p7u_cmn.h" | ||
#include <stdio.h> | ||
#include <unistd.h> | ||
#include <stdlib.h> | ||
#include "hef_str.h" | ||
#include "hef_data.h" | ||
#include "hef_assert.h" | ||
|
||
char szP7zWcxFile[128] = "p7z_usr.wcx"; | ||
bool bShowDebug = 0; | ||
//char szDirCharABfr[2] = { '\\', 0, }; // '\\' => 0x5C | ||
std::string* DebugLogFile = 0; | ||
std::string* SelfWcxFile = 0; | ||
std::string* Str7zSoFile = 0; | ||
int uGlobArcExcCalbRefc = 0; | ||
|
||
void wcxi_DebugString( const char* inp ) | ||
{ | ||
if(bShowDebug){ | ||
printf("%s: %s\n", szP7zWcxFile, inp ); | ||
if( DebugLogFile && !DebugLogFile->empty() ){ | ||
std::string str; | ||
str = hf_strftime2( "%H:%M:%S ", 0 ); | ||
str += inp; | ||
str += "\n"; | ||
hf_PutFileBytes( DebugLogFile->c_str(), str.c_str(), -1, EPFBF_APPEND ); | ||
} | ||
} | ||
} | ||
void wcxi_ConvU64To2xU32( uint64_t inp, uint32_t* uLow, uint32_t* uHi ) | ||
{ | ||
*uLow = (uint32_t)( inp & 0xFFFFFFFF ); | ||
*uHi = (uint32_t)( (inp >> 32) & 0xFFFFFFFF ); | ||
} | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
|
||
#ifndef _P7U_CMN_H_ | ||
#define _P7U_CMN_H_ | ||
#include <string> | ||
#include <vector> | ||
#include <stdint.h> | ||
|
||
namespace hef{} | ||
using namespace hef; | ||
|
||
extern bool bShowDebug; | ||
extern std::string* DebugLogFile; | ||
extern std::string* SelfWcxFile; | ||
extern std::string* Str7zSoFile; | ||
extern char szP7zWcxFile[128]; | ||
extern int uGlobArcExcCalbRefc; | ||
|
||
void wcxi_DebugString( const char* ); | ||
void wcxi_ConvU64To2xU32( uint64_t inp, uint32_t* uLow, uint32_t* uHi ); | ||
|
||
class IProcRelay{ | ||
public: | ||
/// Set percentage positions durning DCMD files extract process. | ||
/// Return value 0 indicates user cancel via DCMD GUI. | ||
virtual bool iprSetFilePercentage( const char* szFilename, float fPercentage ) = 0; | ||
virtual bool iprSetTotalPercentage( const char* szFilename, float fPercentage ) = 0; | ||
// | ||
struct SMsgBox{ | ||
const char* capt, *msg; | ||
bool bOkAccepted; | ||
int flags3; // fe. 0x10 = red error icon. | ||
SMsgBox() : capt(""), msg(""), bOkAccepted(0), flags3(0) {} | ||
}; | ||
struct SPrompt : SMsgBox{ | ||
std::string strIoVal; ///< input|output value for|from prompt edit field. | ||
}; | ||
/// Returns true if prompt box was available and was displayed. | ||
/// Value 'bOkAccepted' gets set to 1 if ok button was pressed. | ||
virtual bool iprPromptBox( SPrompt& inp ) = 0; | ||
virtual bool iprMessageBox( SMsgBox& inp ) = 0; | ||
// | ||
virtual bool iprTryGetOrAskArcFNPassword( const char* szArcFnm, std::string* outp ) = 0; | ||
virtual bool iprRemoveArcFNPassword( const char* szArcFnm ) = 0; | ||
}; | ||
|
||
#endif //_P7U_CMN_H_ |