path
stringlengths
14
112
content
stringlengths
0
6.32M
size
int64
0
6.32M
max_lines
int64
1
100k
repo_name
stringclasses
2 values
autogenerated
bool
1 class
cosmopolitan/tool/net/demo/.reload.lua
-- special script called by main redbean process on invalidate
63
2
jart/cosmopolitan
false
cosmopolitan/tool/net/demo/redbean-xhr.lua
-- redbean xhr handler demo hdr = GetHeader('x-custom-header') if hdr then SetHeader('Vary', 'X-Custom-Header') SetHeader('X-Custom-Header', 'hello ' .. hdr) else ServeError(400) end
192
9
jart/cosmopolitan
false
cosmopolitan/tool/net/demo/binarytrees.lua
-- binary trees: benchmark game -- with resource limit tutorial -- by justine tunney local outofcpu = false local oldsigxcpufunc = nil local oldsigxcpuflags = nil local oldsigxcpumask = nil -- This is our signal handler. function OnSigxcpu(sig) -- Please note, it's dangerous to do complicated things from inside ...
6,077
190
jart/cosmopolitan
false
cosmopolitan/tool/net/demo/404.html
<!doctype html> <title>404 not found</title> <pre aria-label="404 not found"> _ _ ___ _ _ _ __ _ | || | / _ \| || | _ __ ___ | |_ / _| ___ _ _ _ __ __| | | || |_| | | | || |_ | '_ \ / _ \| __| | |_ / _ \| | | | '_ \ / _` | |__ _| |_| |__ _| | | | | (_...
436
12
jart/cosmopolitan
false
cosmopolitan/tool/net/demo/store-asset.lua
-- StoreAsset Demo -- -- Redbean is able to store files into its own executable structure. -- This is currently only supported on a Linux, Apple, and FreeBSD. -- -- By loading this page, your redbean will insert an immediate file into -- your redbean named `/hi`, which you can click the back button in the -- browser an...
2,228
81
jart/cosmopolitan
false
cosmopolitan/tool/net/demo/redbean-form.lua
-- redbean post request handler demo local function main() if GetMethod() ~= 'POST' then ServeError(405) SetHeader('Allow', 'POST') return end SetStatus(200) SetHeader('Content-Type', 'text/html; charset=utf-8') Write('<!doctype html>\r\n') Write('<title>redbean</title>\r\n') Wri...
1,683
71
jart/cosmopolitan
false
cosmopolitan/tool/net/demo/call-lua-module.lua
-- Call Lua Module Demo -- -- Your Lua modules may be stored in the /.lua/ folder. -- -- In our /.init.lua global scope earlier, we ran the code: -- -- mymodule = require "mymodule" -- -- Which preloaded the /.lua/mymodule.lua module once into the server -- global memory template from which all request handlers are ...
1,558
50
jart/cosmopolitan
false
cosmopolitan/tool/net/demo/redbean.css
html { font-family: sans-serif; font-size: 14pt; } body { max-width: 700px; min-width: 700px; margin: 0 auto 0 auto; } pre, code { font-family: monospace; font-size: 12pt; } p { text-align: justify; } .indent { margin-left: 1em; } h1, h2 { margin: 1.5em 0 1.5em 0; } h1 strong { font-size: 14...
426
44
jart/cosmopolitan
false
cosmopolitan/tool/net/demo/printpayload.lua
local function main() if GetMethod() ~= 'POST' and GetMethod() ~= 'PUT' then ServeError(405) SetHeader('Allow', 'POST, PUT') return end SetStatus(200) SetHeader("Content-Type", GetHeader("Content-Type") or "text/plain") Write(GetBody()) end main()
282
13
jart/cosmopolitan
false
cosmopolitan/tool/net/demo/fetch.lua
-- Fetch() API Demo local function WriteForm(url) Write([[<!doctype html> <title>redbean fetch demo</title> <style> body { padding: 1em; } h1 a { color: inherit; text-decoration: none; } h1 img { border: none; vertical-align: middle; } input { margin: 1em; padding: .5em; } ...
2,388
75
jart/cosmopolitan
false
cosmopolitan/tool/net/demo/maxmind.lua
-- redbean maxmind demo -- by justine tunney local maxmind = require "maxmind" local kMetroCodes = { [500] = "Portland-Auburn ME", [501] = "New York NY", [502] = "Binghamton NY", [503] = "Macon GA", [504] = "Philadelphia PA", [505] = "Detroit MI", [506] = "Boston MA-Manchester NH", [507] = "Sa...
11,096
357
jart/cosmopolitan
false
cosmopolitan/tool/net/demo/sql-backup.lua
if GetAssetSize("backup.sqlite3") == nil then Write("no backup exists. call <a href='sql-backupstore.lua'>sql-backupstore.lua</a> first.") return end backup = sqlite3.open_memory() buffer = LoadAsset("backup.sqlite3") backup:deserialize(buffer) -- insert more values for i = 1, 250 do backup:exec("INSERT INT...
503
19
jart/cosmopolitan
false
cosmopolitan/tool/net/demo/unix-dir.lua
Write('<!doctype html>\r\n') Write('<title>redbean</title>\r\n') Write('<style>\r\n') Write('td,th { padding: 2px 5px; }\r\n') Write('td { white-space: nowrap; }\r\n') Write('.l { text-align: left; }\r\n') Write('.r { text-align: right; }\r\n') Write('</style>\r\n') Write('<h3>UNIX Directory Stream Demo</h3>\r\n') Wri...
2,905
94
jart/cosmopolitan
false
cosmopolitan/tool/net/demo/opensource.lua
Write('This Lua Server Page is stored in ZIP\r\n') Write('as normal Lua code that is compressed\r\n')
102
3
jart/cosmopolitan
false
cosmopolitan/tool/net/demo/sql-backupstore.lua
buffer = db:serialize() StoreAsset("backup.sqlite3", buffer) Write("backup created. size: "..GetAssetSize("backup.sqlite3"))
125
4
jart/cosmopolitan
false
cosmopolitan/tool/net/demo/unix-info.lua
local unix = require 'unix' Write('<!doctype html>\r\n') Write('<title>redbean</title>\r\n') Write('<h3>UNIX Information Demo</h3>\r\n') Write('<style>dt { margin: .5em 0; font-style:italic; }</style>\r\n') Write('<dl>\r\n') Write('<dt>unix.getuid()\r\n') Write('<dd>%d\r\n' % {unix.getuid()}) Write('<dt>unix.getgid()...
9,486
301
jart/cosmopolitan
false
cosmopolitan/tool/net/demo/index.html
<!doctype html> <meta charset="utf-8"> <title>redbean</title> <link rel="stylesheet" href="redbean.css"> <img src="/redbean.png" class="logo" width="84" height="84"> <h2> <big>redbean</big><br> <small>distributable static web server</small> </h2> <p> Here's what you need to know about redbean: <ul> <li>million...
897
30
jart/cosmopolitan
false
cosmopolitan/tool/net/demo/gensvg.lua
local top = [[ <!DOCTYPE html> <html lang=en> <head> <link rel="icon" href="data:;base64,iVBORw0KGgo="> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta name="description" content="description"> <...
2,933
78
jart/cosmopolitan
false
cosmopolitan/tool/net/demo/unix-finger.lua
-- UNIX Finger Example local function WriteForm(host, user) Write([[<!doctype html> <title>redbean unix finger demo</title> <style> body { padding: 1em; } h1 a { color: inherit; text-decoration: none; } h1 img { border: none; vertical-align: middle; } input { margin: .5em; padd...
2,313
71
jart/cosmopolitan
false
cosmopolitan/tool/net/demo/unix-unix.lua
-- UNIX Domain Sockets Example -- So we can detect that child died. died = false function OnSigchld(sig) died = true unix.wait() -- Prevent it from becoming a zombie end assert(unix.sigaction(unix.SIGCHLD, OnSigchld)) -- So keyboard interurpts only go to subprocess. oldint = assert(unix.sigaction(unix.SIGINT, u...
2,684
90
jart/cosmopolitan
false
cosmopolitan/tool/net/demo/redbean.lua
-- redbean lua server page demo local function main() -- This is the best way to print data to the console or log file. Log(kLogWarn, "hello from \e[1mlua\e[0m!") -- This check is pedantic but might be good to have. if GetMethod() ~= 'GET' and GetMethod() ~= 'HEAD' then ServeError(405) SetHead...
11,486
351
jart/cosmopolitan
false
cosmopolitan/tool/net/demo/hitcounter.lua
Write([[<!doctype html> <title>redbean mapshared demo</title> <style> body { padding: 1em; } h1 a { color: inherit; text-decoration: none; } h1 img { border: none; vertical-align: middle; } input { margin: 1em; padding: .5em; } pre { margin-left: 2em; } p { word-break: break-word; max-width: 650px; } dt {...
845
36
jart/cosmopolitan
false
cosmopolitan/tool/net/demo/unix-webserver.lua
-- webserver within a webserver demo -- we must go deeper! local unix = require 'unix' function OnTerm(sig) -- prevent redbean core from writing a response unix.write(mainfd, 'redbean is shutting down\r\n') unix.close(mainfd) end function main() if IsClientUsingSsl() then ServeError(400) retu...
4,104
113
jart/cosmopolitan
false
cosmopolitan/tool/net/demo/unix-raise.lua
#!/home/jart/bin/redbean -i assert(unix.sigaction(unix.SIGUSR1, function(sig) gotsigusr1 = true end)) gotsigusr1 = false assert(unix.raise(unix.SIGUSR1)) if gotsigusr1 then print('hooray the signal was delivered') else print('oh no some other signal was handled') end
277
12
jart/cosmopolitan
false
cosmopolitan/tool/net/demo/script.lua
#!/usr/bin/redbean -i print('hello world')
43
3
jart/cosmopolitan
false
cosmopolitan/tool/net/demo/.init.lua
mymodule = require "mymodule" sqlite3 = require "lsqlite3" -- ddos protection ProgramTokenBucket() -- /.init.lua is loaded at startup in redbean's main process HidePath('/usr/share/zoneinfo/') HidePath('/usr/share/ssl/') -- open a browser tab using explorer/open/xdg-open LaunchBrowser('/tool/net/demo/index.html') -...
2,565
96
jart/cosmopolitan
false
cosmopolitan/tool/net/demo/crashreport.lua
globalvar1 = 31337 globalvar2 = { hello = 'world', } function dosomething(param1, x) local res local y y = 0 SetStatus(200) SetHeader('Content-Type', 'text/plain; charset=utf-8') Write('preprae to crash... now\r\n') res = x / y Write('42 / 0 is %d\r\n' % {res}) end function start(param1) ...
422
29
jart/cosmopolitan
false
cosmopolitan/tool/net/demo/unix-subprocess.lua
-- example of how to run the ls command -- and pipe its output to the http user local unix = require "unix" function main() if GetHostOs() == 'WINDOWS' then cmd = 'dir' else cmd = 'ls' end ls = assert(unix.commandv(cmd)) reader, writer = assert(unix.pipe(unix.O_CLOEXEC)) oldint = assert(un...
1,652
56
jart/cosmopolitan
false
cosmopolitan/tool/net/demo/unix-rawsocket.lua
local unix = require 'unix' local function main() if GetMethod() ~= 'GET' and GetMethod() ~= 'HEAD' then ServeError(405) SetHeader('Allow', 'GET, HEAD') return end if IsClientUsingSsl() then SetStatus(400) SetHeader('Content-Type', 'text/html; charset=utf-8') Write('<!docty...
3,843
115
jart/cosmopolitan
false
cosmopolitan/tool/net/demo/closedsource.lua
Write('This Lua Server Page is stored in ZIP\r\n') Write('as compressed byte code, see luac.com and net.mk\r\n')
113
3
jart/cosmopolitan
false
cosmopolitan/tool/net/demo/finger.lua
-- fingerprinting example Write[[<!doctype html> <title>redbean binary trees</title> <style> body { padding: 1em; } h1 a { color: inherit; text-decoration: none; } h1 img { border: none; vertical-align: middle; } input { margin: 1em; padding: .5em; } p { word-break: break-word; max-width: 650px; } dt { f...
1,848
66
jart/cosmopolitan
false
cosmopolitan/tool/net/demo/.lua/mymodule.lua
local mymodule = {} function mymodule.hello() Write("<b>Hello World!</b>\r\n") end return mymodule
104
8
jart/cosmopolitan
false
cosmopolitan/tool/net/tiny/help.txt
SYNOPSIS redbean.com [-hvduzmbagf] [-p PORT] [-D DIR] DESCRIPTION redbean - single-file distributable web server DOCUMENTATION This binary was built in MODE=tiny or MODE=tinylinux You can view documentation online at https://redbean.dev/
251
13
jart/cosmopolitan
false
cosmopolitan/tool/hash/hash.mk
#-*-mode:makefile-gmake;indent-tabs-mode:t;tab-width:8;coding:utf-8-*-┐ #───vi: set et ft=make ts=8 tw=8 fenc=utf-8 :vi───────────────────────┘ PKGS += TOOL_HASH TOOL_HASH_SRCS := $(wildcard tool/hash/*.c) TOOL_HASH_OBJS = \ $(TOOL_HASH_SRCS:%.c=o/$(MODE)/%...
1,140
49
jart/cosmopolitan
false
cosmopolitan/tool/hash/crctab.c
/*-*- 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│ ╞═════════════════════════════════════════════════â•...
2,550
50
jart/cosmopolitan
false
cosmopolitan/tool/plinko/plinko.mk
#-*-mode:makefile-gmake;indent-tabs-mode:t;tab-width:8;coding:utf-8-*-┐ #───vi: set et ft=make ts=8 tw=8 fenc=utf-8 :vi───────────────────────┘ ifeq ($(ARCH), x86_64) PKGS += TOOL_PLINKO TOOL_PLINKO_SRCS := $(wildcard tool/plinko/*.c) TOOL_PLINKO_OBJS = \...
1,936
74
jart/cosmopolitan
false
cosmopolitan/tool/plinko/README.txt
DESCRIPTION plinko is a simple lisp interpreter that takes advantage of advanced operating system features irrespective of their practicality such as using the nsa instruction popcount for mark sweep garbage collection overcommit memory, segment registers, and other dirty hacks that the popular interpreters ...
1,078
36
jart/cosmopolitan
false
cosmopolitan/tool/plinko/plinko.c
/*-*- 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│ ╞═════════════════════════════════════════════════â•...
2,028
29
jart/cosmopolitan
false
cosmopolitan/tool/plinko/lib/iswide.c
/*-*- 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│ ╞═════════════════════════════════════════════════â•...
18,302
344
jart/cosmopolitan
false
cosmopolitan/tool/plinko/lib/ok.lisp
#| plinko - a really fast lisp tarpit | Copyright 2022 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...
848
19
jart/cosmopolitan
false
cosmopolitan/tool/plinko/lib/infix.lisp
#| plinko - a really fast lisp tarpit | Copyright 2022 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...
6,603
181
jart/cosmopolitan
false
cosmopolitan/tool/plinko/lib/isdelegate.c
/*-*- 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│ ╞═════════════════════════════════════════════════â•...
2,638
56
jart/cosmopolitan
false
cosmopolitan/tool/plinko/lib/setup.c
/*-*- 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│ ╞═════════════════════════════════════════════════â•...
5,896
140
jart/cosmopolitan
false
cosmopolitan/tool/plinko/lib/histo.h
#ifndef COSMOPOLITAN_TOOL_PLINKO_LIB_HISTO_H_ #define COSMOPOLITAN_TOOL_PLINKO_LIB_HISTO_H_ #include "libc/intrin/bsr.h" #include "libc/macros.internal.h" #if !(__ASSEMBLER__ + __LINKER__ + 0) COSMOPOLITAN_C_START_ #define HISTO(H, X) \ do { \ uint64_t x_ = X; ...
636
21
jart/cosmopolitan
false
cosmopolitan/tool/plinko/lib/binarytrees.lisp
#| plinko - a really fast lisp tarpit | Copyright 2022 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...
3,471
94
jart/cosmopolitan
false
cosmopolitan/tool/plinko/lib/lib.mk
#-*-mode:makefile-gmake;indent-tabs-mode:t;tab-width:8;coding:utf-8-*-┐ #───vi: set et ft=make ts=8 tw=8 fenc=utf-8 :vi───────────────────────┘ ifeq ($(ARCH), x86_64) PKGS += TOOL_PLINKO_LIB TOOL_PLINKO_LIB_ARTIFACTS += TOOL_PLINKO_LIB_A TOOL_PLINKO_LIB = $(TOO...
2,553
77
jart/cosmopolitan
false
cosmopolitan/tool/plinko/lib/char.h
#ifndef COSMOPOLITAN_TOOL_PLINKO_LIB_CHAR_H_ #define COSMOPOLITAN_TOOL_PLINKO_LIB_CHAR_H_ #if !(__ASSEMBLER__ + __LINKER__ + 0) COSMOPOLITAN_C_START_ static inline pureconst bool IsC0(int c) { return (0 <= c && c < 32) || c == 0177; } static inline pureconst bool IsDigit(int c) { return L'0' <= c && c <= L'9'; } ...
1,108
44
jart/cosmopolitan
false
cosmopolitan/tool/plinko/lib/isycombinator.c
/*-*- 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│ ╞═════════════════════════════════════════════════â•...
7,066
173
jart/cosmopolitan
false
cosmopolitan/tool/plinko/lib/printchar.c
/*-*- 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│ ╞═════════════════════════════════════════════════â•...
2,447
43
jart/cosmopolitan
false
cosmopolitan/tool/plinko/lib/getlongsum.c
/*-*- 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│ ╞═════════════════════════════════════════════════â•...
2,098
33
jart/cosmopolitan
false
cosmopolitan/tool/plinko/lib/preplan.c
/*-*- 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│ ╞═════════════════════════════════════════════════â•...
4,208
110
jart/cosmopolitan
false
cosmopolitan/tool/plinko/lib/cmp.c
/*-*- 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│ ╞═════════════════════════════════════════════════â•...
4,184
85
jart/cosmopolitan
false
cosmopolitan/tool/plinko/lib/stack.h
#ifndef COSMOPOLITAN_TOOL_PLINKO_LIB_STACK_H_ #define COSMOPOLITAN_TOOL_PLINKO_LIB_STACK_H_ #include "libc/log/check.h" #include "tool/plinko/lib/error.h" #include "tool/plinko/lib/plinko.h" #if !(__ASSEMBLER__ + __LINKER__ + 0) COSMOPOLITAN_C_START_ #define SetFrame(r, x) \ do { \ if (r & NEED...
1,129
49
jart/cosmopolitan
false
cosmopolitan/tool/plinko/lib/pairlis.c
/*-*- 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│ ╞═════════════════════════════════════════════════â•...
2,251
36
jart/cosmopolitan
false
cosmopolitan/tool/plinko/lib/tree.h
#ifndef COSMOPOLITAN_TOOL_PLINKO_LIB_TREE_H_ #define COSMOPOLITAN_TOOL_PLINKO_LIB_TREE_H_ #include "tool/plinko/lib/cons.h" #include "tool/plinko/lib/plinko.h" #if !(__ASSEMBLER__ + __LINKER__ + 0) COSMOPOLITAN_C_START_ int PutTree(int, int, int); int GetTree(int, int); int GetTreeCount(int, int, int *); int Nod(int, ...
982
48
jart/cosmopolitan
false
cosmopolitan/tool/plinko/lib/enclose.c
/*-*- 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│ ╞═════════════════════════════════════════════════â•...
3,253
77
jart/cosmopolitan
false
cosmopolitan/tool/plinko/lib/printint.c
/*-*- 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│ ╞═════════════════════════════════════════════════â•...
2,577
46
jart/cosmopolitan
false
cosmopolitan/tool/plinko/lib/library.lisp
#| plinko - a really fast lisp tarpit | Copyright 2022 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...
15,327
571
jart/cosmopolitan
false
cosmopolitan/tool/plinko/lib/makesclosures.c
/*-*- 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│ ╞═════════════════════════════════════════════════â•...
2,509
50
jart/cosmopolitan
false
cosmopolitan/tool/plinko/lib/evlis.c
/*-*- 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│ ╞═════════════════════════════════════════════════â•...
2,112
28
jart/cosmopolitan
false
cosmopolitan/tool/plinko/lib/index.h
#ifndef COSMOPOLITAN_TOOL_PLINKO_LIB_INDEX_H_ #define COSMOPOLITAN_TOOL_PLINKO_LIB_INDEX_H_ #include "tool/plinko/lib/error.h" #include "tool/plinko/lib/plinko.h" #include "tool/plinko/lib/stack.h" #if !(__ASSEMBLER__ + __LINKER__ + 0) COSMOPOLITAN_C_START_ forceinline nosideeffect int Head(int x) { if (x <= 0) retu...
2,879
136
jart/cosmopolitan
false
cosmopolitan/tool/plinko/lib/readstring.c
/*-*- 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│ ╞═════════════════════════════════════════════════â•...
3,139
75
jart/cosmopolitan
false
cosmopolitan/tool/plinko/lib/desymbolize.c
/*-*- 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│ ╞═════════════════════════════════════════════════â•...
3,555
76
jart/cosmopolitan
false
cosmopolitan/tool/plinko/lib/trace.h
#ifndef COSMOPOLITAN_TOOL_PLINKO_LIB_TRACE_H_ #define COSMOPOLITAN_TOOL_PLINKO_LIB_TRACE_H_ #include "libc/str/str.h" #if !(__ASSEMBLER__ + __LINKER__ + 0) COSMOPOLITAN_C_START_ #define START_TRACE \ bool t; \ PairFn *pf; \ BindFn *bf; ...
1,277
42
jart/cosmopolitan
false
cosmopolitan/tool/plinko/lib/plinko.h
#ifndef COSMOPOLITAN_TOOL_PLINKO_LIB_PLINKO_H_ #define COSMOPOLITAN_TOOL_PLINKO_LIB_PLINKO_H_ #include "libc/limits.h" #include "libc/log/check.h" #include "libc/runtime/runtime.h" #include "tool/plinko/lib/config.h" #include "tool/plinko/lib/types.h" #if !(__ASSEMBLER__ + __LINKER__ + 0) COSMOPOLITAN_C_START_ #define...
8,906
338
jart/cosmopolitan
false
cosmopolitan/tool/plinko/lib/gc.c
/*-*- 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│ ╞═════════════════════════════════════════════════â•...
4,741
157
jart/cosmopolitan
false
cosmopolitan/tool/plinko/lib/prettyprint.c
/*-*- 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│ ╞═════════════════════════════════════════════════â•...
4,494
131
jart/cosmopolitan
false
cosmopolitan/tool/plinko/lib/plinko.c
/*-*- 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│ ╞═════════════════════════════════════════════════â•...
30,475
1,070
jart/cosmopolitan
false
cosmopolitan/tool/plinko/lib/cons.h
#ifndef COSMOPOLITAN_TOOL_PLINKO_LIB_CONS_H_ #define COSMOPOLITAN_TOOL_PLINKO_LIB_CONS_H_ #include "tool/plinko/lib/error.h" #include "tool/plinko/lib/plinko.h" #include "tool/plinko/lib/types.h" #if !(__ASSEMBLER__ + __LINKER__ + 0) COSMOPOLITAN_C_START_ forceinline void Set(int i, dword t) { #ifndef NDEBUG DCHECK_...
1,553
68
jart/cosmopolitan
false
cosmopolitan/tool/plinko/lib/printf.h
#ifndef COSMOPOLITAN_TOOL_PLINKO_LIB_PRINTF_H_ #define COSMOPOLITAN_TOOL_PLINKO_LIB_PRINTF_H_ #if !(__ASSEMBLER__ + __LINKER__ + 0) COSMOPOLITAN_C_START_ int Printf(const char *, ...); int Fprintf(int, const char *, ...); int Fnprintf(int, int, const char *, ...); int Vfprintf(const char *, va_list, int); int Vfnprint...
476
15
jart/cosmopolitan
false
cosmopolitan/tool/plinko/lib/algebra.lisp
#| plinko - a really fast lisp tarpit | Copyright 2022 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...
17,776
484
jart/cosmopolitan
false
cosmopolitan/tool/plinko/lib/char.c
/*-*- 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│ ╞═════════════════════════════════════════════════â•...
2,567
60
jart/cosmopolitan
false
cosmopolitan/tool/plinko/lib/error.c
/*-*- 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│ ╞═════════════════════════════════════════════════â•...
2,658
58
jart/cosmopolitan
false
cosmopolitan/tool/plinko/lib/iscar.c
/*-*- 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│ ╞═════════════════════════════════════════════════â•...
2,277
44
jart/cosmopolitan
false
cosmopolitan/tool/plinko/lib/ktpenc.h
#ifndef COSMOPOLITAN_TOOL_PLINKO_LIB_KTPENC_H_ #define COSMOPOLITAN_TOOL_PLINKO_LIB_KTPENC_H_ #if !(__ASSEMBLER__ + __LINKER__ + 0) COSMOPOLITAN_C_START_ extern const short kTpEnc[25]; COSMOPOLITAN_C_END_ #endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */ #endif /* COSMOPOLITAN_TOOL_PLINKO_LIB_KTPENC_H_ */
306
11
jart/cosmopolitan
false
cosmopolitan/tool/plinko/lib/index.c
/*-*- 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│ ╞═════════════════════════════════════════════════â•...
3,003
54
jart/cosmopolitan
false
cosmopolitan/tool/plinko/lib/types.h
#ifndef COSMOPOLITAN_TOOL_PLINKO_LIB_TYPES_H_ #define COSMOPOLITAN_TOOL_PLINKO_LIB_TYPES_H_ #if !(__ASSEMBLER__ + __LINKER__ + 0) COSMOPOLITAN_C_START_ typedef unsigned long dword; struct qword { dword ax; dword dx; }; COSMOPOLITAN_C_END_ #endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */ #endif /* COSMOPOLITAN_TOOL...
344
16
jart/cosmopolitan
false
cosmopolitan/tool/plinko/lib/countatoms.c
/*-*- 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│ ╞═════════════════════════════════════════════════â•...
2,059
26
jart/cosmopolitan
false
cosmopolitan/tool/plinko/lib/vars.c
/*-*- 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│ ╞═════════════════════════════════════════════════â•...
4,743
159
jart/cosmopolitan
false
cosmopolitan/tool/plinko/lib/hasatom.c
/*-*- 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│ ╞═════════════════════════════════════════════════â•...
2,020
26
jart/cosmopolitan
false
cosmopolitan/tool/plinko/lib/symbolize.c
/*-*- 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│ ╞═════════════════════════════════════════════════â•...
4,361
113
jart/cosmopolitan
false
cosmopolitan/tool/plinko/lib/printheap.c
/*-*- 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│ ╞═════════════════════════════════════════════════â•...
2,678
53
jart/cosmopolitan
false
cosmopolitan/tool/plinko/lib/plan.c
/*-*- 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│ ╞═════════════════════════════════════════════════â•...
13,566
375
jart/cosmopolitan
false
cosmopolitan/tool/plinko/lib/flush.c
/*-*- 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│ ╞═════════════════════════════════════════════════â•...
2,316
39
jart/cosmopolitan
false
cosmopolitan/tool/plinko/lib/dispatchycombine.c
/*-*- 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│ ╞═════════════════════════════════════════════════â•...
4,182
82
jart/cosmopolitan
false
cosmopolitan/tool/plinko/lib/read.c
/*-*- 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│ ╞═════════════════════════════════════════════════â•...
7,886
290
jart/cosmopolitan
false
cosmopolitan/tool/plinko/lib/planfuncalls.c
/*-*- 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│ ╞═════════════════════════════════════════════════â•...
2,668
56
jart/cosmopolitan
false
cosmopolitan/tool/plinko/lib/printtree.c
/*-*- 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│ ╞═════════════════════════════════════════════════â•...
2,241
34
jart/cosmopolitan
false
cosmopolitan/tool/plinko/lib/gc.h
#ifndef COSMOPOLITAN_TOOL_PLINKO_LIB_GC_H_ #define COSMOPOLITAN_TOOL_PLINKO_LIB_GC_H_ #include "tool/plinko/lib/types.h" #if !(__ASSEMBLER__ + __LINKER__ + 0) COSMOPOLITAN_C_START_ struct Gc { int A, B, C; unsigned n; unsigned noop; unsigned *P; dword M[]; }; int MarkSweep(int, int); struct Gc *NewGc(int); ...
805
35
jart/cosmopolitan
false
cosmopolitan/tool/plinko/lib/isconstant.c
/*-*- 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│ ╞═════════════════════════════════════════════════â•...
2,187
29
jart/cosmopolitan
false
cosmopolitan/tool/plinko/lib/bind.c
/*-*- 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│ ╞═════════════════════════════════════════════════â•...
2,751
57
jart/cosmopolitan
false
cosmopolitan/tool/plinko/lib/reverse.c
/*-*- 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│ ╞═════════════════════════════════════════════════â•...
2,037
31
jart/cosmopolitan
false
cosmopolitan/tool/plinko/lib/printf.c
/*-*- 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│ ╞═════════════════════════════════════════════════â•...
8,784
305
jart/cosmopolitan
false
cosmopolitan/tool/plinko/lib/expand.c
/*-*- 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│ ╞═════════════════════════════════════════════════â•...
3,200
81
jart/cosmopolitan
false
cosmopolitan/tool/plinko/lib/intern.c
/*-*- 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│ ╞═════════════════════════════════════════════════â•...
2,493
49
jart/cosmopolitan
false
cosmopolitan/tool/plinko/lib/printvars.c
/*-*- 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│ ╞═════════════════════════════════════════════════â•...
2,626
52
jart/cosmopolitan
false
cosmopolitan/tool/plinko/lib/countreferences.c
/*-*- 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│ ╞═════════════════════════════════════════════════â•...
3,113
72
jart/cosmopolitan
false
cosmopolitan/tool/plinko/lib/print.h
#ifndef COSMOPOLITAN_TOOL_PLINKO_LIB_PRINT_H_ #define COSMOPOLITAN_TOOL_PLINKO_LIB_PRINT_H_ #if !(__ASSEMBLER__ + __LINKER__ + 0) COSMOPOLITAN_C_START_ int Print(int, int); int PrettyPrint(int, int, int); bool ShouldForceDot(int); bool ShouldConcealClosure(int); int EnterPrint(int); int PrintArgs(int, int, int, int)...
811
32
jart/cosmopolitan
false
cosmopolitan/tool/plinko/lib/config.h
#ifndef COSMOPOLITAN_TOOL_PLINKO_LIB_CONFIG_H_ #define COSMOPOLITAN_TOOL_PLINKO_LIB_CONFIG_H_ #include "libc/dce.h" #define HISTO_ASSOC 0 #define HISTO_GARBAGE 0 #define DEBUG_TREE 0 #define DEBUG_CLOSURE 0 #define DEBUG_GARBAGE 0 #define DEBUG_MATCHER 0 #define EXPLAIN_GARBAGE 0 #define AVERSIVENESS ...
903
39
jart/cosmopolitan
false
cosmopolitan/tool/plinko/lib/error.h
#ifndef COSMOPOLITAN_TOOL_PLINKO_LIB_ERROR_H_ #define COSMOPOLITAN_TOOL_PLINKO_LIB_ERROR_H_ #if !(__ASSEMBLER__ + __LINKER__ + 0) COSMOPOLITAN_C_START_ void Raise(int) relegated wontreturn; void Error(const char *, ...) relegated wontreturn; void OutOfMemory(void) relegated wontreturn; void StackOverflow(void) relegat...
502
15
jart/cosmopolitan
false