mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-08 04:08:32 +00:00
Make numerous improvements
- Python static hello world now 1.8mb - Python static fully loaded now 10mb - Python HTTPS client now uses MbedTLS - Python REPL now completes import stmts - Increase stack size for Python for now - Begin synthesizing posixpath and ntpath - Restore Python \N{UNICODE NAME} support - Restore Python NFKD symbol normalization - Add optimized code path for Intel SHA-NI - Get more Python unit tests passing faster - Get Python help() pagination working on NT - Python hashlib now supports MbedTLS PBKDF2 - Make memcpy/memmove/memcmp/bcmp/etc. faster - Add Mersenne Twister and Vigna to LIBC_RAND - Provide privileged __printf() for error code - Fix zipos opendir() so that it reports ENOTDIR - Add basic chmod() implementation for Windows NT - Add Cosmo's best functions to Python cosmo module - Pin function trace indent depth to that of caller - Show memory diagram on invalid access in MODE=dbg - Differentiate stack overflow on crash in MODE=dbg - Add stb_truetype and tools for analyzing font files - Upgrade to UNICODE 13 and reduce its binary footprint - COMPILE.COM now logs resource usage of build commands - Start implementing basic poll() support on bare metal - Set getauxval(AT_EXECFN) to GetModuleFileName() on NT - Add descriptions to strerror() in non-TINY build modes - Add COUNTBRANCH() macro to help with micro-optimizations - Make error / backtrace / asan / memory code more unbreakable - Add fast perfect C implementation of μ-Law and a-Law audio codecs - Make strtol() functions consistent with other libc implementations - Improve Linenoise implementation (see also github.com/jart/bestline) - COMPILE.COM now suppresses stdout/stderr of successful build commands
This commit is contained in:
parent
fa7b4f5bd1
commit
39bf41f4eb
806 changed files with 77494 additions and 63859 deletions
92
third_party/infozip/zip/unix/unix.c
vendored
92
third_party/infozip/zip/unix/unix.c
vendored
|
@ -9,6 +9,7 @@
|
|||
If, for some reason, all these files are missing, the Info-ZIP license
|
||||
also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html
|
||||
*/
|
||||
#include "libc/calls/struct/dirent.h"
|
||||
#include "third_party/infozip/zip/zip.h"
|
||||
|
||||
#ifndef UTIL /* the companion #endif is a bit of ways down ... */
|
||||
|
@ -28,35 +29,14 @@
|
|||
# define S_IWRITE S_IWUSR
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_DIRENT_H) || defined(_POSIX_VERSION)
|
||||
#include "libc/calls/calls.h"
|
||||
#include "libc/sysv/consts/dt.h"
|
||||
#else /* !HAVE_DIRENT_H */
|
||||
# ifdef HAVE_NDIR_H
|
||||
# include <ndir.h>
|
||||
# endif /* HAVE_NDIR_H */
|
||||
# ifdef HAVE_SYS_NDIR_H
|
||||
# include <sys/ndir.h>
|
||||
# endif /* HAVE_SYS_NDIR_H */
|
||||
# ifdef HAVE_SYS_DIR_H
|
||||
# include <sys/dir.h>
|
||||
# endif /* HAVE_SYS_DIR_H */
|
||||
# ifndef dirent
|
||||
# define dirent direct
|
||||
# endif
|
||||
#endif /* HAVE_DIRENT_H || _POSIX_VERSION */
|
||||
|
||||
#define PAD 0
|
||||
#define PATH_END '/'
|
||||
|
||||
/* Library functions not in (most) header files */
|
||||
|
||||
#if _POSIX_VERSION
|
||||
# include <utime.h>
|
||||
#else
|
||||
/* int utime OF((char *, time_t *)); */
|
||||
#endif
|
||||
|
||||
extern char *label;
|
||||
local ulg label_time = 0;
|
||||
local ulg label_mode = 0;
|
||||
|
@ -67,7 +47,6 @@ local char *readd OF((DIR *));
|
|||
|
||||
|
||||
#ifdef NO_DIR /* for AT&T 3B1 */
|
||||
#include <sys/dir.h>
|
||||
#ifndef dirent
|
||||
# define dirent direct
|
||||
#endif
|
||||
|
@ -724,7 +703,6 @@ char *d; /* directory to delete */
|
|||
|
||||
#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__386BSD__) || \
|
||||
defined(__OpenBSD__) || defined(__bsdi__)
|
||||
#include <sys/param.h> /* for the BSD define */
|
||||
/* if we have something newer than NET/2 we'll use uname(3) */
|
||||
#if (BSD > 199103)
|
||||
#include "libc/calls/calls.h"
|
||||
|
@ -1034,71 +1012,3 @@ void version_local()
|
|||
COMPILER_NAME, OS_NAME, COMPILE_DATE);
|
||||
|
||||
} /* end function version_local() */
|
||||
|
||||
|
||||
/* 2006-03-23 SMS.
|
||||
* Emergency replacement for strerror(). (Useful on SunOS 4.*.)
|
||||
* Enable by specifying "LOCAL_UNZIP=-DNEED_STRERROR=1" on the "make"
|
||||
* command line.
|
||||
*/
|
||||
|
||||
#ifdef NEED_STRERROR
|
||||
|
||||
char *strerror( err)
|
||||
int err;
|
||||
{
|
||||
extern char *sys_errlist[];
|
||||
extern int sys_nerr;
|
||||
|
||||
static char no_msg[ 64];
|
||||
|
||||
if ((err >= 0) && (err < sys_nerr))
|
||||
{
|
||||
return sys_errlist[ err];
|
||||
}
|
||||
else
|
||||
{
|
||||
sprintf( no_msg, "(no message, code = %d.)", err);
|
||||
return no_msg;
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* def NEED_STRERROR */
|
||||
|
||||
|
||||
/* 2006-03-23 SMS.
|
||||
* Emergency replacement for memmove(). (Useful on SunOS 4.*.)
|
||||
* Enable by specifying "LOCAL_UNZIP=-DNEED_MEMMOVE=1" on the "make"
|
||||
* command line.
|
||||
*/
|
||||
|
||||
#ifdef NEED_MEMMOVE
|
||||
|
||||
/* memmove.c -- copy memory.
|
||||
Copy LENGTH bytes from SOURCE to DEST. Does not null-terminate.
|
||||
In the public domain.
|
||||
By David MacKenzie <djm@gnu.ai.mit.edu>.
|
||||
Adjusted by SMS.
|
||||
*/
|
||||
|
||||
void *memmove(dest0, source0, length)
|
||||
void *dest0;
|
||||
void const *source0;
|
||||
size_t length;
|
||||
{
|
||||
char *dest = dest0;
|
||||
char const *source = source0;
|
||||
if (source < dest)
|
||||
/* Moving from low mem to hi mem; start at end. */
|
||||
for (source += length, dest += length; length; --length)
|
||||
*--dest = *--source;
|
||||
else if (source != dest)
|
||||
{
|
||||
/* Moving from hi mem to low mem; start at beginning. */
|
||||
for (; length; --length)
|
||||
*dest++ = *source++;
|
||||
}
|
||||
return dest0;
|
||||
}
|
||||
|
||||
#endif /* def NEED_MEMMOVE */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue