Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package libretro-crocods for openSUSE:Factory checked in at 2021-09-20 23:32:37 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libretro-crocods (Old) and /work/SRC/openSUSE:Factory/.libretro-crocods.new.1899 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libretro-crocods" Mon Sep 20 23:32:37 2021 rev:3 rq:919813 version:0~git20210314 Changes: -------- --- /work/SRC/openSUSE:Factory/libretro-crocods/libretro-crocods.changes 2020-06-23 21:07:07.594333058 +0200 +++ /work/SRC/openSUSE:Factory/.libretro-crocods.new.1899/libretro-crocods.changes 2021-09-20 23:33:55.527230821 +0200 @@ -1,0 +2,15 @@ +Fri Sep 10 15:31:43 UTC 2021 - i...@guoyunhe.me + +- Update to version 0~git20210314: + * Add osx-arm64/tvos-arm64/ios-arm64 + * Update .gitlab-ci.yml + * Update .gitlab-ci.yml + * Update .gitlab-ci.yml + * Update .gitlab-ci.yml + * Update + * Update + * Update .gitlab-ci.yml + * Cleanups + * Add .gitlab-ci.yml + +------------------------------------------------------------------- Old: ---- libretro-crocods-0~git20200508.tar.xz New: ---- libretro-crocods-0~git20210314.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libretro-crocods.spec ++++++ --- /var/tmp/diff_new_pack.7fLjkD/_old 2021-09-20 23:33:55.983231385 +0200 +++ /var/tmp/diff_new_pack.7fLjkD/_new 2021-09-20 23:33:55.983231385 +0200 @@ -1,7 +1,7 @@ # # spec file for package libretro-crocods # -# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2021 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: libretro-crocods -Version: 0~git20200508 +Version: 0~git20210314 Release: 0 Summary: CrocoDS libretro core for Amstrad emulation License: MIT ++++++ _servicedata ++++++ --- /var/tmp/diff_new_pack.7fLjkD/_old 2021-09-20 23:33:56.039231454 +0200 +++ /var/tmp/diff_new_pack.7fLjkD/_new 2021-09-20 23:33:56.039231454 +0200 @@ -1,4 +1,4 @@ <servicedata> <service name="tar_scm"> <param name="url">https://github.com/libretro/libretro-crocods.git</param> - <param name="changesrevision">8d8443cd68093dab195e38973374159c8daefa96</param></service></servicedata> \ No newline at end of file + <param name="changesrevision">86eeccfb68ad6a1cb39ef5b008902f6636d7d194</param></service></servicedata> \ No newline at end of file ++++++ libretro-crocods-0~git20200508.tar.xz -> libretro-crocods-0~git20210314.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libretro-crocods-0~git20200508/.gitlab-ci.yml new/libretro-crocods-0~git20210314/.gitlab-ci.yml --- old/libretro-crocods-0~git20200508/.gitlab-ci.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/libretro-crocods-0~git20210314/.gitlab-ci.yml 2021-03-14 14:42:15.000000000 +0100 @@ -0,0 +1,215 @@ +# DESCRIPTION: GitLab CI/CD for libRetro (NOT FOR GitLab-proper) + +############################################################################## +################################# BOILERPLATE ################################ +############################################################################## + +# Core definitions +.core-defs: + variables: + JNI_PATH: . + CORENAME: crocods + +# Core definitions +include: + ################################## DESKTOPS ################################ + # Windows 64-bit + - project: 'libretro-infrastructure/ci-templates' + file: '/windows-x64-mingw.yml' + + # Windows 32-bit + - project: 'libretro-infrastructure/ci-templates' + file: '/windows-i686-mingw.yml' + + # Linux 64-bit + - project: 'libretro-infrastructure/ci-templates' + file: '/linux-x64.yml' + + # Linux 32-bit + - project: 'libretro-infrastructure/ci-templates' + file: '/linux-i686.yml' + + # MacOS 64-bit + - project: 'libretro-infrastructure/ci-templates' + file: '/osx-x64.yml' + + # MacOS ARM 64-bit + - project: 'libretro-infrastructure/ci-templates' + file: '/osx-arm64.yml' + + ################################## CELLULAR ################################ + # Android + - project: 'libretro-infrastructure/ci-templates' + file: '/android-jni.yml' + + # iOS + - project: 'libretro-infrastructure/ci-templates' + file: '/ios-arm64.yml' + + # iOS (armv7) + - project: 'libretro-infrastructure/ci-templates' + file: '/ios9.yml' + + ################################## CONSOLES ################################ + # Nintendo 3DS + - project: 'libretro-infrastructure/ci-templates' + file: '/ctr-static.yml' + + # Nintendo GameCube + - project: 'libretro-infrastructure/ci-templates' + file: '/ngc-static.yml' + + # Nintendo Wii + - project: 'libretro-infrastructure/ci-templates' + file: '/wii-static.yml' + + # Nintendo WiiU + - project: 'libretro-infrastructure/ci-templates' + file: '/wiiu-static.yml' + + # Nintendo Switch + - project: 'libretro-infrastructure/ci-templates' + file: '/libnx-static.yml' + + # PlayStation Portable + - project: 'libretro-infrastructure/ci-templates' + file: '/psp-static.yml' + + # PlayStation Vita + - project: 'libretro-infrastructure/ci-templates' + file: '/vita-static.yml' + + # tvOS (AppleTV) + - project: 'libretro-infrastructure/ci-templates' + file: '/tvos-arm64.yml' + + #################################### MISC ################################## + +# Stages for building +stages: + - build-prepare + - build-shared + - build-static + +################################### DESKTOPS ################################# +# Windows 64-bit +libretro-build-windows-x64: + extends: + - .libretro-windows-x64-mingw-make-default + - .core-defs + +# Windows 32-bit +libretro-build-windows-i686: + extends: + - .libretro-windows-i686-mingw-make-default + - .core-defs + +# Linux 64-bit +libretro-build-linux-x64: + extends: + - .libretro-linux-x64-make-default + - .core-defs + +# Linux 32-bit +libretro-build-linux-i686: + extends: + - .libretro-linux-i686-make-default + - .core-defs + +# MacOS 64-bit +libretro-build-osx-x64: + extends: + - .libretro-osx-x64-make-default + - .core-defs + +# MacOS ARM 64-bit +libretro-build-osx-arm64: + extends: + - .libretro-osx-arm64-make-default + - .core-defs + +################################### CELLULAR ################################# +# Android ARMv7a +android-armeabi-v7a: + extends: + - .libretro-android-jni-armeabi-v7a + - .core-defs + +# Android ARMv8a +android-arm64-v8a: + extends: + - .libretro-android-jni-arm64-v8a + - .core-defs + +# Android 64-bit x86 +android-x86_64: + extends: + - .libretro-android-jni-x86_64 + - .core-defs + +# Android 32-bit x86 +android-x86: + extends: + - .libretro-android-jni-x86 + - .core-defs + +# iOS +libretro-build-ios-arm64: + extends: + - .libretro-ios-arm64-make-default + - .core-defs + +# iOS (armv7) [iOS 9 and up] +libretro-build-ios9: + extends: + - .libretro-ios9-make-default + - .core-defs + +# tvOS +libretro-build-tvos-arm64: + extends: + - .libretro-tvos-arm64-make-default + - .core-defs + +################################### CONSOLES ################################# +# PlayStation Portable +libretro-build-psp: + extends: + - .libretro-psp-static-retroarch-master + - .core-defs + +# PlayStation Vita +libretro-build-vita: + extends: + - .libretro-vita-static-retroarch-master + - .core-defs + +# Nintendo 3DS +libretro-build-ctr: + extends: + - .libretro-ctr-static-retroarch-master + - .core-defs + +# Nintendo GameCube +libretro-build-ngc: + extends: + - .libretro-ngc-static-retroarch-master + - .core-defs + +# Nintendo Wii +libretro-build-wii: + extends: + - .libretro-wii-static-retroarch-master + - .core-defs + +# Nintendo WiiU +libretro-build-wiiu: + extends: + - .libretro-wiiu-static-retroarch-master + - .core-defs + +# Nintendo Switch +libretro-build-libnx-aarch64: + extends: + - .libretro-libnx-static-retroarch-master + - .core-defs diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libretro-crocods-0~git20200508/Makefile new/libretro-crocods-0~git20210314/Makefile --- old/libretro-crocods-0~git20200508/Makefile 2020-05-08 06:46:20.000000000 +0200 +++ new/libretro-crocods-0~git20210314/Makefile 2021-03-14 14:42:15.000000000 +0100 @@ -24,6 +24,9 @@ ifeq ($(shell uname -p),powerpc) arch = ppc endif +ifeq ($(shell uname -p),arm) + arch = arm +endif else ifneq ($(findstring MINGW,$(shell uname -a)),) system_platform = win endif @@ -36,13 +39,6 @@ LIBM := -lm fpic= -ifeq ($(ARCHFLAGS),) -ifeq ($(archs),ppc) - ARCHFLAGS = -arch ppc -arch ppc64 -else - ARCHFLAGS = -arch x86_64 -endif -endif ifeq ($(STATIC_LINKING),1) EXT=a @@ -64,33 +60,58 @@ SHARED := -shared -Wl,--no-undefined LIBM := else ifeq ($(platform), osx) - EXT?=dylib + EXT?=dylib TARGET := $(TARGET_NAME)_libretro.$(EXT) fpic := -fPIC SHARED := -dynamiclib + +ifeq ($(UNIVERSAL),1) +ifeq ($(archs),ppc) + ARCHFLAGS = -arch ppc -arch ppc64 +else ifeq ($(archs),arm64) + ARCHFLAGS = -arch x86_64 -arch arm64 +else + ARCHFLAGS = -arch x86_64 +endif +endif + + ifeq ($(CROSS_COMPILE),1) + TARGET_RULE = -target $(LIBRETRO_APPLE_PLATFORM) -isysroot $(LIBRETRO_APPLE_ISYSROOT) + CFLAGS += $(TARGET_RULE) + CPPFLAGS += $(TARGET_RULE) + CXXFLAGS += $(TARGET_RULE) + LDFLAGS += $(TARGET_RULE) + endif + + CFLAGS += $(ARCHFLAGS) + CXXFLAGS += $(ARCHFLAGS) + LDFLAGS += $(ARCHFLAGS) + + # iOS else ifneq (,$(findstring ios,$(platform))) - EXT?=dylib + EXT?=dylib TARGET := $(TARGET_NAME)_libretro_ios.$(EXT) fpic := -fPIC SHARED := -dynamiclib DEFINES := -DIOS + MINVERSION := ifeq ($(IOSSDK),) IOSSDK := $(shell xcodebuild -version -sdk iphoneos Path) endif ifeq ($(platform),ios-arm64) - CC = cc -arch arm64 -isysroot $(IOSSDK) + CC = cc -arch arm64 -isysroot $(IOSSDK) else - CC = cc -arch armv7 -isysroot $(IOSSDK) + CC = cc -arch armv7 -isysroot $(IOSSDK) endif ifeq ($(platform),$(filter $(platform),ios9 ios-arm64)) - SHARED += -miphoneos-version-min=8.0 - CC += -miphoneos-version-min=8.0 + MINVERSION = -miphoneos-version-min=8.0 else - SHARED += -miphoneos-version-min=5.0 - CC += -miphoneos-version-min=5.0 + MINVERSION = -miphoneos-version-min=5.0 endif + SHARED += $(MINVERSION) + else ifeq ($(platform), tvos-arm64) EXT?=dylib TARGET := $(TARGET_NAME)_libretro_tvos.$(EXT) @@ -102,6 +123,8 @@ IOSSDK := $(shell xcodebuild -version -sdk appletvos Path) endif + CC = cc -arch arm64 -isysroot $(IOSSDK) + else ifeq ($(platform), theos_ios) # Theos iOS DEPLOYMENT_IOSVERSION = 5.0 @@ -155,26 +178,6 @@ TARGET := $(TARGET_NAME)_libretro_$(platform).$(EXT) STATIC_LINKING = 1 -# PS3 -else ifeq ($(platform), ps3) - EXT=a - TARGET := $(TARGET_NAME)_libretro_$(platform).$(EXT) - CC = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-gcc.exe - CC_AS = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-gcc.exe - AR = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-ar.exe - PLATFORM_DEFINES := -D__CELLOS_LV2__ - STATIC_LINKING = 1 - -# sncps3 -else ifeq ($(platform), sncps3) - EXT=a - TARGET := $(TARGET_NAME)_libretro_ps3.$(EXT) - CC = $(CELL_SDK)/host-win32/sn/bin/ps3ppusnc.exe - CC_AS = $(CELL_SDK)/host-win32/sn/bin/ps3ppusnc.exe - AR = $(CELL_SDK)/host-win32/sn/bin/ps3snarl.exe - PLATFORM_DEFINES := -D__CELLOS_LV2__ - STATIC_LINKING = 1 - # Lightweight PS3 Homebrew SDK else ifeq ($(platform), psl1ght) EXT=a @@ -182,7 +185,7 @@ CC = $(PS3DEV)/ppu/bin/ppu-gcc$(EXE_EXT) CC_AS = $(PS3DEV)/ppu/bin/ppu-gcc$(EXE_EXT) AR = $(PS3DEV)/ppu/bin/ppu-ar$(EXE_EXT) - PLATFORM_DEFINES := -D__CELLOS_LV2__ -D__PSL1GHT__ + PLATFORM_DEFINES := -D__PSL1GHT__ STATIC_LINKING = 1 # PSP diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libretro-crocods-0~git20200508/deps/ziptool.c new/libretro-crocods-0~git20210314/deps/ziptool.c --- old/libretro-crocods-0~git20200508/deps/ziptool.c 2020-05-08 06:46:20.000000000 +0200 +++ new/libretro-crocods-0~git20210314/deps/ziptool.c 2021-03-14 14:42:15.000000000 +0100 @@ -2,6 +2,7 @@ #include <stdlib.h> #include <stdint.h> #include <string.h> +#include <ctype.h> #include "libz/zlib.h" #include "ziptool.h" @@ -157,54 +158,42 @@ static int MyComp( const char* str1, const char* str2); -inline char tolower(const char toLower) -{ - if ((toLower >= 'A') && (toLower <= 'Z')) - return (char)(toLower + 0x20); - - return toLower; -} - int MyComp( const char* str1, const char* str2) { - int i; - - i=0; - - while(1) { - int c1,c2; + int i; - c1=str1[i]; - c2=str2[i]; + i=0; - if ((c1==0) && (c2==0)) { - return 0; - } + while(1) + { + int c1=str1[i]; + int c2=str2[i]; - c1=tolower(c1); - c2=tolower(c2); + if ((c1==0) && (c2==0)) + return 0; - if (c1=='\\') c1='/'; - if (c2=='\\') c2='/'; + c1=tolower(c1); + c2=tolower(c2); - if (c1>c2) { - return 1; - } - if (c1<c2) { - return -1; - } - i++; - } + if (c1=='\\') + c1='/'; + if (c2=='\\') + c2='/'; + + if (c1>c2) + return 1; + if (c1<c2) + return -1; + i++; + } - return -1; + return -1; } int compare( const void *arg1, const void *arg2 ) { - struct zipdir *alb1, *alb2; - - alb1=(struct zipdir*)arg1; - alb2=(struct zipdir*)arg2; + struct zipdir *alb1=(struct zipdir*)arg1; + struct zipdir *alb2=(struct zipdir*)arg2; return MyComp( alb1->name, alb2->name); } @@ -233,80 +222,74 @@ CZ->open=1; } - - - void ReadDir(struct CZipTool *CZ) { - int max=100; + int max=100; + struct ZipLocalHeader hdr; - if (CZ->zipnbrc!=-1) { - return; - } + if (CZ->zipnbrc!=-1) + return; - CZ->zipdirc=(struct zipdir*)malloc(sizeof(struct zipdir)*max); + CZ->zipdirc=(struct zipdir*)malloc(sizeof(struct zipdir)*max); - CZ->zipdirc=NULL; - CZ->zipnbrc=-1; + CZ->zipdirc=NULL; + CZ->zipnbrc=-1; - struct ZipLocalHeader hdr; - CZ->pzip=0; - CZ->pout=0; + CZ->pzip=0; + CZ->pout=0; - CZ->zipnbrc=0; + CZ->zipnbrc=0; - CZ->zipdirc=(struct zipdir*)malloc(sizeof(struct zipdir)*max); + CZ->zipdirc=(struct zipdir*)malloc(sizeof(struct zipdir)*max); - while(1) - { - int oldpos; + while(1) + { + int oldpos; - oldpos=CZ->pzip; + oldpos=CZ->pzip; - if (doHeader(CZ, &hdr)==0) break; - if (CZ->zipdirc==NULL) { - CZ->zipnbrc=0; - break; - } - CZ->zipdirc[CZ->zipnbrc].name = (char*)malloc(strlen(hdr.fnm)+1); - strcpy(CZ->zipdirc[CZ->zipnbrc].name, hdr.fnm); - CZ->zipdirc[CZ->zipnbrc].position=oldpos; - - CZ->pzip = CZ->pzip + hdr.csz; - CZ->zipnbrc++; - - if (CZ->zipnbrc>=max) { - max+=100; - CZ->zipdirc=(struct zipdir*)realloc(CZ->zipdirc, sizeof(struct zipdir)*max); - } - } - - qsort(CZ->zipdirc, CZ->zipnbrc, sizeof(struct zipdir), compare); + if (doHeader(CZ, &hdr)==0) break; + if (CZ->zipdirc==NULL) { + CZ->zipnbrc=0; + break; + } + CZ->zipdirc[CZ->zipnbrc].name = (char*)malloc(strlen(hdr.fnm)+1); + strcpy(CZ->zipdirc[CZ->zipnbrc].name, hdr.fnm); + CZ->zipdirc[CZ->zipnbrc].position=oldpos; + + CZ->pzip = CZ->pzip + hdr.csz; + CZ->zipnbrc++; + + if (CZ->zipnbrc>=max) + { + max+=100; + CZ->zipdirc=(struct zipdir*)realloc(CZ->zipdirc, sizeof(struct zipdir)*max); + } + } - return; + qsort(CZ->zipdirc, CZ->zipnbrc, sizeof(struct zipdir), compare); } void CZipToolClean(struct CZipTool *CZ) { - if (CZ->common_buf != NULL) { - free(CZ->common_buf); - } - if (CZ->cached != NULL) { - free(CZ->cached); - } + if (CZ->common_buf) + free(CZ->common_buf); + if (CZ->cached) + free(CZ->cached); } int kgetc(struct CZipTool *CZ) { int a; - if (CZ->pzip<CZ->mzip) { + if (CZ->pzip<CZ->mzip) + { a=CZ->kzip[CZ->pzip]; CZ->pzip++; - } else { - a=EOF; } + else + a=EOF; return a; } @@ -314,9 +297,8 @@ int kread(struct CZipTool *CZ, unsigned char *dest, int count) { - if (CZ->pzip+count > CZ->mzip) { + if (CZ->pzip+count > CZ->mzip) count=CZ->mzip-CZ->pzip; - } memcpy(dest, CZ->kzip+CZ->pzip, count); CZ->pzip+=count; @@ -351,6 +333,7 @@ int fillbits( struct CZipTool *CZ, int n ) { + int c; unsigned char next; if( !zipread( CZ, &next,1 ) ) @@ -367,7 +350,7 @@ } } - int c = (int)(CZ->bitbuf & ((1<<n)-1)); + c = (int)(CZ->bitbuf & ((1<<n)-1)); CZ->bitbuf >>= n; CZ->bits_left -= n; return c; @@ -386,23 +369,21 @@ kwrite( CZ, dat, len); } - - void pathInit(struct CZipTool *CZ) { } - - void pathSplit( struct CZipTool *CZ, const char* path, int* y, int* d ) { - *y=-1, *d=-1; const char *x; + *y=-1, *d=-1; for( x=path; *x!='\0'; x++) { - if( *x=='\\' || *x=='/' ) *y=x-path,*d=-1; - else if( *x=='.' ) *d=x-path; + if( *x=='\\' || *x=='/' ) + *y=x-path,*d=-1; + else if( *x=='.' ) + *d=x-path; } } @@ -455,104 +436,102 @@ bool ReadFromZIP( struct CZipTool *CZ, char *filter, unsigned int *dsize, unsigned char **dBuffer) { + int i,j,k; struct ZipLocalHeader hdr; CZ->pzip=0; CZ->pout=0; - int i,j,k; - i=0; j=CZ->zipnbrc-1; k=0; - if (CZ->zipnbrc<=0) { + if (CZ->zipnbrc<=0) + { *dBuffer=NULL; *dsize=0; return 0; } - while(i<=j) { - k=(i+j)/2; - - if (!MyComp(CZ->zipdirc[k].name, filter)) { - break; - } - - if (MyComp(CZ->zipdirc[k].name, filter)>0) { - j=k-1; - } else { - i=k+1; - } - } - - if (!MyComp(CZ->zipdirc[k].name, filter)) { - CZ->pzip=CZ->zipdirc[k].position; - - doHeader(CZ, &hdr); + while(i<=j) + { + k=(i+j)/2; - CZ->kout=(unsigned char*)malloc(hdr.usz); - CZ->pout=0; - CZ->mout=0; // ?? + if (!MyComp(CZ->zipdirc[k].name, filter)) + break; - switch( hdr.mhd ) - { - case Stored: - Unstore( CZ, hdr.usz, hdr.csz ); - break; - case Deflated: - Inflate( CZ, hdr.usz, hdr.csz ); - break; - case Shrunk: - Unshrink( CZ, hdr.usz, hdr.csz ); - break; - case Reduced1: - Unreduce( CZ, hdr.usz, hdr.csz, 1 ); - break; - case Reduced2: - Unreduce( CZ, hdr.usz, hdr.csz, 2 ); - break; - case Reduced3: - Unreduce( CZ, hdr.usz, hdr.csz, 3 ); - break; - case Reduced4: - Unreduce( CZ, hdr.usz, hdr.csz, 4 ); - break; - case Imploded: - Explode( CZ, hdr.usz, hdr.csz, 0!=(hdr.flg&0x02), 0!=((hdr.flg)&0x04) ); - break; - } + if (MyComp(CZ->zipdirc[k].name, filter)>0) + j=k-1; + else + i=k+1; + } - if (CZ->pout!=0) { - *dBuffer=CZ->kout; - *dsize=CZ->pout; - } else { - *dBuffer=NULL; - *dsize=0; - } + if (!MyComp(CZ->zipdirc[k].name, filter)) + { + CZ->pzip=CZ->zipdirc[k].position; + doHeader(CZ, &hdr); - } else { - *dBuffer=NULL; - *dsize=0; - return false; - } + CZ->kout=(unsigned char*)malloc(hdr.usz); + CZ->pout=0; + CZ->mout=0; // ?? + + switch( hdr.mhd ) + { + case Stored: + Unstore( CZ, hdr.usz, hdr.csz ); + break; + case Deflated: + Inflate( CZ, hdr.usz, hdr.csz ); + break; + case Shrunk: + Unshrink( CZ, hdr.usz, hdr.csz ); + break; + case Reduced1: + Unreduce( CZ, hdr.usz, hdr.csz, 1 ); + break; + case Reduced2: + Unreduce( CZ, hdr.usz, hdr.csz, 2 ); + break; + case Reduced3: + Unreduce( CZ, hdr.usz, hdr.csz, 3 ); + break; + case Reduced4: + Unreduce( CZ, hdr.usz, hdr.csz, 4 ); + break; + case Imploded: + Explode( CZ, hdr.usz, hdr.csz, + 0!=(hdr.flg&0x02), 0!=((hdr.flg)&0x04) ); + break; + } + + if (CZ->pout!=0) + { + *dBuffer=CZ->kout; + *dsize=CZ->pout; + } + else + { + *dBuffer=NULL; + *dsize=0; + } + } + else + { + *dBuffer=NULL; + *dsize=0; + return false; + } return true; } - - - - - bool read_header( struct CZipTool *CZ, struct ZipLocalHeader* hdr) { - if( 26 != kread(CZ, CZ->common_buf, 26) ) { + if( 26 != kread(CZ, CZ->common_buf, 26) ) return false; - } hdr->ver = ((CZ->common_buf[ 0])|(CZ->common_buf[ 1]<<8)); hdr->flg = ((CZ->common_buf[ 2])|(CZ->common_buf[ 3]<<8)); @@ -565,22 +544,18 @@ hdr->fnl = ((CZ->common_buf[22])|(CZ->common_buf[23]<<8)); // Longueur du filename hdr->exl = ((CZ->common_buf[24])|(CZ->common_buf[25]<<8)); - if (hdr->fnl>=256) { + if (hdr->fnl>=256) return false; - } - if( hdr->fnl!=kread(CZ, (unsigned char*)hdr->fnm, hdr->fnl) ) { // common_buf <- filename + if( hdr->fnl!=kread(CZ, (unsigned char*)hdr->fnm, hdr->fnl) ) // common_buf <- filename return false; - } hdr->fnm[hdr->fnl]=0; - if( hdr->mhd > Deflated || hdr->mhd==Tokenized ) { + if( hdr->mhd > Deflated || hdr->mhd==Tokenized ) return false; - } - if ((hdr->exl!=0) && (hdr->exl != kread(CZ, CZ->common_buf, hdr->exl)) ) { + if ((hdr->exl!=0) && (hdr->exl != kread(CZ, CZ->common_buf, hdr->exl)) ) return false; - } return true; } @@ -591,13 +566,12 @@ kread(CZ, key, 4); - if ( (key[0]=='P') && (key[1]=='K') && (key[2]==0x03) && (key[3]==0x04) ) { - int x=CZ->pzip; - if (read_header(CZ, hdr)) { - return true; - } - CZ->pzip = x; - } + if ( (key[0]=='P') && (key[1]=='K') && (key[2]==0x03) && (key[3]==0x04) ) { + int x=CZ->pzip; + if (read_header(CZ, hdr)) + return true; + CZ->pzip = x; + } return false; } @@ -725,7 +699,6 @@ for( code=(1<<13); code > 255; code-- ) prefix_of[code] = -1; for( code=0; code <256; code++ ) - // for( code=255; code >= 0; code-- ) { prefix_of[code] = 0; suffix_of[code] = code;