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/decode/hex.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/decode/ar.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,328 | 147 | jart/cosmopolitan | false |
cosmopolitan/tool/decode/macho.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â
âââââââââââââââââââââââââââââââââââââââââââââââââââ... | 12,045 | 350 | jart/cosmopolitan | false |
cosmopolitan/tool/decode/zip2.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â
âââââââââââââââââââââââââââââââââââââââââââââââââââ... | 11,488 | 285 | jart/cosmopolitan | false |
cosmopolitan/tool/decode/mkcombos.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,100 | 122 | jart/cosmopolitan | false |
cosmopolitan/tool/decode/elf.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â
âââââââââââââââââââââââââââââââââââââââââââââââââââ... | 16,370 | 395 | jart/cosmopolitan | false |
cosmopolitan/tool/decode/mkwides.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,092 | 104 | jart/cosmopolitan | false |
cosmopolitan/tool/decode/peboff.c | #include "libc/nt/struct/peb.h"
#include "libc/stdio/stdio.h"
int main() {
printf("InheritedAddressSpace = 0x%x\n",
offsetof(struct NtPeb, InheritedAddressSpace));
printf("ReadImageFileExecOptions = 0x%x\n",
offsetof(struct NtPeb, ReadImageFileExecOptions));
printf("BeingDebugged = 0x%x\n", off... | 5,581 | 102 | jart/cosmopolitan | false |
cosmopolitan/tool/decode/lib/disassemblehex.h | #ifndef COSMOPOLITAN_TOOL_DECODE_LIB_DISASSEMBLEHEX_H_
#define COSMOPOLITAN_TOOL_DECODE_LIB_DISASSEMBLEHEX_H_
#define kDisassembleHexColumns 8
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
void disassemblehex(uint8_t *data, size_t size, FILE *f);
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKE... | 392 | 14 | jart/cosmopolitan | false |
cosmopolitan/tool/decode/lib/ntfileflagnames.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,580 | 51 | jart/cosmopolitan | false |
cosmopolitan/tool/decode/lib/titlegen.h | #ifndef COSMOPOLITAN_TOOL_DECODE_LIB_TITLEGEN_H_
#define COSMOPOLITAN_TOOL_DECODE_LIB_TITLEGEN_H_
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
struct Modeline {
const char *emacs;
const char *vim;
};
extern const struct Modeline kModelineAsm;
void showtitle(const char *brand, const char *tool, con... | 532 | 19 | jart/cosmopolitan | false |
cosmopolitan/tool/decode/lib/flagger.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,996 | 61 | jart/cosmopolitan | false |
cosmopolitan/tool/decode/lib/elfidnames.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â
âââââââââââââââââââââââââââââââââââââââââââââââââââ... | 10,045 | 266 | jart/cosmopolitan | false |
cosmopolitan/tool/decode/lib/asmcodegen.h | #ifndef COSMOPOLITAN_TOOL_DECODE_LIB_ASMCODEGEN_H_
#define COSMOPOLITAN_TOOL_DECODE_LIB_ASMCODEGEN_H_
#include "tool/decode/lib/idname.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
#define COLUMN_WIDTH 24
#define showint(x) show(".long", format(b1, "%d", x), #x)
#define showint64(x) show(".qu... | 1,094 | 28 | jart/cosmopolitan | false |
cosmopolitan/tool/decode/lib/peidnames.h | #ifndef COSMOPOLITAN_TOOL_DECODE_LIB_PEIDNAMES_H_
#define COSMOPOLITAN_TOOL_DECODE_LIB_PEIDNAMES_H_
#include "tool/decode/lib/idname.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
extern const struct IdName kNtImageFileMachineNames[];
extern const struct IdName kNtPeOptionalHeaderMagicNames[];
extern c... | 760 | 19 | jart/cosmopolitan | false |
cosmopolitan/tool/decode/lib/xederrors.h | #ifndef COSMOPOLITAN_TOOL_DECODE_LIB_XEDERRORS_H_
#define COSMOPOLITAN_TOOL_DECODE_LIB_XEDERRORS_H_
#include "tool/decode/lib/idname.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
extern const struct IdName kXedErrorIdNames[];
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /... | 367 | 12 | jart/cosmopolitan | false |
cosmopolitan/tool/decode/lib/decodelib.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_DECODE_LIB
TOOL_DECODE_LIB_ARTIFACTS += TOOL_DECODE_LIB_A
TOOL_DECODE_LIB = $(TOOL_DECODE_LIB_A_DEPS) $(T... | 2,269 | 62 | jart/cosmopolitan | false |
cosmopolitan/tool/decode/lib/titlegen.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,082 | 60 | jart/cosmopolitan | false |
cosmopolitan/tool/decode/lib/peidnames.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â
âââââââââââââââââââââââââââââââââââââââââââââââââââ... | 9,965 | 179 | jart/cosmopolitan | false |
cosmopolitan/tool/decode/lib/ntfileflagnames.h | #ifndef COSMOPOLITAN_TOOL_DECODE_LIB_NTFILEFLAGNAMES_H_
#define COSMOPOLITAN_TOOL_DECODE_LIB_NTFILEFLAGNAMES_H_
#include "tool/decode/lib/idname.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
extern const struct IdName kNtFileFlagNames[];
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0)... | 385 | 12 | jart/cosmopolitan | false |
cosmopolitan/tool/decode/lib/asmcodegen.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,863 | 61 | jart/cosmopolitan | false |
cosmopolitan/tool/decode/lib/bitabuilder.h | #ifndef COSMOPOLITAN_TOOL_DECODE_LIB_BITABUILDER_H_
#define COSMOPOLITAN_TOOL_DECODE_LIB_BITABUILDER_H_
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
struct FILE;
struct BitaBuilder;
struct BitaBuilder *bitabuilder_new(void);
bool bitabuilder_setbit(struct BitaBuilder *, size_t);
bool bitabuilder_fwrite(... | 535 | 16 | jart/cosmopolitan | false |
cosmopolitan/tool/decode/lib/xederrors.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,078 | 47 | jart/cosmopolitan | false |
cosmopolitan/tool/decode/lib/disassemblehex.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,970 | 61 | jart/cosmopolitan | false |
cosmopolitan/tool/decode/lib/zipnames.h | #ifndef COSMOPOLITAN_TOOL_DECODE_LIB_ZIPNAMES_H_
#define COSMOPOLITAN_TOOL_DECODE_LIB_ZIPNAMES_H_
#include "tool/decode/lib/idname.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
extern const struct IdName kZipCompressionNames[];
extern const struct IdName kZipExtraNames[];
extern const struct IdName kZ... | 543 | 16 | jart/cosmopolitan | false |
cosmopolitan/tool/decode/lib/idname.h | #ifndef COSMOPOLITAN_TOOL_DECODE_LIB_IDNAME_H_
#define COSMOPOLITAN_TOOL_DECODE_LIB_IDNAME_H_
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
struct IdName {
unsigned long id;
const char *const name;
};
const char *findnamebyid(const struct IdName *names, unsigned long id);
COSMOPOLITAN_C_END_
#endif... | 413 | 16 | jart/cosmopolitan | false |
cosmopolitan/tool/decode/lib/elfidnames.h | #ifndef COSMOPOLITAN_TOOL_DECODE_LIB_ELFIDNAMES_H_
#define COSMOPOLITAN_TOOL_DECODE_LIB_ELFIDNAMES_H_
#include "tool/decode/lib/idname.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
extern const struct IdName kElfTypeNames[];
extern const struct IdName kElfOsabiNames[];
extern const struct IdName kElfC... | 1,021 | 25 | jart/cosmopolitan | false |
cosmopolitan/tool/decode/lib/machoidnames.h | #ifndef COSMOPOLITAN_TOOL_DECODE_LIB_MACHOIDNAMES_H_
#define COSMOPOLITAN_TOOL_DECODE_LIB_MACHOIDNAMES_H_
#include "tool/decode/lib/idname.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
extern const struct IdName kMachoArchitectures[];
extern const struct IdName kMachoFileTypeNames[];
extern const stru... | 740 | 19 | jart/cosmopolitan | false |
cosmopolitan/tool/decode/lib/machoidnames.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â
âââââââââââââââââââââââââââââââââââââââââââââââââââ... | 9,124 | 189 | jart/cosmopolitan | false |
cosmopolitan/tool/decode/lib/x86idnames.h | #ifndef COSMOPOLITAN_TOOL_DECODE_LIB_X86IDNAMES_H_
#define COSMOPOLITAN_TOOL_DECODE_LIB_X86IDNAMES_H_
#include "tool/decode/lib/idname.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
extern const struct IdName kX86MarchNames[];
extern const struct IdName kX86GradeNames[];
COSMOPOLITAN_C_END_
#endif /* ... | 413 | 13 | jart/cosmopolitan | false |
cosmopolitan/tool/decode/lib/bitabuilder.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,030 | 77 | jart/cosmopolitan | false |
cosmopolitan/tool/decode/lib/socknames.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,784 | 54 | jart/cosmopolitan | false |
cosmopolitan/tool/decode/lib/flagger.h | #ifndef COSMOPOLITAN_TOOL_DECODE_LIB_FLAGGER_H_
#define COSMOPOLITAN_TOOL_DECODE_LIB_FLAGGER_H_
#include "tool/decode/lib/idname.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
char *RecreateFlags(const struct IdName *, unsigned long) dontdiscard;
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKE... | 385 | 12 | jart/cosmopolitan | false |
cosmopolitan/tool/decode/lib/socknames.h | #ifndef COSMOPOLITAN_TOOL_DECODE_LIB_SOCKNAMES_H_
#define COSMOPOLITAN_TOOL_DECODE_LIB_SOCKNAMES_H_
#include "tool/decode/lib/idname.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
extern const struct IdName kAddressFamilyNames[];
extern const struct IdName kSockTypeNames[];
extern const struct IdName k... | 509 | 15 | jart/cosmopolitan | false |
cosmopolitan/tool/decode/lib/idname.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 | 29 | jart/cosmopolitan | false |
cosmopolitan/tool/decode/lib/zipnames.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,496 | 74 | jart/cosmopolitan | false |
cosmopolitan/tool/scripts/powersave | #!/bin/sh
echo "powersave" | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
| 92 | 3 | jart/cosmopolitan | false |
cosmopolitan/tool/scripts/re | #!/bin/sh
readelf -Wa "$1" |
c++filt |
exec less
| 53 | 5 | jart/cosmopolitan | false |
cosmopolitan/tool/scripts/wut | #!/bin/sh
rm -f /tmp/wut-linux
(
grep -R "$1" ~/dox/susv4-2018/ | sed '
/meta.idx/d
' >/tmp/wut-posix
) &
(
grep -R "#define[[:blank:]]\+$1[[:blank:]]" ~/vendor/linux/include/ | sed '
/\/asm-/ {
/asm-\(x86\|generic\)/!d
}
s/\([^:]*\):\(.*\)/\2\t\t\t\1\t\1/
s/\(.*\)\/home\/jart\/vendor... | 2,275 | 99 | jart/cosmopolitan | false |
cosmopolitan/tool/scripts/cosmocc | #!/bin/sh
# replacement for cc command
#
# we assume you run the following beforehand
#
# sudo chmod 1777 /opt
# cd /opt
# git clone https://github.com/jart/cosmopolitan cosmo
# cd cosmo
# make -j
#
# you can then use it to build open source projects, e.g.
#
# export CC=cosmocc
# export CXX=... | 2,768 | 101 | jart/cosmopolitan | false |
cosmopolitan/tool/scripts/awk5 | #!/bin/sh
exec awk "$@" '{print $5}'
| 37 | 3 | jart/cosmopolitan | false |
cosmopolitan/tool/scripts/man2txt | #!/bin/sh
ASCII2UTF8=$(command -v ascii2utf8.com 2>/dev/null) || {
ASCII2UTF8=$(ls -1 o/*/tool/viz/ascii2utf8.com | head -n1)
}
for x; do
nroff -mandoc -rLL=80n -rLT=80n -Tutf8 <"$x" | $ASCII2UTF8
done
| 208 | 10 | jart/cosmopolitan | false |
cosmopolitan/tool/scripts/get-deps.py | #!/usr/bin/env python.com
#
# OVERVIEW
#
# One-Off Makefile Rule Generator
#
# EXAMPLES
#
# tool/scripts/get-deps.py examples/hello.c
# asmexpr 'mov $0,%ecx' 'vmovd %ecx,%xmm1' 'vpbroadcastb %xmm1,%ymm1' 'mov $0x20202032489001ff,%rax' 'vmovq %rax,%xmm0' 'vpcmpgtb %ymm1,%ymm0,%ymm2'
#
import os
import re
impo... | 907 | 39 | jart/cosmopolitan | false |
cosmopolitan/tool/scripts/grep | #!/bin/sh
exec grep \
--exclude=TAGS \
--exclude=HTAGS \
--exclude=*.com \
--exclude-dir=o \
--exclude-dir=gcc \
--exclude-dir=.git \
--exclude=archive-contents \
"$@"
| 292 | 11 | jart/cosmopolitan | false |
cosmopolitan/tool/scripts/asmexpr | #!/bin/sh
#
# OVERVIEW
#
# Micro-Experiment Assembler
#
# EXAMPLES
#
# asmexpr 'mov $8,%rax' 'bsr %rax,%rax'
# asmexpr 'mov $0,%ecx' 'vmovd %ecx,%xmm1' 'vpbroadcastb %xmm1,%ymm1' 'mov $0x20202032489001ff,%rax' 'vmovq %rax,%xmm0' 'vpcmpgtb %ymm1,%ymm0,%ymm2'
c=/tmp/asmexpr.c
s1=/tmp/asmexpr1.s
s2=/tmp/asmexpr... | 5,176 | 231 | jart/cosmopolitan | false |
cosmopolitan/tool/scripts/fix-third-party.py | #!/usr/bin/env python.com
#
# fix-third-party.py
# normalizes third party codebases to cosmopolitan style
#
# this script does the bulk of the work when it comes to fixing things
# like #include lines so they follow the local convention. this script
# won't get you all the way, but it'll get you pretty far w/ vendoring... | 2,542 | 92 | jart/cosmopolitan | false |
cosmopolitan/tool/scripts/explain-deps.py | #!/usr/bin/env python.com
import os
import re
import sys
def GetDeps(path):
def Dive(path, depth, visited):
sys.stdout.write('%s%s' % ('\t' * depth, path))
if path in visited:
sys.stdout.write(' cycle\n')
return
sys.stdout.write('\n')
with open(path) as f:
code = f.read()
for d... | 660 | 28 | jart/cosmopolitan | false |
cosmopolitan/tool/scripts/pb | #!/bin/sh
exec python.com -c "
# -*- coding: utf-8 -*-
import sys
from math import *
x = $*
s = x < 0
x = abs(x)
b = str(bin(x))[2:].replace('L', '')
n = len(b)
if n <= 8: n = 8
elif n <= 16: n = 16
elif n <= 32: n = 32
elif n <= 64: n = 64
sys.stdout.write(('%%s0b%%0%dd' % n) % ('-' if s else '', int(b)))
"
| 314 | 17 | jart/cosmopolitan | false |
cosmopolitan/tool/scripts/awk8 | #!/bin/sh
exec awk "$@" '{print $8}'
| 37 | 3 | jart/cosmopolitan | false |
cosmopolitan/tool/scripts/performance | #!/bin/sh
echo "performance" | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
| 94 | 3 | jart/cosmopolitan | false |
cosmopolitan/tool/scripts/awk6 | #!/bin/sh
exec awk "$@" '{print $6}'
| 37 | 3 | jart/cosmopolitan | false |
cosmopolitan/tool/scripts/bf | #!/bin/sh
bing.com <"$1" |
fold.com |
exec less
| 52 | 5 | jart/cosmopolitan | false |
cosmopolitan/tool/scripts/awk2 | #!/bin/sh
exec awk "$@" '{print $2}'
| 37 | 3 | jart/cosmopolitan | false |
cosmopolitan/tool/scripts/awk4 | #!/bin/sh
exec awk "$@" '{print $4}'
| 37 | 3 | jart/cosmopolitan | false |
cosmopolitan/tool/scripts/find-autonomous-objects | #-*-mode:sh;indent-tabs-mode:nil;tab-width:2;coding:utf-8-*-â
#âââvi: set net ft=sh ts=2 sts=2 fenc=utf-8 :viââââââââââââââ
for f; do
if [ $(nm $f | grep ' U ' | wc -l) -eq 0 ]; then
echo $f
fi
done
| 244 | 9 | jart/cosmopolitan | false |
cosmopolitan/tool/scripts/awk1 | #!/bin/sh
exec awk "$@" '{print $1}'
| 37 | 3 | jart/cosmopolitan | false |
cosmopolitan/tool/scripts/pe | #!/bin/sh
echo "# -*- coding: utf-8 -*-
import os
import sys
from math import *
s = str($*)
sys.stdout.write(s)
" >/tmp/pe
exec python.com /tmp/pe
| 147 | 10 | jart/cosmopolitan | false |
cosmopolitan/tool/scripts/bloat | #!/bin/sh
nm -C --size "$@" |
sort -r |
grep ' [bBtTRr] ' |
exec less
| 76 | 6 | jart/cosmopolitan | false |
cosmopolitan/tool/scripts/cosmoc++ | #!/bin/sh
# replacement for c++ command
#
# we assume you run the following beforehand
#
# sudo chmod 1777 /opt
# cd /opt
# git clone https://github.com/jart/cosmopolitan cosmo
# cd cosmo
# make -j
#
# you can then use it to build open source projects, e.g.
#
# export CC=cosmocc
# export CXX... | 2,834 | 99 | jart/cosmopolitan | false |
cosmopolitan/tool/scripts/awk3 | #!/bin/sh
exec awk "$@" '{print $3}'
| 37 | 3 | jart/cosmopolitan | false |
cosmopolitan/tool/scripts/ezgdb | #!/bin/sh
PROG="$1"
shift
exec gdb "$PROG" -ex "set args $*" -ex run
| 69 | 5 | jart/cosmopolitan | false |
cosmopolitan/tool/scripts/resurrect-file | #-*-mode:sh;indent-tabs-mode:nil;tab-width:2;coding:utf-8-*-â
#âââvi: set net ft=sh ts=2 sts=2 fenc=utf-8 :viââââââââââââââ
git checkout $(git rev-list -n 1 HEAD -- "$1")^ -- "${1:?FILE}"
| 225 | 5 | jart/cosmopolitan | false |
cosmopolitan/tool/scripts/renameheader | #!/usr/bin/env bash
FROM="${1?from}"
TO="${2?to}"
if [ -f "$TO" ]; then
rm -f "$FROM" || exit
else
mv "$FROM" "$TO" || exit
fi
sed -i -e "s/$(echo "${FROM//\//_}" | sed 's/\./_/' | tr a-z A-Z)_H_/$(echo "${TO//\//_}" | sed 's/\./_/' | tr a-z A-Z)_H_/" "$TO" || exit
tool/scripts/grep -nH -RPie "\"$FROM\"" |
too... | 394 | 16 | jart/cosmopolitan | false |
cosmopolitan/tool/scripts/awk7 | #!/bin/sh
exec awk "$@" '{print $7}'
| 37 | 3 | jart/cosmopolitan | false |
cosmopolitan/tool/scripts/loc | #!/bin/bash
echo $(( $(find ape dsp libc examples net test third_party tool -name \*.c | xargs cat | wc -l) +
$(find ape dsp libc examples net test third_party tool -name \*.h | xargs cat | wc -l) +
$(find ape dsp libc examples net test third_party tool -name \*.S | xargs cat | wc -l) +
$(... | 508 | 7 | jart/cosmopolitan | false |
cosmopolitan/tool/scripts/obj | #!/bin/sh
objdump -Cwd "$@" |
exec less
| 42 | 4 | jart/cosmopolitan | false |
cosmopolitan/tool/scripts/px | #!/bin/sh
exec python.com -c "
# -*- coding: utf-8 -*-
import sys
from math import *
x = $*
s = x < 0
x = abs(x)
b = str(hex(x))[2:].replace('L', '')
n = len(b)
if n <= 2: n = 2
elif n <= 4: n = 4
elif n <= 8: n = 8
elif n <= 12: n = 12
elif n <= 16: n = 16
sys.stdout.write(('%%s0x%%0%dx' % n) % ('-' if s else ... | 338 | 18 | jart/cosmopolitan | false |
cosmopolitan/tool/scripts/po | #!/bin/sh
exec python.com -c "
import sys
from math import *
s = str(oct($*).replace('o',''))
if len(s) > 1: s = s[1:]
b = s.replace('L', '')
n = len(b)
if n <= 3: n = 3
elif n <= 6: n = 6
elif n <= 11: n = 11
elif n <= 22: n = 22
sys.stdout.write(('0%%0%dd' % n) % int(b))
"
| 282 | 15 | jart/cosmopolitan | false |
cosmopolitan/tool/curl/curl.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_CURL
TOOL_CURL_ARTIFACTS += TOOL_CURL_A
TOOL_CURL = $(TOOL_CURL_DEPS) $(TOOL_CURL_A)
TOOL_CURL_A = o/$(MO... | 1,772 | 70 | jart/cosmopolitan | false |
cosmopolitan/tool/curl/curl.c | #if 0
/*ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
â To the extent possible under law, Justine Tunney has waived â
â all copyright and related or neighbo... | 12,931 | 443 | jart/cosmopolitan | false |
cosmopolitan/tool/curl/cmd.h | #ifndef COSMOPOLITAN_TOOL_CURL_CMD_H_
#define COSMOPOLITAN_TOOL_CURL_CMD_H_
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
int _curl(int, char *[]);
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_TOOL_CURL_CMD_H_ */
| 274 | 11 | jart/cosmopolitan | false |
cosmopolitan/tool/curl/cmd.c | #include "tool/curl/cmd.h"
int main(int argc, char *argv[]) {
return _curl(argc, argv);
}
| 93 | 6 | jart/cosmopolitan | false |
cosmopolitan/tool/build/zipobj.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â
âââââââââââââââââââââââââââââââââââââââââââââââââââ... | 6,339 | 186 | jart/cosmopolitan | false |
cosmopolitan/tool/build/compile.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â
âââââââââââââââââââââââââââââââââââââââââââââââââââ... | 39,701 | 1,448 | jart/cosmopolitan | false |
cosmopolitan/tool/build/dropcache.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,676 | 55 | jart/cosmopolitan | false |
cosmopolitan/tool/build/cocmd.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â
âââââââââââââââââââââââââââââââââââââââââââââââââââ... | 1,978 | 26 | jart/cosmopolitan | false |
cosmopolitan/tool/build/calculator.c | #if 0
/*ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
â To the extent possible under law, Justine Tunney has waived â
â all copyright and related or neighbo... | 15,324 | 748 | jart/cosmopolitan | false |
cosmopolitan/tool/build/deltaify.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,304 | 105 | jart/cosmopolitan | false |
cosmopolitan/tool/build/rollup.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,907 | 166 | jart/cosmopolitan | false |
cosmopolitan/tool/build/false.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â
âââââââââââââââââââââââââââââââââââââââââââââââââââ... | 1,886 | 23 | jart/cosmopolitan | false |
cosmopolitan/tool/build/dis.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â
âââââââââââââââââââââââââââââââââââââââââââââââââââ... | 10,068 | 319 | jart/cosmopolitan | false |
cosmopolitan/tool/build/fixupobj.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,623 | 218 | jart/cosmopolitan | false |
cosmopolitan/tool/build/mkdeps.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â
âââââââââââââââââââââââââââââââââââââââââââââââââââ... | 12,776 | 462 | jart/cosmopolitan | false |
cosmopolitan/tool/build/runit.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â
âââââââââââââââââââââââââââââââââââââââââââââââââââ... | 15,510 | 489 | jart/cosmopolitan | false |
cosmopolitan/tool/build/xlat.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â
âââââââââââââââââââââââââââââââââââââââââââââââââââ... | 9,105 | 331 | jart/cosmopolitan | false |
cosmopolitan/tool/build/runit.h | #ifndef COSMOPOLITAN_TOOL_BUILD_RUNIT_H_
#define COSMOPOLITAN_TOOL_BUILD_RUNIT_H_
#define RUNITD_PORT 31337
#define RUNITD_MAGIC 0xFEEDABEEu
#define RUNITD_TIMEOUT_MS (1000 * 60 * 60)
enum RunitCommand {
kRunitExecute,
kRunitStdout,
kRunitStderr,
kRunitExit,
};
#endif /* COSMOPOLITAN_TOOL_BUILD_RU... | 330 | 16 | jart/cosmopolitan | false |
cosmopolitan/tool/build/pstrace.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â
âââââââââââââââââââââââââââââââââââââââââââââââââââ... | 28,481 | 991 | jart/cosmopolitan | false |
cosmopolitan/tool/build/pwd.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,162 | 38 | jart/cosmopolitan | false |
cosmopolitan/tool/build/dd.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,500 | 161 | jart/cosmopolitan | false |
cosmopolitan/tool/build/x86combos.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,797 | 192 | jart/cosmopolitan | false |
cosmopolitan/tool/build/calculator.inc | M(2, g, "+", Add, x + y, "add")
M(2, g, "-", Sub, x - y, "sub")
M(2, g, "*", Mul, x *y, "multiply")
M(2, f, "/", Div, x / y, "division")
M(2, i, "%", Rem, x % y, "integer remainder")
M(2, i, "//", Idiv, x / y, "integer division")
M(2, g, "**", Expo, powl(x, y), "exponentiation")
M(1, i, "~", Not, ~x, "bitwise not")
M(... | 4,334 | 101 | jart/cosmopolitan | false |
cosmopolitan/tool/build/symtab.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,641 | 99 | jart/cosmopolitan | false |
cosmopolitan/tool/build/unveil.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,130 | 114 | jart/cosmopolitan | false |
cosmopolitan/tool/build/strace.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â
âââââââââââââââââââââââââââââââââââââââââââââââââââ... | 54,806 | 1,199 | jart/cosmopolitan | false |
cosmopolitan/tool/build/gzip.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,571 | 312 | jart/cosmopolitan | false |
cosmopolitan/tool/build/tinyemu.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,916 | 61 | jart/cosmopolitan | false |
cosmopolitan/tool/build/summy.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,193 | 36 | jart/cosmopolitan | false |
cosmopolitan/tool/build/rle.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,154 | 252 | jart/cosmopolitan | false |
cosmopolitan/tool/build/unbuffer.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,640 | 193 | jart/cosmopolitan | false |
cosmopolitan/tool/build/assimilate.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â
âââââââââââââââââââââââââââââââââââââââââââââââââââ... | 9,435 | 307 | jart/cosmopolitan | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.