1 Commits

Author SHA1 Message Date
cvs2svn b442e312bb This commit was manufactured by cvs2svn to create tag 'RELEASE_0_3_0'.
git-svn-id: http://svn.php.net/repository/pecl/rar/tags/RELEASE_0_3_0@214301 c90b9560-bf6c-de11-be94-00142212c4b1
2006-06-06 08:07:45 +00:00
26 changed files with 87 additions and 134 deletions
+1 -1
View File
@@ -18,7 +18,7 @@ unrar_sources="unrar/rar.cpp unrar/strlist.cpp unrar/strfn.cpp \
unrar/volume.cpp unrar/find.cpp \
unrar/unpack.cpp unrar/cmddata.cpp unrar/dll.cpp \
unrar/filestr.cpp unrar/recvol.cpp unrar/rs.cpp \
unrar/scantree.cpp unrar/log.cpp"
unrar/scantree.cpp"
if test "$PHP_RAR" != "no"; then
PHP_REQUIRE_CXX
+5 -19
View File
@@ -16,24 +16,15 @@
</maintainer>
</maintainers>
<release>
<version>0.3.1</version>
<date>2006-08-28</date>
<version>0.3.0</version>
<date>2006-06-06</date>
<state>beta</state>
<notes>
- Updated bundled unrar to version 3.6.8.
- Fixed PHP4 compatibility.
- Updated bundled unrar to version 3.6.2 (fixes compile errors with GCC4).
- Several minor fixes.
</notes>
</release>
<changelog>
<release>
<version>0.3.0</version>
<date>2006-06-06</date>
<state>beta</state>
<notes>
- Updated bundled unrar to version 3.6.2 (fixes compile errors with GCC4).
- Several minor fixes.
</notes>
</release>
<release>
<version>0.2</version>
<date>2004-12-02</date>
@@ -63,12 +54,6 @@
<file role="src">config.m4</file>
<file role="src">php_rar.h</file>
<file role="src">rar.cpp</file>
<file role="test">tests/001.phpt</file>
<file role="test">tests/002.phpt</file>
<file role="test">tests/003.phpt</file>
<file role="test">tests/004.phpt</file>
<file role="test">tests/latest_winrar.rar</file>
<file role="test">tests/linux_rar.rar</file>
<dir role="src" name="/unrar/">
@@ -129,6 +114,7 @@
<file role="src">log.hpp</file>
<file role="src">match.cpp</file>
<file role="src">match.hpp</file>
<file role="src">memfree.hpp</file>
<file role="src">model.cpp</file>
<file role="src">model.hpp</file>
<file role="src">msc.dep</file>
-10
View File
@@ -45,16 +45,6 @@ extern "C" {
#include "php_rar.h"
#include "unrar/rar.hpp"
/* PHP4 compat {{{ */
#ifndef PHP_METHOD
#define ZEND_MN(name) zim_##name
#define PHP_METHOD(classname, name) ZEND_NAMED_FUNCTION(ZEND_MN(classname##_##name))
#define ZEND_FENTRY(zend_name, name, arg_info, flags) { #zend_name, name, arg_info},
#define PHP_ME(classname, name, arg_info, flags) ZEND_FENTRY(name, ZEND_MN(classname##_##name), arg_info, flags)
#endif
/* }}} */
static int le_rar_file;
#define le_rar_file_name "Rar"
static zend_class_entry *rar_class_entry_ptr;
+4
View File
@@ -65,7 +65,9 @@ void ExtractBeEA(Archive &Arc,char *FileName)
AttrPos+=10+NameSize+Size;
}
close(fd);
#ifndef GUI
mprintf(St(MShowEA));
#endif
}
@@ -108,6 +110,8 @@ void ExtractBeEANew(Archive &Arc,char *FileName)
AttrPos+=10+NameSize+Size;
}
close(fd);
#ifndef GUI
mprintf(St(MShowEA));
#endif
}
+2 -3
View File
@@ -599,9 +599,6 @@ void CommandData::ProcessSwitch(char *Switch)
Threads=atoi(Switch+2);
if (Threads>MaxSearchThreads)
BadSwitch(Switch);
else
{
}
break;
#endif
default:
@@ -805,7 +802,9 @@ void CommandData::ProcessSwitch(char *Switch)
#ifndef SFX_MODULE
void CommandData::BadSwitch(char *Switch)
{
#ifndef GUI
mprintf(St(MUnknownOption),Switch);
#endif
ErrHandler.Exit(RAR_USER_ERROR);
}
#endif
+1 -1
View File
@@ -121,7 +121,7 @@ void GetPasswordText(char *Str,int MaxLength)
OemToChar(Str,Str);
SetConsoleMode(hConIn,ConInMode);
SetConsoleMode(hConOut,ConOutMode);
#elif defined(_EMX) || defined(_BEOS) || defined(__sparc) || defined(sparc) || defined (__VMS)
#elif defined(_EMX) || defined(_BEOS) || defined(__sparc) || defined(sparc)
fgets(Str,MaxLength-1,stdin);
#else
strncpy(Str,getpass(""),MaxLength-1);
+2 -2
View File
@@ -53,14 +53,14 @@ HANDLE PASCAL RAROpenArchiveEx(struct RAROpenArchiveDataEx *r)
Data->Cmd.VersionControl=1;
if (!Data->Arc.Open(r->ArcName,r->ArcNameW))
{
r->OpenResult=ERAR_EOPEN;
delete Data;
r->OpenResult=ERAR_EOPEN;
return(NULL);
}
if (!Data->Arc.IsArchive(false))
{
r->OpenResult=Data->Cmd.DllError!=0 ? Data->Cmd.DllError:ERAR_BAD_ARCHIVE;
delete Data;
r->OpenResult=Data->Cmd.DllError!=0 ? Data->Cmd.DllError:ERAR_BAD_ARCHIVE;
return(NULL);
}
r->Flags=Data->Arc.NewMhd.Flags;
+2 -2
View File
@@ -63,7 +63,7 @@ void ErrorHandler::ReadError(const char *FileName)
bool ErrorHandler::AskRepeatRead(const char *FileName)
{
#if !defined(SILENT) && !defined(SFX_MODULE) && !defined(_WIN_CE)
#if !defined(SILENT) && !defined(SFX_MODULE) && !defined(_WIN_CE) && !defined(GUI)
if (!Silent)
{
mprintf("\n");
@@ -102,7 +102,7 @@ void ErrorHandler::WriteErrorFAT(const char *FileName)
bool ErrorHandler::AskRepeatWrite(const char *FileName)
{
#if !defined(SILENT) && !defined(_WIN_CE)
#if !defined(SILENT) && !defined(_WIN_CE) && !defined(GUI)
if (!Silent)
{
mprintf("\n");
+5 -21
View File
@@ -28,22 +28,8 @@ void CmdExtract::DoExtract(CommandData *Cmd)
Cmd->ArcNames->Rewind();
while (Cmd->GetArcName(ArcName,ArcNameW,sizeof(ArcName)))
{
while (true)
{
char PrevCmdPassword[MAXPASSWORD];
strcpy(PrevCmdPassword,Cmd->Password);
EXTRACT_ARC_CODE Code=ExtractArchive(Cmd);
/*
restore Cmd->Password which could be changed in IsArchive() call
for next header encrypted archive
*/
strcpy(Cmd->Password,PrevCmdPassword);
if (Code!=EXTRACT_ARC_REPEAT)
break;
}
while (ExtractArchive(Cmd)==EXTRACT_ARC_REPEAT)
;
if (FindFile::FastFind(ArcName,ArcNameW,&FD))
DataIO.ProcessedArcSize+=FD.Size;
}
@@ -52,7 +38,9 @@ void CmdExtract::DoExtract(CommandData *Cmd)
{
if (!PasswordCancelled)
{
#ifndef GUI
mprintf(St(MExtrNoFiles));
#endif
}
ErrHandler.SetErrorCode(RAR_WARNING);
}
@@ -155,7 +143,6 @@ EXTRACT_ARC_CODE CmdExtract::ExtractArchive(CommandData *Cmd)
else
break;
}
return(EXTRACT_ARC_NEXT);
}
@@ -443,10 +430,7 @@ bool CmdExtract::ExtractCurrentFile(CommandData *Cmd,Archive &Arc,int HeaderSize
else
strcat(DestFileName,ExtrName);
char DiskLetter=toupper(DestFileName[0]);
if (AbsPaths && DestFileName[1]=='_' && IsPathDiv(DestFileName[2]) &&
DiskLetter>='A' && DiskLetter<='Z')
if (AbsPaths && DestFileName[1]=='_' && IsPathDiv(DestFileName[2]))
DestFileName[1]=':';
#ifndef SFX_MODULE
+1 -2
View File
@@ -6,8 +6,6 @@ enum EXTRACT_ARC_CODE {EXTRACT_ARC_NEXT,EXTRACT_ARC_REPEAT};
class CmdExtract
{
private:
EXTRACT_ARC_CODE ExtractArchive(CommandData *Cmd);
ComprDataIO DataIO;
Unpack *Unp;
long TotalFileCount;
@@ -33,6 +31,7 @@ class CmdExtract
~CmdExtract();
void DoExtract(CommandData *Cmd);
void ExtractArchiveInit(CommandData *Cmd,Archive &Arc);
EXTRACT_ARC_CODE ExtractArchive(CommandData *Cmd);
bool ExtractCurrentFile(CommandData *Cmd,Archive &Arc,int HeaderSize,
bool &Repeat);
static void UnstoreFile(ComprDataIO &DataIO,Int64 DestUnpSize);
+2
View File
@@ -56,7 +56,9 @@ bool FileCreate(RAROptions *Cmd,File *NewFile,char *Name,wchar *NameW,
}
if (Choice==5)
{
#ifndef GUI
mprintf(St(MAskNewName));
#endif
char NewName[NM];
#ifdef _WIN_32
+1 -1
View File
@@ -432,7 +432,7 @@ bool File::RawSeek(Int64 Offset,int Method)
return(false);
#else
LastWrite=false;
#if defined(_LARGEFILE_SOURCE) && !defined(_OSF_SOURCE) && !defined(__VMS)
#if defined(_LARGEFILE_SOURCE) && !defined(_OSF_SOURCE)
if (fseeko(hFile,Offset,Method)!=0)
#else
if (fseek(hFile,(long)int64to32(Offset),Method)!=0)
+1 -2
View File
@@ -300,9 +300,8 @@ bool IsLink(uint Attr)
{
#ifdef _UNIX
return((Attr & 0xF000)==0xA000);
#else
return(false);
#endif
return(false);
}
+1 -4
View File
@@ -64,10 +64,7 @@ void ListArchive(CommandData *Cmd)
}
while(Arc.ReadHeader()>0)
{
int HeaderType=Arc.GetHeaderType();
if (HeaderType==ENDARC_HEAD)
break;
switch(HeaderType)
switch(Arc.GetHeaderType())
{
case FILE_HEAD:
IntToExt(Arc.NewLhd.FileName,Arc.NewLhd.FileName);
+1 -1
View File
@@ -133,7 +133,7 @@
#define MCHelpSwXa "\n x@ Read file names to exclude from stdin"
#define MCHelpSwXal "\n x@<list> Exclude files in specified list file"
#define MCHelpSwY "\n y Assume Yes on all queries"
#define MCHelpSwZ "\n z[file] Read archive comment from file"
#define MCHelpSwZ "\n z<file> Read archive comment from file"
#define MBadArc "\nERROR: Bad archive %s\n"
#define MAskPsw "Enter password (will not be echoed)"
#define MAskPswEcho "Enter password"
-24
View File
@@ -1,24 +0,0 @@
#include "rar.hpp"
static char LogName[NM];
void InitLogOptions(char *LogName)
{
strcpy(::LogName,LogName);
}
#ifndef SILENT
void Log(const char *ArcName,const char *Format,...)
{
safebuf char Msg[2*NM+1024];
va_list ArgPtr;
va_start(ArgPtr,Format);
vsprintf(Msg,Format,ArgPtr);
va_end(ArgPtr);
eprintf("%s",Msg);
}
#endif
-18
View File
@@ -1,18 +0,0 @@
#ifndef _RAR_LOG_
#define _RAR_LOG_
void InitLogOptions(char *LogName);
#ifndef SILENT
void Log(const char *ArcName,const char *Format,...);
#endif
#ifdef SILENT
#ifdef __GNUC__
#define Log(args...)
#else
inline void Log(const char *a,const char *b,const char *c=NULL,const char *d=NULL) {}
#endif
#endif
#endif
+35
View File
@@ -0,0 +1,35 @@
#ifndef _WINRAR_MEMFREE_
#define _WINRAR_MEMFREE_
#ifndef USE_MEMFREE
#define rmalloc malloc
#define rcalloc calloc
#define rrealloc realloc
#define rfree free
#define rstrdup strdup
#else
void* rmalloc(size_t size);
void* rcalloc(size_t nitems,size_t size);
void* rrealloc(void *block,size_t size);
void rfree(void *block);
char* rstrdup(const char *s);
class MemoryFree
{
private:
void **Allocated;
int AllocSize;
public:
MemoryFree();
~MemoryFree();
void Free();
void Add(void *Addr);
void Delete(void *Addr);
};
#endif //USE_MEMFREE
#endif
+6 -8
View File
@@ -194,14 +194,12 @@
#define _stdfunction
#ifdef _APPLE
#if defined(__BIG_ENDIAN__) && !defined(BIG_ENDIAN)
#define BIG_ENDIAN
#undef LITTLE_ENDIAN
#endif
#if defined(__i386__) && !defined(LITTLE_ENDIAN)
#define LITTLE_ENDIAN
#undef BIG_ENDIAN
#endif
#ifndef BIG_ENDIAN
#define BIG_ENDIAN
#endif
#ifdef LITTLE_ENDIAN
#undef LITTLE_ENDIAN
#endif
#endif
#if defined(__sparc) || defined(sparc) || defined(__hpux)
+4 -6
View File
@@ -14,17 +14,15 @@ int main(int argc, char *argv[])
#ifdef _UNIX
setlocale(LC_ALL,"");
#endif
#if defined(_EMX) && !defined(_DJGPP)
uni_init(0);
#endif
#if !defined(_SFX_RTL_) && !defined(_WIN_32)
#ifndef SFX_MODULE
setbuf(stdout,NULL);
#endif
#if !defined(SFX_MODULE) && defined(_EMX)
EnumConfigPaths(argv[0],-1);
#ifdef _EMX
EnumConfigPaths(argv[0],-1);
#endif
#endif
ErrHandler.SetSignalHandlers(true);
+2
View File
@@ -175,7 +175,9 @@ void ComprDataIO::ShowUnpRead(Int64 ArcPos,Int64 ArcSize)
int CurPercent=ToPercent(ArcPos,ArcSize);
if (!Cmd->DisablePercentage && CurPercent!=LastPercent)
{
#ifndef GUI
mprintf("\b\b\b\b%3d%%",CurPercent);
#endif
LastPercent=CurPercent;
}
}
+3 -3
View File
@@ -253,12 +253,12 @@ bool RecVolumes::Restore(RAROptions *Cmd,const char *Name,
if (MissingVolumes>FoundRecVolumes)
{
#ifndef SILENT
#if !defined(SILENT) && !defined(GUI)
mprintf(St(MRecVolCannotFix));
#endif
return(false);
}
#ifndef SILENT
#if !defined(SILENT) && !defined(GUI)
mprintf(St(MReconstructing));
#endif
@@ -298,7 +298,7 @@ bool RecVolumes::Restore(RAROptions *Cmd,const char *Name,
}
if (MaxRead==0)
break;
#ifndef SILENT
#if !defined(SILENT) && !defined(GUI)
int CurPercent=ToPercent(ProcessedSize,RecFileSize);
if (!Cmd->DisablePercentage && CurPercent!=LastPercent)
{
+1 -1
View File
@@ -207,7 +207,7 @@ unsigned char finalcount[8];
finalcount[i] = (unsigned char)((context->count[(i >= 4 ? 0 : 1)]
>> ((3-(i & 3)) * 8) ) & 255); /* Endian independent */
}
unsigned char ch=(unsigned char)'\200';
unsigned char ch='\200';
hash_process(context, &ch, 1, handsoff);
while ((context->count[0] & 504) != 448) {
ch=0;
+2 -2
View File
@@ -15,7 +15,7 @@ bool WideToChar(const wchar *Src,char *Dest,int DestSize)
WideToUtf(Src,Dest,DestSize);
#else
#ifdef MBFUNCTIONS
if (wcstombs(Dest,Src,DestSize)==(size_t)-1)
if (wcstombs(Dest,Src,DestSize)==-1)
RetCode=false;
#else
if (UnicodeEnabled())
@@ -53,7 +53,7 @@ bool CharToWide(const char *Src,wchar *Dest,int DestSize)
UtfToWide(Src,Dest,DestSize);
#else
#ifdef MBFUNCTIONS
if (mbstowcs(Dest,Src,DestSize)==(size_t)-1)
if (mbstowcs(Dest,Src,DestSize)==-1)
RetCode=false;
#else
if (UnicodeEnabled())
+3 -3
View File
@@ -1,6 +1,6 @@
#define RARVER_MAJOR 3
#define RARVER_MINOR 60
#define RARVER_BETA 0
#define RARVER_DAY 5
#define RARVER_MONTH 8
#define RARVER_BETA 2
#define RARVER_DAY 18
#define RARVER_MONTH 4
#define RARVER_YEAR 2006
+2
View File
@@ -124,8 +124,10 @@ bool MergeArchive(Archive &Arc,ComprDataIO *DataIO,bool ShowFileName,char Comman
}
#endif
#ifndef GUI
if (Command=='T' || Command=='X' || Command=='E')
mprintf(St(Command=='T' ? MTestVol:MExtrVol),Arc.FileName);
#endif
if (SplitHeader)
Arc.SearchBlock(HeaderType);
else