mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-04 18:28:30 +00:00
Set up http://redbean.justine.lol/ demo server
This commit is contained in:
parent
472b95fea3
commit
c029e83dd8
7 changed files with 118 additions and 25 deletions
|
@ -232,8 +232,6 @@ relegated void __oncrash(int sig, struct siginfo *si, ucontext_t *ctx) {
|
|||
err = errno;
|
||||
if (once) _exit(119);
|
||||
once = true;
|
||||
/* TODO(jart): Needs translation for ucontext_t and possibly siginfo_t. */
|
||||
if (IsFreebsd() || IsOpenbsd()) ctx = NULL;
|
||||
rip = ctx ? ctx->uc_mcontext.rip : 0;
|
||||
if ((gdbpid = IsDebuggerPresent(true))) {
|
||||
DebugBreak();
|
||||
|
|
30
libc/str/getzipcdircomment.c
Normal file
30
libc/str/getzipcdircomment.c
Normal file
|
@ -0,0 +1,30 @@
|
|||
/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:2;tab-width:8;coding:utf-8 -*-│
|
||||
│vi: set net ft=c ts=2 sts=2 sw=2 fenc=utf-8 :vi│
|
||||
╞══════════════════════════════════════════════════════════════════════════════╡
|
||||
│ Copyright 2021 Justine Alexandra Roberts Tunney │
|
||||
│ │
|
||||
│ Permission to use, copy, modify, and/or distribute this software for │
|
||||
│ any purpose with or without fee is hereby granted, provided that the │
|
||||
│ above copyright notice and this permission notice appear in all copies. │
|
||||
│ │
|
||||
│ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL │
|
||||
│ WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED │
|
||||
│ WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE │
|
||||
│ AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL │
|
||||
│ DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR │
|
||||
│ PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER │
|
||||
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
||||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/zip.h"
|
||||
|
||||
/**
|
||||
* Returns comment of zip central directory.
|
||||
*/
|
||||
void *GetZipCdirComment(const uint8_t *eocd) {
|
||||
if (READ32LE(eocd) == kZipCdir64HdrMagic) {
|
||||
return ZIP_CDIR64_COMMENT(eocd);
|
||||
} else {
|
||||
return ZIP_CDIR_COMMENT(eocd);
|
||||
}
|
||||
}
|
30
libc/str/getzipcdircommentsize.c
Normal file
30
libc/str/getzipcdircommentsize.c
Normal file
|
@ -0,0 +1,30 @@
|
|||
/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:2;tab-width:8;coding:utf-8 -*-│
|
||||
│vi: set net ft=c ts=2 sts=2 sw=2 fenc=utf-8 :vi│
|
||||
╞══════════════════════════════════════════════════════════════════════════════╡
|
||||
│ Copyright 2021 Justine Alexandra Roberts Tunney │
|
||||
│ │
|
||||
│ Permission to use, copy, modify, and/or distribute this software for │
|
||||
│ any purpose with or without fee is hereby granted, provided that the │
|
||||
│ above copyright notice and this permission notice appear in all copies. │
|
||||
│ │
|
||||
│ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL │
|
||||
│ WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED │
|
||||
│ WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE │
|
||||
│ AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL │
|
||||
│ DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR │
|
||||
│ PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER │
|
||||
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
||||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/zip.h"
|
||||
|
||||
/**
|
||||
* Returns comment of zip central directory.
|
||||
*/
|
||||
uint64_t GetZipCdirCommentSize(const uint8_t *eocd) {
|
||||
if (READ32LE(eocd) == kZipCdir64HdrMagic) {
|
||||
return ZIP_CDIR64_COMMENTSIZE(eocd);
|
||||
} else {
|
||||
return ZIP_CDIR_COMMENTSIZE(eocd);
|
||||
}
|
||||
}
|
|
@ -184,6 +184,8 @@ bool IsZipCdir64(const uint8_t *, size_t, size_t);
|
|||
int GetZipCfileMode(const uint8_t *);
|
||||
uint64_t GetZipCdirOffset(const uint8_t *);
|
||||
uint64_t GetZipCdirRecords(const uint8_t *);
|
||||
void *GetZipCdirComment(const uint8_t *);
|
||||
uint64_t GetZipCdirCommentSize(const uint8_t *);
|
||||
uint64_t GetZipCfileUncompressedSize(const uint8_t *);
|
||||
uint64_t GetZipCfileCompressedSize(const uint8_t *);
|
||||
uint64_t GetZipCfileOffset(const uint8_t *);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue