mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-23 22:02:27 +00:00
Add MODE=optlinux build mode (#141)
This commit is contained in:
parent
226aaf3547
commit
67b5200a0b
111 changed files with 934 additions and 854 deletions
65
third_party/infozip/zip/util.c
vendored
65
third_party/infozip/zip/util.c
vendored
|
@ -597,71 +597,6 @@ int (*cmp) OF((ZCONST zvoid *, ZCONST zvoid far *)); /* comparison function */
|
|||
|
||||
#endif /* !UTIL */
|
||||
|
||||
#ifdef MSDOS16
|
||||
|
||||
local unsigned ident(unsigned chr)
|
||||
{
|
||||
return chr; /* in al */
|
||||
}
|
||||
|
||||
void init_upper()
|
||||
{
|
||||
static struct country {
|
||||
uch ignore[18];
|
||||
int (far *casemap)(int);
|
||||
uch filler[16];
|
||||
} country_info;
|
||||
|
||||
struct country far *info = &country_info;
|
||||
union REGS regs;
|
||||
struct SREGS sregs;
|
||||
unsigned int c;
|
||||
|
||||
regs.x.ax = 0x3800; /* get country info */
|
||||
regs.x.dx = FP_OFF(info);
|
||||
sregs.ds = FP_SEG(info);
|
||||
intdosx(®s, ®s, &sregs);
|
||||
for (c = 0; c < 128; c++) {
|
||||
upper[c] = (uch) toupper(c);
|
||||
lower[c] = (uch) c;
|
||||
}
|
||||
for (; c < sizeof(upper); c++) {
|
||||
upper[c] = (uch) (*country_info.casemap)(ident(c));
|
||||
/* ident() required because casemap takes its parameter in al */
|
||||
lower[c] = (uch) c;
|
||||
}
|
||||
for (c = 0; c < sizeof(upper); c++ ) {
|
||||
unsigned int u = upper[c];
|
||||
if (u != c && lower[u] == (uch) u) {
|
||||
lower[u] = (uch)c;
|
||||
}
|
||||
}
|
||||
for (c = 'A'; c <= 'Z'; c++) {
|
||||
lower[c] = (uch) (c - 'A' + 'a');
|
||||
}
|
||||
}
|
||||
#else /* !MSDOS16 */
|
||||
# ifndef OS2
|
||||
|
||||
void init_upper()
|
||||
{
|
||||
unsigned int c;
|
||||
#if defined(ATARI) || defined(CMS_MVS)
|
||||
/* this should be valid for all other platforms too. (HD 11/11/95) */
|
||||
for (c = 0; c< sizeof(upper); c++) {
|
||||
upper[c] = islower(c) ? toupper(c) : c;
|
||||
lower[c] = isupper(c) ? tolower(c) : c;
|
||||
}
|
||||
#else
|
||||
for (c = 0; c < sizeof(upper); c++) upper[c] = lower[c] = (uch)c;
|
||||
for (c = 'a'; c <= 'z'; c++) upper[c] = (uch)(c - 'a' + 'A');
|
||||
for (c = 'A'; c <= 'Z'; c++) lower[c] = (uch)(c - 'A' + 'a');
|
||||
#endif
|
||||
}
|
||||
# endif /* !OS2 */
|
||||
|
||||
#endif /* ?MSDOS16 */
|
||||
|
||||
int namecmp(string1, string2)
|
||||
ZCONST char *string1, *string2;
|
||||
/* Compare the two strings ignoring case, and correctly taking into
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue