view release on metacpan or search on metacpan
unzip-6.0/INSTALL view on Meta::CPAN
UNICODE_SUPPORT
Enable restoring from UTF-8 encoded paths. These paths are stored
in extra fields in a backward-compatible way so that archives with
UTF-8 paths still work on zips and unzips that don't support Unicode.
This support follows the recent additions to the PKWare AppNote for
Unicode support, except that Unicode comments on systems where UTF-8
is not the current character set is not implemented in this release.
Internally, Unicode support can be achieved by three methods:
a) The charset encoding used by the system is already UTF-8, so
the program just has to select the UTF-8 versions of the stored
filenames for file name handling.
This method is enabled by setting the symbol UTF8_MAYBE_NATIVE;
this activates code to check for native UTF-8 encoding in the
locale settings.
b) The operating system and the compilation environment support
"wide character" data in Unicode encoding (UCS-2/UTF-16 or UCS-4),
which are used to translate between UTF-8 and the native
extended-ASCII character encoding.
The code for this method is activated by setting the preprocessor
unzip-6.0/INSTALL view on Meta::CPAN
The option NO_SETLOCALE allows to disable the dependency on <locale.h>
and setlocale() on systems where this assumption is invalid (and the
auto-configuring make target "generic" cannot be used for capabilities
detection).
_MBCS
NO_MBCS
Enable multi-byte character set support. This is the default for the
Human68k system (originated from Japan) and for Win32 (here only DBCS
"double-byte character set" support). The MBCS support should also be
enabled on systems which are capable of using UTF-8 as native charset.
For MBCS support, the C runtime library must supply implementations
for the mblen() function and the MB_CUR_MAX runtime macro/function.
The NO_MBCS symbol allows to explicitely disable MBCS support for
testing purpose, or when MBCS support does not work as expected.
HAVE_WORKING_ISPRINT
NO_WORKING_ISPRINT
The symbol HAVE_WORKING_ISPRINT enables enhanced non-printable chars
filtering for filenames in the fnfilter() function. On some systems
(Unix, VMS, some Win32 compilers), this setting is enabled by default.
unzip-6.0/README view on Meta::CPAN
- new BSD-like LICENSE
- new Novell Netware NLM port
- supports extraction of archives with more than 64k entries
- attribute handling of VMS port was broken in UnZip 5.4
- decryption support integrated in the main source distribution
The 5.4 release adds new ports, again. Other important items are changes
to the listing format, new supplemental features and several bug fixes
(especially concerning time-stamp handling...):
- new IBM OS/390 port, a UNIX derivate (POSIX with EBCDIC charset)
- complete revision of the MacOS port
- changed listing formats to enlarge the file size fields for more digits
- added capability to restore directory attributes on MSDOS, OS/2, WIN32
- enabled support of symbolic links on BeOS
- Unix: optional Acorn filetype support, useful for volumes exported via NFS
- several changes/additions to the DLL API
- GUI SFX stub for Win16 (Windows 3.1) and Win32 (Windows 9x, Windows NT)
- new free GCC compiler environments supported on WIN32
- many time-zone handling bug fixes for WIN32, AMIGA, ...
unzip-6.0/crypt.c view on Meta::CPAN
char *key_translated;
/* On systems with "obscure" native character coding (e.g., EBCDIC),
* the first test translates the password to the "main standard"
* character coding. */
#ifdef STR_TO_CP1
/* allocate buffer for translated password */
if ((key_translated = malloc(strlen(GLOBAL(key)) + 1)) == (char *)NULL)
return -1;
/* first try, test password translated "standard" charset */
r = testkey(__G__ h, STR_TO_CP1(key_translated, GLOBAL(key)));
#else /* !STR_TO_CP1 */
/* first try, test password as supplied on the extractor's host */
r = testkey(__G__ h, GLOBAL(key));
#endif /* ?STR_TO_CP1 */
#ifdef STR_TO_CP2
if (r != 0) {
#ifndef STR_TO_CP1
/* now prepare for second (and maybe third) test with translated pwd */
if ((key_translated = malloc(strlen(GLOBAL(key)) + 1)) == (char *)NULL)
return -1;
#endif
/* second try, password translated to alternate ("standard") charset */
r = testkey(__G__ h, STR_TO_CP2(key_translated, GLOBAL(key)));
#ifdef STR_TO_CP3
if (r != 0)
/* third try, password translated to another "standard" charset */
r = testkey(__G__ h, STR_TO_CP3(key_translated, GLOBAL(key)));
#endif
#ifndef STR_TO_CP1
free(key_translated);
#endif
}
#endif /* STR_TO_CP2 */
#ifdef STR_TO_CP1
free(key_translated);
unzip-6.0/extract.c view on Meta::CPAN
strcpy((char *)se, "...");
} else {
*s = '\0';
}
#ifdef WINDLL
INTERN_TO_ISO((char *)space, (char *)space); /* translate to ANSI */
#else
#if (defined(WIN32) && !defined(_WIN32_WCE))
/* Win9x console always uses OEM character coding, and
WinNT console is set to OEM charset by default, too */
INTERN_TO_OEM((char *)space, (char *)space);
#endif /* (WIN32 && !_WIN32_WCE) */
#endif /* ?WINDLL */
return (char *)space;
#else /* NATIVE: EBCDIC or whatever */
return (char *)raw;
#endif
unzip-6.0/fileio.c view on Meta::CPAN
G.autorun_command[block_len] = '\0';
A_TO_N(G.autorun_command);
eol = strchr(G.autorun_command, '\n');
if (!eol)
eol = G.autorun_command + strlen(G.autorun_command) - 1;
length -= eol + 1 - G.autorun_command;
while (eol >= G.autorun_command && isspace(*eol))
*eol-- = '\0';
#if (defined(WIN32) && !defined(_WIN32_WCE))
/* Win9x console always uses OEM character coding, and
WinNT console is set to OEM charset by default, too */
INTERN_TO_OEM(G.autorun_command, G.autorun_command);
#endif /* (WIN32 && !_WIN32_WCE) */
}
}
if (option == CHECK_AUTORUN_Q) /* don't display the remainder */
length = 0;
/* seek to beginning of remaining part of comment -- rewind if */
/* displaying entire comment, or skip to end if discarding it */
seek_zipf(__G__ G.cur_zipfile_bufstart - G.extra_bytes +
(G.inptr - G.inbuf) + comment_bytes_left - length);
unzip-6.0/fileio.c view on Meta::CPAN
while (*p) {
while (*p == CR)
++p;
*q++ = *p++;
}
/* could check whether (p - outbuf) == block_len here */
*q = '\0';
if (option == DISPL_8) {
/* translate the text coded in the entry's host-dependent
"extended ASCII" charset into the compiler's (system's)
internal text code page */
Ext_ASCII_TO_Native((char *)G.outbuf, G.pInfo->hostnum,
G.pInfo->hostver, G.pInfo->HasUxAtt,
FALSE);
#ifdef WINDLL
/* translate to ANSI (RTL internal codepage may be OEM) */
INTERN_TO_ISO((char *)G.outbuf, (char *)G.outbuf);
#else /* !WINDLL */
#if (defined(WIN32) && !defined(_WIN32_WCE))
/* Win9x console always uses OEM character coding, and
WinNT console is set to OEM charset by default, too */
INTERN_TO_OEM((char *)G.outbuf, (char *)G.outbuf);
#endif /* (WIN32 && !_WIN32_WCE) */
#endif /* ?WINDLL */
} else {
A_TO_N(G.outbuf); /* translate string to native */
}
#ifdef WINDLL
/* ran out of local mem -- had to cheat */
win_fprintf((zvoid *)&G, stdout, (extent)(q-G.outbuf),
unzip-6.0/globals.h view on Meta::CPAN
uch *outptr;
ulg outcnt; /* number of chars stored in outbuf */
#ifndef FUNZIP
char filename[FILNAMSIZ]; /* also used by NT for temporary SFX path */
#ifdef UNICODE_SUPPORT
char *filename_full; /* the full path so Unicode checks work */
extent fnfull_bufsize; /* size of allocated filename buffer */
int unicode_escape_all;
int unicode_mismatch;
#ifdef UTF8_MAYBE_NATIVE
int native_is_utf8; /* bool, TRUE => native charset == UTF-8 */
#endif
int unipath_version; /* version of Unicode field */
ulg unipath_checksum; /* Unicode field checksum */
char *unipath_filename; /* UTF-8 path */
#endif /* UNICODE_SUPPORT */
#ifdef CMS_MVS
char *tempfn; /* temp file used; erase on close */
#endif
unzip-6.0/macos/README.TXT view on Meta::CPAN
world.
Text encoding; Charsets of the Filenames:
-----------------------------------------
The following information is only important if you plan to
transfer archives across different platforms/language systems:
A typical Zip archive does not support different charsets.
All filenames stored in the public area (= accessible by
foreign systems other than MacOS) must be coded in the
charset ISO-8859-1 (CP1252 in the Microsoft Windows world)
or CP850 (DOSLatin1). The latter should only be used by Zip
programs that mark the archive entries as "created under
DOS". Apart from Macs, the commonly used platforms either
support ISO-8859-1 directly, or are compatible with it. To
achieve maximum compatibility, MacZip convert filenames from
the Mac OS Roman character set to ISO-8859-1 and vice versa.
But not every char of the charset MacRoman has their
equivalent in ISO-8859-1. To make the mapping in most cases
possible, I chose most similar chars or at least the MIDDLE
DOT.
Mac OS Roman character set is used for at least the
following Mac OS localizations: U.S., British, Canadian
French, French, Swiss French, German, Swiss German, Italian,
Swiss Italian, Dutch, Swedish, Norwegian, Danish, Finnish,
Spanish, Catalan, Portuguese, Brazilian, and the default
International system.
unzip-6.0/macos/README.TXT view on Meta::CPAN
Currently, the following Mac OS encodings are NOT supported:
Japanese, ChineseTrad, Korean, Arabic, Hebrew, Greek,
Cyrillic, Devanagari, Gurmukhi, Gujarati, Oriya, Bengali,
Tamil, Telugu Kannada, Malayalam, Sinhalese, Burmese, Khmer,
Thai, Laotian, Georgian, Armenian, ChineseSimp, Tibetan,
Mongolian, Ethiopic, Vietnamese, ExtArabic and finally:
Symbol - this is the encoding for the font named "Symbol".
Dingbats - this is the encoding for the font named "Zapf Dingbats".
If you extract an archive coded with one of these
charsets you will probably get filenames with funny
characters.
These problems apply only to filenames and NOT to the file
content.
of course: The content of the files will NEVER be converted !!
File-/Creator Type:
-------------
unzip-6.0/macos/source/charmap.h view on Meta::CPAN
Notes on Mac OS Roman:
----------------------
Mac OS Roman character set is used for at least the following Mac OS
localizations: U.S., British, Canadian French, French, Swiss
French, German, Swiss German, Italian, Swiss Italian, Dutch,
Swedish, Norwegian, Danish, Finnish, Spanish, Catalan,
Portuguese, Brazilian, and the default International system.
Not every char of the charset MacRoman has their equivalent
in Windows CodePage1252.
To make the mapping in most cases possible, I choosed
most similar chars or at least the BULLET. Chars that
do not have a direct match are marked with '***'
The Windows codepage 1252 contains the ISO 8859-1 "Latin 1" codepage,
with some additional printable characters in the range (0x80 - 0x9F),
that is reserved to control codes in the ISO 8859-1 character table.
In all Mac OS encodings, character codes 0x00-0x7F are identical to ASCII
unzip-6.0/macos/source/maccfg.h view on Meta::CPAN
#ifdef foreign
# undef foreign
#endif
#define foreign(c) ((c) & 0x80 ? MacRoman_to_WinCP1252[(c) & 0x7f] : (c))
#ifdef native
# undef native
#endif
#define native(c) ((c) & 0x80 ? WinCP1252_to_MacRoman[(c) & 0x7f] : (c))
#define NATIVE "MacRoman charset"
#ifdef _ISO_INTERN
# undef _ISO_INTERN
#endif
#define _ISO_INTERN(str1) {register uch *p;\
for (p=(uch *)(str1); *p; p++)\
*p = (*p & 0x80) ? WinCP1252_to_MacRoman[*p & 0x7f] : *p;}
#ifdef _OEM_INTERN
# undef _OEM_INTERN
unzip-6.0/msdos/doscfg.h view on Meta::CPAN
# define INTERN_TO_OEM(src, dst) {if ((src) != (dst)) strcpy((dst), (src));}
# endif
# define _OEM_INTERN(str1) OEM_TO_INTERN(str1, str1)
# define _ISO_INTERN(str1) ISO_TO_INTERN(str1, str1)
/* UzpPassword supplies ANSI-coded string regardless of C RTL's native CP */
# define STR_TO_CP2(dst, src) (AnsiToOem(src, dst), dst)
/* dummy defines to disable these functions, they are not needed */
# define STR_TO_ISO
# define STR_TO_OEM
#else
/* use home-brewed conversion functions; internal charset is OEM */
# ifdef CRTL_CP_IS_ISO
# undef CRTL_CP_IS_ISO
# endif
# ifndef CRTL_CP_IS_OEM
# define CRTL_CP_IS_OEM
# endif
#endif
#ifndef NEED_ISO_OEM_INIT
# define NEED_ISO_OEM_INIT
#endif
unzip-6.0/os2/os2cfg.h view on Meta::CPAN
#define isupper(x) IsUpperNLS((unsigned char)(x))
#define tolower(x) ToLowerNLS((unsigned char)(x))
#ifndef NO_STRNICMP /* use UnZip's zstrnicmp(), because some compilers */
# define NO_STRNICMP /* don't provide a NLS-aware strnicmp() function */
#endif
#define USETHREADID
/* handlers for OEM <--> ANSI string conversions */
#ifndef _OS2_ISO_ANSI
/* use home-brewed conversion functions; internal charset is OEM */
# ifdef CRTL_CP_IS_ISO
# undef CRTL_CP_IS_ISO
# endif
# ifndef CRTL_CP_IS_OEM
# define CRTL_CP_IS_OEM
# endif
#endif
/* screen size detection */
#define SCREENWIDTH 80
unzip-6.0/proginfo/extrafld.txt view on Meta::CPAN
field in the header. This is used to verify that the header
File Name field has not changed since the Unicode Path extra field
was created. This can happen if a utility renames the entry but
does not update the UTF-8 path extra field. If the CRC check fails,
this UTF-8 Path Extra Field should be ignored and the File Name field
in the header should be used instead.
The UnicodeName is the UTF-8 version of the contents of the File
Name field in the header, without any trailing NUL. The standard
name field in the Zip entry header remains filled with the entry
name coded in the local machine's extended ASCII system charset.
As UnicodeName is defined to be UTF-8, no UTF-8 byte order mark
(BOM) is used. The length of this field is determined by
subtracting the size of the previous fields from TSize.
If both the File Name and Comment fields are UTF-8, the new General
Purpose Bit Flag, bit 11 (Language encoding flag (EFS)), should be
used to indicate that both the header File Name and Comment fields
are UTF-8 and, in this case, the Unicode Path and Unicode Comment
extra fields are not needed and should not be created. Note that,
for backward compatibility, bit 11 should only be used if the native
character set of the paths and comments being zipped up are already
in UTF-8. The same method, either general purpose bit 11 or extra
fields, should be used in both the Local and Central Directory Header
for a file.
Utilisation rules:
1. This field shall never be created for names consisting solely of
7-bit ASCII characters.
2. On a system that already uses UTF-8 as system charset, this field
shall not repeat the string pattern already stored in the Zip
entry's standard name field. Instead, a field of exactly 9 bytes
(70 75 05 00 01 and 4 bytes CRC) should be created.
In this form with 5 data bytes, the field serves as indicator
for the UTF-8 encoding of the standard Zip header's name field.
3. This field shall not be used whenever the calculated CRC-32 of
the entry's standard name field does not match the provided
CRC checksum value. A mismatch of the CRC check indicates that
the standard name field was changed by some non-"up"-aware
utility without synchronizing this UTF-8 name e.f. block.
unzip-6.0/unix/configure view on Meta::CPAN
echo Check for prototypes
echo "int main(int argc, char *argv[]) { return 0; }" > conftest.c
$CC $CFLAGS -c conftest.c > /dev/null 2>/dev/null
[ $? -ne 0 ] && CFLAGSR="${CFLAGSR} -DNO_PROTO"
# const check currently handles mips cc and non ANSI compilers.
# does it need more ?
echo Check the handling of const
cat > conftest.c << _EOF_
typedef int charset[2];
int main()
{
const charset x;
const char *foo;
return 0;
}
_EOF_
$CC $CFLAGS -c conftest.c >/dev/null 2>/dev/null
[ $? -ne 0 ] && CFLAGSR="${CFLAGSR} -DNO_CONST"
echo Check for time_t
cat > conftest.c << _EOF_
#include <sys/types.h>
unzip-6.0/unix/configure view on Meta::CPAN
cat > conftest.c << _EOF_
#include <locale.h>
int main()
{
char *loc = setlocale(LC_CTYPE, "");
return 0;
}
_EOF_
$CC $CFLAGS -c conftest.c >/dev/null 2>/dev/null
if [ $? -eq 0 ]; then
echo "-- have setlocale, can check for charset type"
echo "-- - enabling UTF8-native support!"
CFLAGSR="${CFLAGSR} -DUNICODE_SUPPORT -DUTF8_MAYBE_NATIVE"
else
echo "-- no Unicode (UTF-8 native) support!"
CFLAGSR="${CFLAGSR} -DNO_SETLOCALE"
fi
# from configure 2.4i (Onno) 12/5/04
echo Check for gcc no-builtin flag
# -fno-builtin since version 2
unzip-6.0/unzip.c view on Meta::CPAN
static ZCONST char Far Use_Smith_Code[] =
"USE_SMITH_CODE (PKZIP 0.9x unreducing method supported)";
# endif
# ifdef USE_DEFLATE64
static ZCONST char Far Use_Deflate64[] =
"USE_DEFLATE64 (PKZIP 4.x Deflate64(tm) supported)";
# endif
# ifdef UNICODE_SUPPORT
# ifdef UTF8_MAYBE_NATIVE
# ifdef UNICODE_WCHAR
/* direct native UTF-8 check AND charset transform via wchar_t */
static ZCONST char Far Use_Unicode[] =
"UNICODE_SUPPORT [wide-chars, char coding: %s] (handle UTF-8 paths)";
# else
/* direct native UTF-8 check, only */
static ZCONST char Far Use_Unicode[] =
"UNICODE_SUPPORT [char coding: %s] (handle UTF-8 paths)";
# endif
static ZCONST char Far SysChUTF8[] = "UTF-8";
static ZCONST char Far SysChOther[] = "other";
# else /* !UTF8_MAYBE_NATIVE */
/* charset transform via wchar_t, no native UTF-8 support */
static ZCONST char Far Use_Unicode[] =
"UNICODE_SUPPORT [wide-chars] (handle UTF-8 paths)";
# endif /* ?UTF8_MAYBE_NATIVE */
# endif /* UNICODE_SUPPORT */
# ifdef _MBCS
static ZCONST char Far Have_MBCS_Support[] =
"MBCS-support (multibyte character support, MB_CUR_MAX = %u)";
# endif
# ifdef MULT_VOLUME
static ZCONST char Far Use_MultiVol[] =
unzip-6.0/unzpriv.h view on Meta::CPAN
# ifndef STR_TO_CP1
# define STR_TO_CP1 STR_TO_ISO
# endif
# ifndef STR_TO_CP2
# define STR_TO_CP2 STR_TO_OEM
# endif
# endif
#endif
/* Convert filename (and file comment string) into "internal" charset.
* This macro assumes that Zip entry filenames are coded in OEM (IBM DOS)
* codepage when made on
* -> DOS (this includes 16-bit Windows 3.1) (FS_FAT_)
* -> OS/2 (FS_HPFS_)
* -> Win95/WinNT with Nico Mak's WinZip (FS_NTFS_ && hostver == "5.0")
* EXCEPTIONS:
* PKZIP for Windows 2.5, 2.6, and 4.0 flag their entries as "FS_FAT_", but
* the filename stored in the local header is coded in Windows ANSI (CP 1252
* resp. ISO 8859-1 on US and western Europe locale settings).
* Likewise, PKZIP for UNIX 2.51 flags its entries as "FS_FAT_", but the
unzip-6.0/win32-experimental/unz60d10_w32wide-Unicode_patch.txt view on Meta::CPAN
+
@@ -1059,66 +1177,72 @@
unsigned ebSDlen;
#endif
+
+#if defined(UNICODE_SUPPORT) && defined(WIN32_WIDE)
+ if (!G.has_win32_wide) {
+#endif
#ifdef __RSXNT__ /* RSXNT/EMX C rtl uses OEM charset */
- char *ansi_name = (char *)alloca(strlen(G.filename) + 1);
+ char *ansi_name = (char *)alloca(strlen(G.filename) + 1);
- INTERN_TO_ISO(G.filename, ansi_name);
-# define Ansi_Fname ansi_name
+ INTERN_TO_ISO(G.filename, ansi_name);
+# define Ansi_Fname ansi_name
#else
-# define Ansi_Fname G.filename
+# define Ansi_Fname G.filename
unzip-6.0/win32/w32cfg.h view on Meta::CPAN
#if (defined(NTSD_EAS) && !defined(RESTORE_ACL))
# define RESTORE_ACL /* "restore ACLs" only needed when NTSD_EAS active */
#endif
#if (!defined(NO_UNICODE_SUPPORT) && !defined(UNICODE_SUPPORT))
# define UNICODE_SUPPORT /* enable UTF-8 filename support by default */
#endif
#if (defined(UNICODE_SUPPORT) && !defined(UNICODE_WCHAR))
# define UNICODE_WCHAR /* wchar_t is UTF-16 encoded on WIN32 */
#endif
#ifdef UTF8_MAYBE_NATIVE
# undef UTF8_MAYBE_NATIVE /* UTF-8 cannot be system charset on WIN32 */
#endif
/* The following compiler systems provide or use a runtime library with a
* locale-aware isprint() implementation. For these systems, the "enhanced"
* unprintable charcode detection in fnfilter() gets enabled.
*/
#if (!defined(HAVE_WORKING_ISPRINT) && !defined(NO_WORKING_ISPRINT))
# if defined(MSC) || defined(__BORLANDC__)
# define HAVE_WORKING_ISPRINT
# endif
unzip-6.0/win32/win32.c view on Meta::CPAN
{
FILETIME Modft; /* File time type defined in NT, `last modified' time */
FILETIME Accft; /* NT file time type, `last access' time */
FILETIME Creft; /* NT file time type, `file creation' time */
HANDLE hFile = INVALID_HANDLE_VALUE; /* File handle defined in NT */
int gotTime;
#ifdef NTSD_EAS
uch *ebSDptr;
unsigned ebSDlen;
#endif
#ifdef __RSXNT__ /* RSXNT/EMX C rtl uses OEM charset */
char *ansi_name = (char *)alloca(strlen(G.filename) + 1);
INTERN_TO_ISO(G.filename, ansi_name);
# define Ansi_Fname ansi_name
#else
# define Ansi_Fname G.filename
#endif
#ifndef __RSXNT__
if (IsWinNT()) {
unzip-6.0/win32/win32.c view on Meta::CPAN
HANDLE hFile = INVALID_HANDLE_VALUE; /* File handle defined in NT */
#ifdef __RSXNT__
char *ansi_name;
#endif
/* Win9x does not support setting directory time stamps. */
if (!IsWinNT())
return PK_OK;
errval = PK_OK;
#ifdef __RSXNT__ /* RSXNT/EMX C rtl uses OEM charset */
ansi_name = (char *)alloca(strlen(d->fn) + 1);
INTERN_TO_ISO(d->fn, ansi_name);
# define Ansi_Dirname ansi_name
#else
# define Ansi_Dirname d->fn
#endif
/* Skip restoring directory time stamps on user' request. */
if (uO.D_flag <= 0) {
/* Open a handle to the directory before processing extra fields;
unzip-6.0/win32/win32.c view on Meta::CPAN
/*************************/
/* Function stamp_file() */
/*************************/
int stamp_file(__GPRO__ ZCONST char *fname, time_t modtime)
{
FILETIME Modft; /* File time type defined in NT, `last modified' time */
HANDLE hFile; /* File handle defined in NT */
int errstat = 0; /* return status: 0 == "OK", -1 == "Failure" */
int fs_uses_loctime = FStampIsLocTime(__G__ fname);
#ifdef __RSXNT__ /* RSXNT/EMX C rtl uses OEM charset */
char *ansi_name = (char *)alloca(strlen(fname) + 1);
INTERN_TO_ISO(fname, ansi_name);
# define Ansi_Fname ansi_name
#else
# define Ansi_Fname fname
#endif
/* open a handle to the file to prepare setting the mod-time stamp */
hFile = CreateFileA(Ansi_Fname, GENERIC_WRITE, FILE_SHARE_WRITE, NULL,
unzip-6.0/win32/win32.c view on Meta::CPAN
*/
static int NTQueryVolInfo(__GPRO__ const char *name)
{
/* static char lastRootPath[4] = ""; */
/* static int lastVolOldFAT; */
/* static int lastVolLocTim; */
char *tmp0;
char tmp1[MAX_PATH], tmp2[MAX_PATH];
DWORD volSerNo, maxCompLen, fileSysFlags;
#ifdef __RSXNT__ /* RSXNT/EMX C rtl uses OEM charset */
char *ansi_name = (char *)alloca(strlen(name) + 1);
INTERN_TO_ISO(name, ansi_name);
name = ansi_name;
#endif
if ((!strncmp(name, "//", 2) || !strncmp(name, "\\\\", 2)) &&
(name[2] != '\0' && name[2] != '/' && name[2] != '\\')) {
/* GetFullPathname() and GetVolumeInformation() do not work
* on UNC names. For now, we return "error".
unzip-6.0/win32/win32.c view on Meta::CPAN
error = (error & MPN_MASK) | PK_WARN;
}
/*---------------------------------------------------------------------------
Report if directory was created (and no file to create: filename ended
in '/'), check name to be sure it exists, and combine path and name be-
fore exiting.
---------------------------------------------------------------------------*/
if (lastchar(G.filename, G.fnlen) == '/') {
#ifdef __RSXNT__ /* RSXNT/EMX C rtl uses OEM charset */
char *ansi_name = (char *)alloca(strlen(G.filename) + 1);
INTERN_TO_ISO(G.filename, ansi_name);
# define Ansi_Fname ansi_name
#else
# define Ansi_Fname G.filename
#endif
checkdir(__G__ G.filename, GETPATH);
if (G.created_dir) {
if (QCOND2) {
unzip-6.0/win32/win32.c view on Meta::CPAN
Info(slide, 1, ((char *)slide, "mapname: conversion of %s failed\n",
FnFilter1(G.filename)));
return (error & ~MPN_MASK) | MPN_ERR_SKIP;
}
checkdir(__G__ pathcomp, APPEND_NAME); /* returns 1 if truncated: care? */
checkdir(__G__ G.filename, GETPATH);
if (G.pInfo->vollabel) { /* set the volume label now */
char drive[4];
#ifdef __RSXNT__ /* RSXNT/EMX C rtl uses OEM charset */
char *ansi_name = (char *)alloca(strlen(G.filename) + 1);
INTERN_TO_ISO(G.filename, ansi_name);
# define Ansi_Fname ansi_name
#else
# define Ansi_Fname G.filename
#endif
/* Build a drive string, e.g. "b:" */
drive[0] = (char)('a' + G.nLabelDrive - 1);
strcpy(drive + 1, ":\\");
unzip-6.0/win32/win32.c view on Meta::CPAN
int zstat_win32(__W32STAT_GLOBALS__ const char *path, z_stat *buf)
{
if (!zstat(path, buf))
{
/* stat was successful, now redo the time-stamp fetches */
#ifndef NO_W32TIMES_IZFIX
int fs_uses_loctime = FStampIsLocTime(__G__ path);
#endif
HANDLE h;
FILETIME Modft, Accft, Creft;
#ifdef __RSXNT__ /* RSXNT/EMX C rtl uses OEM charset */
char *ansi_path = (char *)alloca(strlen(path) + 1);
INTERN_TO_ISO(path, ansi_path);
# define Ansi_Path ansi_path
#else
# define Ansi_Path path
#endif
TTrace((stdout, "stat(%s) finds modtime %08lx\n", path, buf->st_mtime));
h = CreateFileA(Ansi_Path, GENERIC_READ,
unzip-6.0/win32/win32.c view on Meta::CPAN
}
}
}
# undef Ansi_Path
return 0;
}
#ifdef W32_STATROOT_FIX
else
{
DWORD flags;
#ifdef __RSXNT__ /* RSXNT/EMX C rtl uses OEM charset */
char *ansi_path = (char *)alloca(strlen(path) + 1);
INTERN_TO_ISO(path, ansi_path);
# define Ansi_Path ansi_path
#else
# define Ansi_Path path
#endif
flags = GetFileAttributesA(Ansi_Path);
if (flags != 0xFFFFFFFF && flags & FILE_ATTRIBUTE_DIRECTORY) {
unzip-6.0/wince/wcecfg.h view on Meta::CPAN
# endif
#endif
#if (!defined(NO_UNICODE_SUPPORT) && !defined(UNICODE_SUPPORT))
#define UNICODE_SUPPORT
#endif
#if (defined(UNICODE_SUPPORT) && !defined(UNICODE_WCHAR))
#define UNICODE_WCHAR /* wchar_t is UTF-16 encoded on WinCE */
#endif
#ifdef UTF8_MAYBE_NATIVE
#undef UTF8_MAYBE_NATIVE /* UTF-8 cannot be system charset on WinCE */
#endif
#ifdef POCKET_UNZIP
// The PUnZip GUI interface does not make use of ZipInfo style archive
// listings.
// For the command-line tool, it may be considered to disable ZipInfo, too,
// to save memory and resources.
# ifndef NO_ZIPINFO
# define NO_ZIPINFO
# endif
unzip-6.0/wince/wince.cpp view on Meta::CPAN
#endif // USE_FWRITE
//******************************************************************************
//***** STDLIB.H functions
//******************************************************************************
#ifdef _MBCS
int __cdecl mblen(const char *mbc, size_t mbszmax)
{
// very simple cooked-down version of mblen() without any error handling
// (Windows CE does not support multibyte charsets with a maximum char
// length > 2 bytes)
return (IsDBCSLeadByte((BYTE)*mbc) ? 2 : 1);
}
#endif /* _MBCS */
//******************************************************************************
//***** STRING.H functions
//******************************************************************************
//-- Called from winmain.cpp