Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
ike9000e authored Feb 20, 2017
1 parent ba92f70 commit 16bc9f7
Show file tree
Hide file tree
Showing 2 changed files with 85 additions and 0 deletions.
39 changes: 39 additions & 0 deletions test/p7u_cmn.cpp
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 );
}




46 changes: 46 additions & 0 deletions test/p7u_cmn.h
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_

0 comments on commit 16bc9f7

Please sign in to comment.