cosmopolitan/third_party/unzip/ubz2err.c

59 lines
1.9 KiB
C
Raw Normal View History

2022-06-10 11:54:37 +00:00
// clang-format off
/*
Copyright (c) 1990-2008 Info-ZIP. All rights reserved.
See the accompanying file LICENSE, version 2007-Mar-04 or later
(the contents of which are also included in unzip.h) for terms of use.
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
*/
/*---------------------------------------------------------------------------
ubz2err.c
This file contains the "fatal error" callback routine required by the
"minimal" (silent, non-stdio) setup of the bzip2 compression library.
The fatal bzip2 error bail-out routine is provided in a separate code
module, so that it can be easily overridden when the UnZip package is
used as a static link library. One example is the WinDLL static library
usage for building a monolythic binary of the Windows application "WiZ"
that supports bzip2 both in compression and decompression operations.
Contains: bz_internal_error() (USE_BZIP2 only)
---------------------------------------------------------------------------*/
#define __UBZ2ERR_C /* identifies this source module */
#define UNZIP_INTERNAL
#include "third_party/unzip/unzip.h"
Prove that Makefile is fully defined The whole repository is now buildable with GNU Make Landlock sandboxing. This proves that no Makefile targets exist which touch files other than their declared prerequisites. In order to do this, we had to: 1. Stop code morphing GCC output in package.com and instead run a newly introduced FIXUPOBJ.COM command after GCC invocations. 2. Disable all the crumby Python unit tests that do things like create files in the current directory, or rename() files between folders. This ended up being a lot of tests, but most of them are still ok. 3. Introduce an .UNSANDBOXED variable to GNU Make to disable Landlock. We currently only do this for things like `make tags`. 4. This change deletes some GNU Make code that was preventing the execve() optimization from working. This means it should no longer be necessary in most cases for command invocations to be indirected through the cocmd interpreter. 5. Missing dependencies had to be declared in certain places, in cases where they couldn't be automatically determined by MKDEPS.COM 6. The libcxx header situation has finally been tamed. One of the things that makes this difficult is MKDEPS.COM only wants to consider the first 64kb of a file, in order to go fast. But libcxx likes to have #include lines buried after huge documentation. 7. An .UNVEIL variable has been introduced to GNU Make just in case we ever wish to explicitly specify additional things that need to be whitelisted which aren't strictly prerequisites. This works in a manner similar to the recently introduced .EXTRA_PREREQS feature. There's now a new build/bootstrap/make.com prebuilt binary available. It should no longer be possible to write invalid Makefile code.
2022-08-06 10:51:50 +00:00
#include "third_party/unzip/globals.h"
2022-06-10 11:54:37 +00:00
#ifdef USE_BZIP2
/**********************************/
/* Function bz_internal_error() */
/**********************************/
/* Call-back function for the bzip2 decompression code (compiled with
* BZ_NO_STDIO), required to handle fatal internal bug-type errors of
* the bzip2 library.
*/
void bz_internal_error(bzerrcode)
int bzerrcode;
{
GETGLOBALS();
Info(slide, 0x421, ((char *)slide,
"error: internal fatal libbzip2 error number %d\n", bzerrcode));
#ifdef WINDLL
longjmp(dll_error_return, 1);
#else
DESTROYGLOBALS();
EXIT(PK_BADERR);
#endif
} /* end function bz_internal_error() */
#endif /* USE_BZIP2 */