Lines 576-586
void defer_leftover_input(__G)
Link Here
|
576 |
/* Function readbuf() */ |
576 |
/* Function readbuf() */ |
577 |
/**********************/ |
577 |
/**********************/ |
578 |
|
578 |
|
579 |
unsigned readbuf(__G__ buf, size) /* return number of bytes read into buf */ |
579 |
unsigned readbuf(__GPRO__ char *buf, register unsigned size) { /* return number of bytes read into buf */ |
580 |
__GDEF |
|
|
581 |
char *buf; |
582 |
register unsigned size; |
583 |
{ |
584 |
register unsigned count; |
580 |
register unsigned count; |
585 |
unsigned n; |
581 |
unsigned n; |
586 |
|
582 |
|
Lines 713-722
int fillinbuf(__G) /* like readbyte() except returns number of bytes in inbuf */
Link Here
|
713 |
/* Function seek_zipf() */ |
709 |
/* Function seek_zipf() */ |
714 |
/************************/ |
710 |
/************************/ |
715 |
|
711 |
|
716 |
int seek_zipf(__G__ abs_offset) |
712 |
int seek_zipf(__GPRO__ zoff_t abs_offset) { |
717 |
__GDEF |
|
|
718 |
zoff_t abs_offset; |
719 |
{ |
720 |
/* |
713 |
/* |
721 |
* Seek to the block boundary of the block which includes abs_offset, |
714 |
* Seek to the block boundary of the block which includes abs_offset, |
722 |
* then read block into input buffer and set pointers appropriately. |
715 |
* then read block into input buffer and set pointers appropriately. |
Lines 784-794
int seek_zipf(__G__ abs_offset)
Link Here
|
784 |
/* Function flush() */ /* returns PK error codes: */ |
777 |
/* Function flush() */ /* returns PK error codes: */ |
785 |
/********************/ /* if tflag => always 0; PK_DISK if write error */ |
778 |
/********************/ /* if tflag => always 0; PK_DISK if write error */ |
786 |
|
779 |
|
787 |
int flush(__G__ rawbuf, size, unshrink) |
780 |
int flush(__GPRO__ uch *rawbuf, ulg size, int unshrink) |
788 |
__GDEF |
|
|
789 |
uch *rawbuf; |
790 |
ulg size; |
791 |
int unshrink; |
792 |
#if (defined(USE_DEFLATE64) && defined(__16BIT__)) |
781 |
#if (defined(USE_DEFLATE64) && defined(__16BIT__)) |
793 |
{ |
782 |
{ |
794 |
int ret; |
783 |
int ret; |
Lines 1090-1099
static int partflush(__G__ rawbuf, size, unshrink)
Link Here
|
1090 |
/* Function is_vms_varlen_txt() */ |
1079 |
/* Function is_vms_varlen_txt() */ |
1091 |
/********************************/ |
1080 |
/********************************/ |
1092 |
|
1081 |
|
1093 |
static int is_vms_varlen_txt(__G__ ef_buf, ef_len) |
1082 |
static int is_vms_varlen_txt(__GPRO__ uch *ef_buf, unsigned ef_len) |
1094 |
__GDEF |
1083 |
//uch *ef_buf; /* buffer containing extra field */ |
1095 |
uch *ef_buf; /* buffer containing extra field */ |
1084 |
//unsigned ef_len; /* total length of extra field */ |
1096 |
unsigned ef_len; /* total length of extra field */ |
|
|
1097 |
{ |
1085 |
{ |
1098 |
unsigned eb_id; |
1086 |
unsigned eb_id; |
1099 |
unsigned eb_len; |
1087 |
unsigned eb_len; |
Lines 1224-1230
static int disk_error(__G)
Link Here
|
1224 |
FnFilter1(G.filename))); |
1212 |
FnFilter1(G.filename))); |
1225 |
|
1213 |
|
1226 |
#ifndef WINDLL |
1214 |
#ifndef WINDLL |
1227 |
fgets(G.answerbuf, sizeof(G.answerbuf), stdin); |
1215 |
(void)fgets(G.answerbuf, sizeof(G.answerbuf), stdin); |
1228 |
if (*G.answerbuf == 'y') /* stop writing to this file */ |
1216 |
if (*G.answerbuf == 'y') /* stop writing to this file */ |
1229 |
G.disk_full = 1; /* (outfile bad?), but new OK */ |
1217 |
G.disk_full = 1; /* (outfile bad?), but new OK */ |
1230 |
else |
1218 |
else |
Lines 1245-1255
static int disk_error(__G)
Link Here
|
1245 |
/* Function UzpMessagePrnt() */ |
1233 |
/* Function UzpMessagePrnt() */ |
1246 |
/*****************************/ |
1234 |
/*****************************/ |
1247 |
|
1235 |
|
1248 |
int UZ_EXP UzpMessagePrnt(pG, buf, size, flag) |
1236 |
int UZ_EXP UzpMessagePrnt(zvoid *pG, uch *buf, ulg size, int flag) |
1249 |
zvoid *pG; /* globals struct: always passed */ |
1237 |
//zvoid *pG; /* globals struct: always passed */ |
1250 |
uch *buf; /* preformatted string to be printed */ |
1238 |
//uch *buf; /* preformatted string to be printed */ |
1251 |
ulg size; /* length of string (may include nulls) */ |
1239 |
//ulg size; /* length of string (may include nulls) */ |
1252 |
int flag; /* flag bits */ |
1240 |
//int flag; /* flag bits */ |
1253 |
{ |
1241 |
{ |
1254 |
/* IMPORTANT NOTE: |
1242 |
/* IMPORTANT NOTE: |
1255 |
* The name of the first parameter of UzpMessagePrnt(), which passes |
1243 |
* The name of the first parameter of UzpMessagePrnt(), which passes |
Lines 1488-1501
int UZ_EXP UzpMessageNull(pG, buf, size, flag)
Link Here
|
1488 |
/* Function UzpInput() */ /* GRR: this is a placeholder for now */ |
1476 |
/* Function UzpInput() */ /* GRR: this is a placeholder for now */ |
1489 |
/***********************/ |
1477 |
/***********************/ |
1490 |
|
1478 |
|
1491 |
int UZ_EXP UzpInput(pG, buf, size, flag) |
1479 |
int UZ_EXP UzpInput(zvoid *pG, uch *buf, int *size, int flag) |
1492 |
zvoid *pG; /* globals struct: always passed */ |
1480 |
//zvoid *pG; /* globals struct: always passed */ |
1493 |
uch *buf; /* preformatted string to be printed */ |
1481 |
//uch *buf; /* preformatted string to be printed */ |
1494 |
int *size; /* (address of) size of buf and of returned string */ |
1482 |
//int *size; /* (address of) size of buf and of returned string */ |
1495 |
int flag; /* flag bits (bit 0: no echo) */ |
1483 |
//int flag; /* flag bits (bit 0: no echo) */ |
1496 |
{ |
1484 |
{ |
1497 |
/* tell picky compilers to shut up about "unused variable" warnings */ |
1485 |
/* tell picky compilers to shut up about "unused variable" warnings */ |
1498 |
pG = pG; buf = buf; flag = flag; |
1486 |
//pG = pG; buf = buf; flag = flag; |
1499 |
|
1487 |
|
1500 |
*size = 0; |
1488 |
*size = 0; |
1501 |
return 0; |
1489 |
return 0; |
Lines 1512-1521
int UZ_EXP UzpInput(pG, buf, size, flag)
Link Here
|
1512 |
/* Function UzpMorePause() */ |
1500 |
/* Function UzpMorePause() */ |
1513 |
/***************************/ |
1501 |
/***************************/ |
1514 |
|
1502 |
|
1515 |
void UZ_EXP UzpMorePause(pG, prompt, flag) |
1503 |
void UZ_EXP UzpMorePause(zvoid *pG, ZCONST char *prompt, int flag) |
1516 |
zvoid *pG; /* globals struct: always passed */ |
1504 |
//zvoid *pG; /* globals struct: always passed */ |
1517 |
ZCONST char *prompt; /* "--More--" prompt */ |
1505 |
//ZCONST char *prompt; /* "--More--" prompt */ |
1518 |
int flag; /* 0 = any char OK; 1 = accept only '\n', ' ', q */ |
1506 |
//int flag; /* 0 = any char OK; 1 = accept only '\n', ' ', q */ |
1519 |
{ |
1507 |
{ |
1520 |
uch c; |
1508 |
uch c; |
1521 |
|
1509 |
|
Lines 1574-1591
void UZ_EXP UzpMorePause(pG, prompt, flag)
Link Here
|
1574 |
/* Function UzpPassword() */ |
1562 |
/* Function UzpPassword() */ |
1575 |
/**************************/ |
1563 |
/**************************/ |
1576 |
|
1564 |
|
1577 |
int UZ_EXP UzpPassword (pG, rcnt, pwbuf, size, zfn, efn) |
1565 |
int UZ_EXP UzpPassword (zvoid *pG, int *rcnt, char *pwbuf, int size, ZCONST char *zfn, ZCONST char *efn) |
1578 |
zvoid *pG; /* pointer to UnZip's internal global vars */ |
1566 |
//zvoid *pG; /* pointer to UnZip's internal global vars */ |
1579 |
int *rcnt; /* retry counter */ |
1567 |
//int *rcnt; /* retry counter */ |
1580 |
char *pwbuf; /* buffer for password */ |
1568 |
//char *pwbuf; /* buffer for password */ |
1581 |
int size; /* size of password buffer */ |
1569 |
//int size; /* size of password buffer */ |
1582 |
ZCONST char *zfn; /* name of zip archive */ |
1570 |
//ZCONST char *zfn; /* name of zip archive */ |
1583 |
ZCONST char *efn; /* name of archive entry being processed */ |
1571 |
//ZCONST char *efn; /* name of archive entry being processed */ |
1584 |
{ |
1572 |
{ |
1585 |
#if CRYPT |
1573 |
#if CRYPT |
1586 |
int r = IZ_PW_ENTERED; |
1574 |
int r = IZ_PW_ENTERED; |
1587 |
char *m; |
1575 |
char *m; |
1588 |
char *prompt; |
1576 |
char *prompt = NULL; |
1589 |
char *zfnf; |
1577 |
char *zfnf; |
1590 |
char *efnf; |
1578 |
char *efnf; |
1591 |
size_t zfnfl; |
1579 |
size_t zfnfl; |
Lines 1593-1599
int UZ_EXP UzpPassword (pG, rcnt, pwbuf, size, zfn, efn)
Link Here
|
1593 |
|
1581 |
|
1594 |
#ifndef REENTRANT |
1582 |
#ifndef REENTRANT |
1595 |
/* tell picky compilers to shut up about "unused variable" warnings */ |
1583 |
/* tell picky compilers to shut up about "unused variable" warnings */ |
1596 |
pG = pG; |
1584 |
//pG = pG; |
1597 |
#endif |
1585 |
#endif |
1598 |
|
1586 |
|
1599 |
if (*rcnt == 0) { /* First call for current entry */ |
1587 |
if (*rcnt == 0) { /* First call for current entry */ |
Lines 1632-1638
int UZ_EXP UzpPassword (pG, rcnt, pwbuf, size, zfn, efn)
Link Here
|
1632 |
|
1620 |
|
1633 |
#else /* !CRYPT */ |
1621 |
#else /* !CRYPT */ |
1634 |
/* tell picky compilers to shut up about "unused variable" warnings */ |
1622 |
/* tell picky compilers to shut up about "unused variable" warnings */ |
1635 |
pG = pG; rcnt = rcnt; pwbuf = pwbuf; size = size; zfn = zfn; efn = efn; |
1623 |
//pG = pG; rcnt = rcnt; pwbuf = pwbuf; size = size; zfn = zfn; efn = efn; |
1636 |
|
1624 |
|
1637 |
return IZ_PW_ERROR; /* internal error; function should never get called */ |
1625 |
return IZ_PW_ERROR; /* internal error; function should never get called */ |
1638 |
#endif /* ?CRYPT */ |
1626 |
#endif /* ?CRYPT */ |
Lines 1647-1655
int UZ_EXP UzpPassword (pG, rcnt, pwbuf, size, zfn, efn)
Link Here
|
1647 |
/* Function handler() */ |
1635 |
/* Function handler() */ |
1648 |
/**********************/ |
1636 |
/**********************/ |
1649 |
|
1637 |
|
1650 |
void handler(signal) /* upon interrupt, turn on echo and exit cleanly */ |
1638 |
void handler(int signal) { /* upon interrupt, turn on echo and exit cleanly */ |
1651 |
int signal; |
|
|
1652 |
{ |
1653 |
GETGLOBALS(); |
1639 |
GETGLOBALS(); |
1654 |
|
1640 |
|
1655 |
#if !(defined(SIGBUS) || defined(SIGSEGV)) /* add a newline if not at */ |
1641 |
#if !(defined(SIGBUS) || defined(SIGSEGV)) /* add a newline if not at */ |
Lines 1711-1719
ZCONST ush ydays[] =
Link Here
|
1711 |
/* Function dos_to_unix_time() */ /* used for freshening/updating/timestamps */ |
1697 |
/* Function dos_to_unix_time() */ /* used for freshening/updating/timestamps */ |
1712 |
/*******************************/ |
1698 |
/*******************************/ |
1713 |
|
1699 |
|
1714 |
time_t dos_to_unix_time(dosdatetime) |
1700 |
time_t dos_to_unix_time(ulg dosdatetime) { |
1715 |
ulg dosdatetime; |
|
|
1716 |
{ |
1717 |
time_t m_time; |
1701 |
time_t m_time; |
1718 |
|
1702 |
|
1719 |
#ifdef HAVE_MKTIME |
1703 |
#ifdef HAVE_MKTIME |
Lines 1897-1905
time_t dos_to_unix_time(dosdatetime)
Link Here
|
1897 |
/* Function check_for_newer() */ /* used for overwriting/freshening/updating */ |
1881 |
/* Function check_for_newer() */ /* used for overwriting/freshening/updating */ |
1898 |
/******************************/ |
1882 |
/******************************/ |
1899 |
|
1883 |
|
1900 |
int check_for_newer(__G__ filename) /* return 1 if existing file is newer */ |
1884 |
int check_for_newer(__GPRO__ char *filename) /* return 1 if existing file is newer */ |
1901 |
__GDEF /* or equal; 0 if older; -1 if doesn't */ |
1885 |
//__GDEF /* or equal; 0 if older; -1 if doesn't */ |
1902 |
char *filename; /* exist yet */ |
1886 |
//char *filename; /* exist yet */ |
1903 |
{ |
1887 |
{ |
1904 |
time_t existing, archive; |
1888 |
time_t existing, archive; |
1905 |
#ifdef USE_EF_UT_TIME |
1889 |
#ifdef USE_EF_UT_TIME |
Lines 2016-2025
int check_for_newer(__G__ filename) /* return 1 if existing file is newer */
Link Here
|
2016 |
/* Function do_string() */ |
2000 |
/* Function do_string() */ |
2017 |
/************************/ |
2001 |
/************************/ |
2018 |
|
2002 |
|
2019 |
int do_string(__G__ length, option) /* return PK-type error code */ |
2003 |
int do_string(__GPRO__ unsigned int length, int option) /* return PK-type error code */ |
2020 |
__GDEF |
2004 |
//unsigned int length; /* without prototype, ush converted to this */ |
2021 |
unsigned int length; /* without prototype, ush converted to this */ |
|
|
2022 |
int option; |
2023 |
{ |
2005 |
{ |
2024 |
unsigned comment_bytes_left; |
2006 |
unsigned comment_bytes_left; |
2025 |
unsigned int block_len; |
2007 |
unsigned int block_len; |
Lines 2446-2454
int do_string(__G__ length, option) /* return PK-type error code */
Link Here
|
2446 |
/* Function makeword() */ |
2428 |
/* Function makeword() */ |
2447 |
/***********************/ |
2429 |
/***********************/ |
2448 |
|
2430 |
|
2449 |
ush makeword(b) |
2431 |
ush makeword(ZCONST uch *b) { |
2450 |
ZCONST uch *b; |
|
|
2451 |
{ |
2452 |
/* |
2432 |
/* |
2453 |
* Convert Intel style 'short' integer to non-Intel non-16-bit |
2433 |
* Convert Intel style 'short' integer to non-Intel non-16-bit |
2454 |
* host format. This routine also takes care of byte-ordering. |
2434 |
* host format. This routine also takes care of byte-ordering. |
Lines 2464-2472
ush makeword(b)
Link Here
|
2464 |
/* Function makelong() */ |
2444 |
/* Function makelong() */ |
2465 |
/***********************/ |
2445 |
/***********************/ |
2466 |
|
2446 |
|
2467 |
ulg makelong(sig) |
2447 |
ulg makelong(ZCONST uch *sig) { |
2468 |
ZCONST uch *sig; |
|
|
2469 |
{ |
2470 |
/* |
2448 |
/* |
2471 |
* Convert intel style 'long' variable to non-Intel non-16-bit |
2449 |
* Convert intel style 'long' variable to non-Intel non-16-bit |
2472 |
* host format. This routine also takes care of byte-ordering. |
2450 |
* host format. This routine also takes care of byte-ordering. |
Lines 2485-2493
ulg makelong(sig)
Link Here
|
2485 |
/* Function makeint64() */ |
2463 |
/* Function makeint64() */ |
2486 |
/************************/ |
2464 |
/************************/ |
2487 |
|
2465 |
|
2488 |
zusz_t makeint64(sig) |
2466 |
zusz_t makeint64(ZCONST uch *sig) { |
2489 |
ZCONST uch *sig; |
|
|
2490 |
{ |
2491 |
#ifdef LARGE_FILE_SUPPORT |
2467 |
#ifdef LARGE_FILE_SUPPORT |
2492 |
/* |
2468 |
/* |
2493 |
* Convert intel style 'int64' variable to non-Intel non-16-bit |
2469 |
* Convert intel style 'int64' variable to non-Intel non-16-bit |
Lines 2524-2535
zusz_t makeint64(sig)
Link Here
|
2524 |
/*********************/ |
2500 |
/*********************/ |
2525 |
|
2501 |
|
2526 |
/* Format a zoff_t value in a cylindrical buffer set. */ |
2502 |
/* Format a zoff_t value in a cylindrical buffer set. */ |
2527 |
char *fzofft(__G__ val, pre, post) |
2503 |
char *fzofft(__GPRO__ zoff_t val, ZCONST char *pre, ZCONST char *post) { |
2528 |
__GDEF |
|
|
2529 |
zoff_t val; |
2530 |
ZCONST char *pre; |
2531 |
ZCONST char *post; |
2532 |
{ |
2533 |
/* Storage cylinder. (now in globals.h) */ |
2504 |
/* Storage cylinder. (now in globals.h) */ |
2534 |
/*static char fzofft_buf[FZOFFT_NUM][FZOFFT_LEN];*/ |
2505 |
/*static char fzofft_buf[FZOFFT_NUM][FZOFFT_LEN];*/ |
2535 |
/*static int fzofft_index = 0;*/ |
2506 |
/*static int fzofft_index = 0;*/ |
Lines 2607-2615
char *str2iso(dst, src)
Link Here
|
2607 |
/* Function str2oem() */ |
2578 |
/* Function str2oem() */ |
2608 |
/**********************/ |
2579 |
/**********************/ |
2609 |
|
2580 |
|
2610 |
char *str2oem(dst, src) |
2581 |
char *str2oem(char *dst, register ZCONST char *src) |
2611 |
char *dst; /* destination buffer */ |
2582 |
//char *dst; /* destination buffer */ |
2612 |
register ZCONST char *src; /* source string */ |
2583 |
//register ZCONST char *src; /* source string */ |
2613 |
{ |
2584 |
{ |
2614 |
#ifdef INTERN_TO_OEM |
2585 |
#ifdef INTERN_TO_OEM |
2615 |
INTERN_TO_OEM(src, dst); |
2586 |
INTERN_TO_OEM(src, dst); |
Lines 2702-2711
zvoid *memcpy(dst, src, len)
Link Here
|
2702 |
/* Function zstrnicmp() */ |
2673 |
/* Function zstrnicmp() */ |
2703 |
/************************/ |
2674 |
/************************/ |
2704 |
|
2675 |
|
2705 |
int zstrnicmp(s1, s2, n) |
2676 |
int zstrnicmp(register ZCONST char *s1, register ZCONST char *s2, register unsigned n) { |
2706 |
register ZCONST char *s1, *s2; |
|
|
2707 |
register unsigned n; |
2708 |
{ |
2709 |
for (; n > 0; --n, ++s1, ++s2) { |
2677 |
for (; n > 0; --n, ++s1, ++s2) { |
2710 |
|
2678 |
|
2711 |
if (ToLower(*s1) != ToLower(*s2)) |
2679 |
if (ToLower(*s1) != ToLower(*s2)) |