mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-27 14:58:30 +00:00
Add scouts honor escape hatch for source embedding
This commit is contained in:
parent
c91b3c5006
commit
b4269930f7
547 changed files with 1516 additions and 944 deletions
|
@ -22,6 +22,7 @@
|
|||
#include "libc/stdio/internal.h"
|
||||
#include "libc/stdio/stdio.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/str/tpencode.h"
|
||||
|
||||
/**
|
||||
* Writes wide character to stream.
|
||||
|
@ -29,8 +30,8 @@
|
|||
* @return wc if written or -1 w/ errno
|
||||
*/
|
||||
wint_t fputwc(wchar_t wc, FILE *f) {
|
||||
unsigned i, len;
|
||||
char buf[MB_LEN_MAX];
|
||||
unsigned len, i;
|
||||
if (wc != -1) {
|
||||
len = tpencode(buf, sizeof(buf), wc, false);
|
||||
for (i = 0; i < len; ++i) {
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
│ 02110-1301 USA │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/macros.h"
|
||||
.yoink __FILE__
|
||||
.source __FILE__
|
||||
|
||||
fseeko: jmp fseek
|
||||
.endfn fseeko,globl
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
│ 02110-1301 USA │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/macros.h"
|
||||
.yoink __FILE__
|
||||
.source __FILE__
|
||||
|
||||
ftello: jmp ftell
|
||||
.endfn ftello,globl
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
#include "libc/calls/calls.h"
|
||||
#include "libc/sysv/consts/fileno.h"
|
||||
#include "libc/macros.h"
|
||||
.yoink __FILE__
|
||||
.source __FILE__
|
||||
|
||||
.init.start 400,_init_g_stderr
|
||||
lea g_stderr(%rip),%rax
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
#include "libc/calls/calls.h"
|
||||
#include "libc/sysv/consts/fileno.h"
|
||||
#include "libc/macros.h"
|
||||
.yoink __FILE__
|
||||
.source __FILE__
|
||||
|
||||
.init.start 400,_init_g_stdin
|
||||
lea g_stdin(%rip),%rax
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
#include "libc/calls/calls.h"
|
||||
#include "libc/sysv/consts/fileno.h"
|
||||
#include "libc/macros.h"
|
||||
.yoink __FILE__
|
||||
.source __FILE__
|
||||
|
||||
.init.start 400,_init_g_stdout
|
||||
lea g_stdout(%rip),%rax
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/macros.h"
|
||||
#include "libc/notice.inc"
|
||||
.yoink __FILE__
|
||||
.source __FILE__
|
||||
|
||||
getc: jmp fgetc
|
||||
.endfn getc,globl
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
│ 02110-1301 USA │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/macros.h"
|
||||
.yoink __FILE__
|
||||
.source __FILE__
|
||||
|
||||
/ Reads uint8_t from standard input.
|
||||
/ @return %al has result w/ rest of %rax cleared
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
│ 02110-1301 USA │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/macros.h"
|
||||
.yoink __FILE__
|
||||
.source __FILE__
|
||||
|
||||
getwc: jmp fgetwc
|
||||
.endfn getwc,globl
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
│ 02110-1301 USA │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/macros.h"
|
||||
.yoink __FILE__
|
||||
.source __FILE__
|
||||
|
||||
/ Reads Thompson-Pike encoded varint from standard input.
|
||||
/ @return %eax has result w/ rest of %rax cleared
|
||||
|
|
|
@ -17,8 +17,8 @@
|
|||
│ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA │
|
||||
│ 02110-1301 USA │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/macros.inc"
|
||||
.yoink __FILE__
|
||||
#include "libc/macros.h"
|
||||
.source __FILE__
|
||||
|
||||
putc: jmp fputc
|
||||
.endfn putc,globl
|
||||
|
|
|
@ -17,8 +17,8 @@
|
|||
│ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA │
|
||||
│ 02110-1301 USA │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/macros.inc"
|
||||
.yoink __FILE__
|
||||
#include "libc/macros.h"
|
||||
.source __FILE__
|
||||
|
||||
/ Writes wide character to stream.
|
||||
/ @param %edi is the wide character
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
│ 02110-1301 USA │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/macros.h"
|
||||
.yoink __FILE__
|
||||
.source __FILE__
|
||||
|
||||
clearerr_unlocked:
|
||||
.leafprologue
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
│ 02110-1301 USA │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/macros.h"
|
||||
.yoink __FILE__
|
||||
.source __FILE__
|
||||
|
||||
feof_unlocked:
|
||||
.leafprologue
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
│ 02110-1301 USA │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/macros.h"
|
||||
.yoink __FILE__
|
||||
.source __FILE__
|
||||
|
||||
ferror_unlocked:
|
||||
.leafprologue
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
│ 02110-1301 USA │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/macros.h"
|
||||
.yoink __FILE__
|
||||
.source __FILE__
|
||||
|
||||
fflush_unlocked:
|
||||
.leafprologue
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
│ 02110-1301 USA │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/macros.h"
|
||||
.yoink __FILE__
|
||||
.source __FILE__
|
||||
|
||||
fgetc_unlocked:
|
||||
.leafprologue
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
│ 02110-1301 USA │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/macros.h"
|
||||
.yoink __FILE__
|
||||
.source __FILE__
|
||||
|
||||
fgets_unlocked:
|
||||
.leafprologue
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
│ 02110-1301 USA │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/macros.h"
|
||||
.yoink __FILE__
|
||||
.source __FILE__
|
||||
|
||||
fgetwc_unlocked:
|
||||
.leafprologue
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
│ 02110-1301 USA │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/macros.h"
|
||||
.yoink __FILE__
|
||||
.source __FILE__
|
||||
|
||||
fgetws_unlocked:
|
||||
.leafprologue
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
│ 02110-1301 USA │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/macros.h"
|
||||
.yoink __FILE__
|
||||
.source __FILE__
|
||||
|
||||
fileno_unlocked:
|
||||
.leafprologue
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
│ 02110-1301 USA │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/macros.h"
|
||||
.yoink __FILE__
|
||||
.source __FILE__
|
||||
|
||||
fputc_unlocked:
|
||||
.leafprologue
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
│ 02110-1301 USA │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/macros.h"
|
||||
.yoink __FILE__
|
||||
.source __FILE__
|
||||
|
||||
fputs_unlocked:
|
||||
.leafprologue
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
│ 02110-1301 USA │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/macros.h"
|
||||
.yoink __FILE__
|
||||
.source __FILE__
|
||||
|
||||
fputwc_unlocked:
|
||||
.leafprologue
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
│ 02110-1301 USA │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/macros.h"
|
||||
.yoink __FILE__
|
||||
.source __FILE__
|
||||
|
||||
fputws_unlocked:
|
||||
.leafprologue
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
│ 02110-1301 USA │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/macros.h"
|
||||
.yoink __FILE__
|
||||
.source __FILE__
|
||||
|
||||
fread_unlocked:
|
||||
.leafprologue
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
│ 02110-1301 USA │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/macros.h"
|
||||
.yoink __FILE__
|
||||
.source __FILE__
|
||||
|
||||
fwrite_unlocked:
|
||||
.leafprologue
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
│ 02110-1301 USA │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/macros.h"
|
||||
.yoink __FILE__
|
||||
.source __FILE__
|
||||
|
||||
getc_unlocked:
|
||||
.leafprologue
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
│ 02110-1301 USA │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/macros.h"
|
||||
.yoink __FILE__
|
||||
.source __FILE__
|
||||
|
||||
getchar_unlocked:
|
||||
.leafprologue
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
│ 02110-1301 USA │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/macros.h"
|
||||
.yoink __FILE__
|
||||
.source __FILE__
|
||||
|
||||
getwc_unlocked:
|
||||
.leafprologue
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
│ 02110-1301 USA │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/macros.h"
|
||||
.yoink __FILE__
|
||||
.source __FILE__
|
||||
|
||||
getwchar_unlocked:
|
||||
.leafprologue
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
│ 02110-1301 USA │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/macros.h"
|
||||
.yoink __FILE__
|
||||
.source __FILE__
|
||||
|
||||
putc_unlocked:
|
||||
.leafprologue
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
│ 02110-1301 USA │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/macros.h"
|
||||
.yoink __FILE__
|
||||
.source __FILE__
|
||||
|
||||
putchar_unlocked:
|
||||
.leafprologue
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
│ 02110-1301 USA │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/macros.h"
|
||||
.yoink __FILE__
|
||||
.source __FILE__
|
||||
|
||||
putwc_unlocked:
|
||||
.leafprologue
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
│ 02110-1301 USA │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/macros.h"
|
||||
.yoink __FILE__
|
||||
.source __FILE__
|
||||
|
||||
putwchar_unlocked:
|
||||
.leafprologue
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue