2000-08-04 09:20 GMT+2 Maurilio Longo <maurilio.longo@libero.it>
This commit is contained in:
@@ -1,3 +1,8 @@
|
||||
2000-08-04 09:20 GMT+2 Maurilio Longo <maurilio.longo@libero.it>
|
||||
* contrib/hbzlib/zlibapi1.c
|
||||
* contrib/hbzlib/zipfile2.c
|
||||
+ added #include <hbsetup.h> and logic to identify OS/2 GCC
|
||||
|
||||
2000-08-03 18:50 UTC+0800 Ron Pinkas <ron@profit-master.com>
|
||||
* source/compiler/harbour.c
|
||||
* Added call to hb_pp_init() between multiple prg compilations.
|
||||
|
||||
@@ -33,6 +33,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <hbsetup.h>
|
||||
|
||||
#include "hbzip.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@@ -40,7 +42,8 @@
|
||||
#include <time.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#ifdef HB_OS_UNIX
|
||||
|
||||
#if defined(HB_OS_UNIX) || defined(HARBOUR_GCC_OS2)
|
||||
# include <unistd.h>
|
||||
# include <utime.h>
|
||||
# include <sys/types.h>
|
||||
@@ -63,7 +66,7 @@ void hb____ChangeFileDate(char *filename,uLong dosdate,tm_unz tmu_date)
|
||||
#if defined(HB_OS_WIN_32)
|
||||
HANDLE hFile;
|
||||
FILETIME ftm,ftLocal,ftCreate,ftLastAcc,ftLastWrite;
|
||||
HB_SYMBOL_UNUSED(tmu_date);
|
||||
HB_SYMBOL_UNUSED(tmu_date);
|
||||
hFile = CreateFile(filename,GENERIC_READ | GENERIC_WRITE,
|
||||
0,NULL,OPEN_EXISTING,0,NULL);
|
||||
GetFileTime(hFile,&ftCreate,&ftLastAcc,&ftLastWrite);
|
||||
@@ -71,7 +74,7 @@ void hb____ChangeFileDate(char *filename,uLong dosdate,tm_unz tmu_date)
|
||||
LocalFileTimeToFileTime(&ftLocal,&ftm);
|
||||
SetFileTime(hFile,&ftm,&ftLastAcc,&ftm);
|
||||
CloseHandle(hFile);
|
||||
#elif defined(HB_OS_UNIX)
|
||||
#elif defined(HB_OS_UNIX) || defined(HARBOUR_GCC_OS2)
|
||||
struct utimbuf ut;
|
||||
struct tm newdate;
|
||||
newdate.tm_sec = tmu_date.tm_sec;
|
||||
@@ -98,14 +101,14 @@ int hb___MakeDir(char *szNewDirectory)
|
||||
{
|
||||
char *szBuffer ;
|
||||
char *szTemp;
|
||||
int uiLen = strlen(szNewDirectory);
|
||||
int uiLen = strlen(szNewDirectory);
|
||||
|
||||
if (uiLen <= 0)
|
||||
if (uiLen <= 0)
|
||||
return 0;
|
||||
|
||||
szBuffer = (void*)hb_xalloc(uiLen+1);
|
||||
strcpy(szBuffer,szNewDirectory);
|
||||
|
||||
|
||||
if (szBuffer[uiLen-1] == '/') {
|
||||
szBuffer[uiLen-1] = '\0';
|
||||
}
|
||||
@@ -294,12 +297,12 @@ int hb___ExtractCurrentFile(unzFile szUnzipFile,BOOL popt_extract_without_path,B
|
||||
if ((popt_extract_without_path)) {
|
||||
|
||||
write_filename = filename_inzip;
|
||||
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
|
||||
write_filename = filename_withoutpath;
|
||||
|
||||
|
||||
}
|
||||
if(pBlock !=NULL){
|
||||
|
||||
@@ -324,7 +327,7 @@ int hb___ExtractCurrentFile(unzFile szUnzipFile,BOOL popt_extract_without_path,B
|
||||
|
||||
|
||||
/* some zipfile don't contain directory alone before file */
|
||||
if ((nFileHandle==-1) && ((popt_extract_without_path)) &&
|
||||
if ((nFileHandle==-1) && ((popt_extract_without_path)) &&
|
||||
(filename_withoutpath!=(char*)filename_inzip))
|
||||
{
|
||||
char c=*(filename_withoutpath-1);
|
||||
@@ -360,7 +363,7 @@ int hb___ExtractCurrentFile(unzFile szUnzipFile,BOOL popt_extract_without_path,B
|
||||
while (err>0);
|
||||
|
||||
hb_fsClose(nFileHandle);
|
||||
if (err==0)
|
||||
if (err==0)
|
||||
hb____ChangeFileDate(write_filename,file_info.dosDate,
|
||||
file_info.tmu_date);
|
||||
}
|
||||
@@ -374,7 +377,7 @@ int hb___ExtractCurrentFile(unzFile szUnzipFile,BOOL popt_extract_without_path,B
|
||||
}
|
||||
}
|
||||
else
|
||||
unzCloseCurrentFile(szUnzipFile); /* don't lose the error */
|
||||
unzCloseCurrentFile(szUnzipFile); /* don't lose the error */
|
||||
}
|
||||
|
||||
hb_xfree((void*)szBuffer);
|
||||
@@ -449,7 +452,7 @@ PHB_ITEM hb___GetFilesNamesFromZip(char *szFile,BOOL iMode)
|
||||
szUnzipFile = unzOpen(szFilename_Try);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (szUnzipFile==NULL)
|
||||
{
|
||||
exit(1);
|
||||
@@ -539,7 +542,7 @@ PHB_ITEM hb___GetFilesNamesFromZip(char *szFile,BOOL iMode)
|
||||
hb_itemArrayPut(pTempArray,Crc32,pItem);
|
||||
hb_itemRelease(pItem);
|
||||
pItem=hb_itemPutD(NULL, (long)file_info.tmu_date.tm_year ,(long)file_info.tmu_date.tm_mon + 1,(long)file_info.tmu_date.tm_mday);
|
||||
hb_itemArrayPut(pTempArray,Date,pItem);
|
||||
hb_itemArrayPut(pTempArray,Date,pItem);
|
||||
hb_itemRelease(pItem);
|
||||
hb_____GetTime(file_info);
|
||||
iLen=strlen(szTempTime);
|
||||
@@ -584,14 +587,14 @@ void hb_____GetTime(unz_file_info file_info)
|
||||
|
||||
struct tm t;
|
||||
|
||||
t.tm_sec = file_info.tmu_date.tm_sec;
|
||||
t.tm_min = file_info.tmu_date.tm_min;
|
||||
t.tm_hour = file_info.tmu_date.tm_hour;
|
||||
t.tm_mday = file_info.tmu_date.tm_mday;
|
||||
t.tm_mon = file_info.tmu_date.tm_mon;
|
||||
t.tm_year = file_info.tmu_date.tm_year;
|
||||
t.tm_wday = 4;
|
||||
t.tm_yday = 0;
|
||||
t.tm_isdst = 0;
|
||||
t.tm_sec = file_info.tmu_date.tm_sec;
|
||||
t.tm_min = file_info.tmu_date.tm_min;
|
||||
t.tm_hour = file_info.tmu_date.tm_hour;
|
||||
t.tm_mday = file_info.tmu_date.tm_mday;
|
||||
t.tm_mon = file_info.tmu_date.tm_mon;
|
||||
t.tm_year = file_info.tmu_date.tm_year;
|
||||
t.tm_wday = 4;
|
||||
t.tm_yday = 0;
|
||||
t.tm_isdst = 0;
|
||||
strcpy(szTempTime, asctime(&t));
|
||||
}
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
*/
|
||||
|
||||
|
||||
#include <hbsetup.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@@ -42,7 +43,7 @@
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#ifdef HB_OS_UNIX
|
||||
#if defined(HB_OS_UNIX) || defined(HARBOUR_GCC_OS2)
|
||||
# include <unistd.h>
|
||||
# include <utime.h>
|
||||
# include <sys/types.h>
|
||||
@@ -91,7 +92,7 @@ uLong hb___filetime(char *f, tm_zip *tmzip, uLong *dt)
|
||||
struct stat s; /* results of stat() */
|
||||
struct tm* filedate;
|
||||
time_t tm_t=0;
|
||||
|
||||
|
||||
if (strcmp(f,"-")!=0)
|
||||
{
|
||||
char name[MAXFILENAME];
|
||||
@@ -221,7 +222,7 @@ int hb___CompressOneFile(char *szFile,char *szFiletoCompress,int iCompLevel,PHB_
|
||||
/* printf("error in writing %s in the zipfile\n",
|
||||
filenameinzip);*/
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
} while ((err == ZIP_OK) && (size_read>0));
|
||||
|
||||
@@ -229,7 +230,7 @@ int hb___CompressOneFile(char *szFile,char *szFiletoCompress,int iCompLevel,PHB_
|
||||
if (err<0)
|
||||
err=ZIP_ERRNO;
|
||||
else
|
||||
{
|
||||
{
|
||||
err = zipCloseFileInZip(szZipFile);
|
||||
if (err!=ZIP_OK)
|
||||
return err;
|
||||
@@ -238,7 +239,7 @@ int hb___CompressOneFile(char *szFile,char *szFiletoCompress,int iCompLevel,PHB_
|
||||
errclose = zipClose(szZipFile,NULL);
|
||||
if (errclose != ZIP_OK)
|
||||
return errclose;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -275,7 +276,7 @@ int hb___CompressMultipleFile(char *szFile,PHB_ITEM pArray,int iCompLevel,PHB_
|
||||
|
||||
for (uiCount=1;(uiCount<= hb_arrayLen(pArray)) && (err==ZIP_OK);uiCount++)
|
||||
{
|
||||
|
||||
|
||||
FHANDLE nFileHandle;
|
||||
int size_read;
|
||||
zip_fileinfo szZipFileInfo;
|
||||
@@ -305,7 +306,7 @@ int hb___CompressMultipleFile(char *szFile,PHB_ITEM pArray,int iCompLevel,PHB_
|
||||
if (err == ZIP_OK) {
|
||||
|
||||
nFileHandle = hb_fsOpen((char*) filenameinzip,FO_READ+FO_COMPAT);
|
||||
|
||||
|
||||
if (nFileHandle==NULL)
|
||||
{
|
||||
err=ZIP_ERRNO;
|
||||
@@ -334,7 +335,7 @@ int hb___CompressMultipleFile(char *szFile,PHB_ITEM pArray,int iCompLevel,PHB_
|
||||
if (err<0)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
} while ((err == ZIP_OK) && (size_read>0));
|
||||
|
||||
@@ -343,7 +344,7 @@ int hb___CompressMultipleFile(char *szFile,PHB_ITEM pArray,int iCompLevel,PHB_
|
||||
{
|
||||
err=ZIP_ERRNO;
|
||||
}
|
||||
else {
|
||||
else {
|
||||
err = zipCloseFileInZip(szZipFile);
|
||||
if (err!=ZIP_OK){
|
||||
/* printf("error in closing %s in the zipfile\n",
|
||||
|
||||
Reference in New Issue
Block a user