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/net/http/unchunk.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,489
117
jart/cosmopolitan
false
cosmopolitan/net/http/khttptoken.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,692
73
jart/cosmopolitan
false
cosmopolitan/net/http/escapeurlview.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,275
39
jart/cosmopolitan
false
cosmopolitan/net/http/istestnetip.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
30
jart/cosmopolitan
false
cosmopolitan/net/http/csscolor.h
#ifndef COSMOPOLITAN_NET_HTTP_CSSCOLOR_H_ #define COSMOPOLITAN_NET_HTTP_CSSCOLOR_H_ #define ALICEBLUE 0xFFFFF8F0u #define ANTIQUEWHITE 0xFFD7EBFAu #define ANTIQUEWHITE1 0xFFDBEFFFu #define ANTIQUEWHITE2 0xFFCCDFEEu #define ANTIQUEWHITE3 0xFFB0C0CDu #define ANTIQUEWHITE4 0...
27,070
663
jart/cosmopolitan
false
cosmopolitan/net/http/isvalidhttptoken.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,223
38
jart/cosmopolitan
false
cosmopolitan/net/http/categorizeip.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,815
51
jart/cosmopolitan
false
cosmopolitan/net/http/tokenbucket.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,576
93
jart/cosmopolitan
false
cosmopolitan/net/http/escapeuser.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,175
32
jart/cosmopolitan
false
cosmopolitan/ape/macros.internal.h
/*-*- mode:unix-assembly; indent-tabs-mode:t; tab-width:8; coding:utf-8 -*-│ │vi: set et ft=asm ts=8 sw=8 fenc=utf-8 :vi│ ╞═════════════════════════════════════════════════â•...
9,836
293
jart/cosmopolitan
false
cosmopolitan/ape/relocations.h
#ifndef COSMOPOLITAN_APE_RELOCATIONS_H_ #define COSMOPOLITAN_APE_RELOCATIONS_H_ /*─────────────────────────────────────────────────────────────────────────────╗ │...
1,940
50
jart/cosmopolitan
false
cosmopolitan/ape/apeinstall.sh
#!/bin/sh if [ "$(id -u)" -eq 0 ]; then SUDO= else SUDO=sudo fi echo "Actually Portable Executable (APE) Installer" >&2 echo "Author: Justine Tunney <jtunney@gmail.com>" >&2 ################################################################################ # INSTALL APE LOADER SYSTEMWIDE if [ -f o/depend ]; the...
4,400
129
jart/cosmopolitan
false
cosmopolitan/ape/loader-elf.S
/*-*- mode:unix-assembly; indent-tabs-mode:t; tab-width:8; coding:utf-8 -*-│ │vi: set et ft=asm ts=8 tw=8 fenc=utf-8 :vi│ ╞═════════════════════════════════════════════════â•...
7,470
250
jart/cosmopolitan
false
cosmopolitan/ape/loader.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│ ╞═════════════════════════════════════════════════â•...
24,527
787
jart/cosmopolitan
false
cosmopolitan/ape/ape.S
/*-*- mode:unix-assembly; indent-tabs-mode:t; tab-width:8; coding:utf-8 -*-│ │vi: set et ft=asm ts=8 tw=8 fenc=utf-8 :vi│ ╞═════════════════════════════════════════════════â•...
82,422
1,967
jart/cosmopolitan
false
cosmopolitan/ape/loader-macho.lds
/*-*- mode: ld-script; indent-tabs-mode: nil; tab-width: 2; coding: utf-8 -*-│ │vi: set et sts=2 tw=2 fenc=utf-8 :vi│ ╞═════════════════════════════════════════════════â•...
2,175
43
jart/cosmopolitan
false
cosmopolitan/ape/sections.internal.h
#ifndef COSMOPOLITAN_APE_SECTIONS_INTERNAL_H_ #define COSMOPOLITAN_APE_SECTIONS_INTERNAL_H_ #if !(__ASSEMBLER__ + __LINKER__ + 0) COSMOPOLITAN_C_START_ extern unsigned char __executable_start[] __attribute__((__weak__)); extern unsigned char _ehead[] __attribute__((__weak__)); extern unsigned char _etext[] __attribute...
1,709
34
jart/cosmopolitan
false
cosmopolitan/ape/notice.inc
0
1
jart/cosmopolitan
false
cosmopolitan/ape/ape.internal.h
#ifndef COSMOPOLITAN_APE_APE_INTERNAL_H_ #define COSMOPOLITAN_APE_APE_INTERNAL_H_ #include "libc/dce.h" #if SupportsWindows() || SupportsMetal() || SupportsXnu() #define APE_IS_SHELL_SCRIPT #endif #endif /* COSMOPOLITAN_APE_APE_INTERNAL_H_ */
245
10
jart/cosmopolitan
false
cosmopolitan/ape/loader.lds
/*-*- mode: ld-script; indent-tabs-mode: nil; tab-width: 2; coding: utf-8 -*-│ │vi: set et sts=2 tw=2 fenc=utf-8 :vi│ ╞═════════════════════════════════════════════════â•...
2,185
44
jart/cosmopolitan
false
cosmopolitan/ape/ape.lds
/*-*- mode: ld-script; indent-tabs-mode: nil; tab-width: 2; coding: utf-8 -*-│ │vi: set et sts=2 tw=2 fenc=utf-8 :vi│ ╞═════════════════════════════════════════════════â•...
36,492
805
jart/cosmopolitan
false
cosmopolitan/ape/mz.ansi
ProTip: cat ape/mz.ansi ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀â–...
50,017
70
jart/cosmopolitan
false
cosmopolitan/ape/aarch64.lds
/*-*- mode: ld-script; indent-tabs-mode: nil; tab-width: 2; coding: utf-8 -*-│ │vi: set et sts=2 tw=2 fenc=utf-8 :vi│ ╚─────────────────────────────────────────────────â”...
8,703
293
jart/cosmopolitan
false
cosmopolitan/ape/apeuninstall.sh
#!/bin/sh if [ "$UID" = "0" ]; then SUDO= else SUDO=sudo fi { echo echo "APE Uninstaller intends to run (in pseudo-shell)" echo echo " sudo echo -1 into /proc/sys/fs/binfmt_misc/APE*" echo " sudo rm -f /usr/bin/ape ~/.ape o/tmp/.ape /tmp/.ape" echo echo "You may then use ape/apeinstall.sh to r...
547
27
jart/cosmopolitan
false
cosmopolitan/ape/ape-m1.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│ ╞═════════════════════════════════════════════════â•...
23,052
758
jart/cosmopolitan
false
cosmopolitan/ape/loader.h
#ifndef COSMOPOLITAN_APE_LOADER_H_ #define COSMOPOLITAN_APE_LOADER_H_ #define APE_LOADER_BASE 0x200000 #define APE_LOADER_SIZE 0x200000 #define APE_LOADER_ENTRY 0x200400 #define APE_LOADER_BSS (PAGESIZE * 2) #define APE_LOADER_STACK 0x7f0000000000 #define APE_BLOCK_BASE 0x7e0000000000 #define APE_BLOCK_SIZE 0x...
465
21
jart/cosmopolitan
false
cosmopolitan/ape/config.h
#ifndef COSMOPOLITAN_APE_CONFIG_H_ #define COSMOPOLITAN_APE_CONFIG_H_ #if !(__ASSEMBLER__ + __LINKER__ + 0) #define STATIC_SYMBOL(NAME, VALUE) \ asm(".equ\t" NAME "," VALUE "\n\t" \ ".globl\t" NAME) #endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */ #endif /* COSMOPOLITAN_APE_CONFIG_H_ */
298
11
jart/cosmopolitan
false
cosmopolitan/ape/loader-macho.S
/*-*- mode:unix-assembly; indent-tabs-mode:t; tab-width:8; coding:utf-8 -*-│ │vi: set et ft=asm ts=8 tw=8 fenc=utf-8 :vi│ ╞═════════════════════════════════════════════════â•...
4,714
139
jart/cosmopolitan
false
cosmopolitan/ape/idata.internal.h
/*-*- mode:unix-assembly; indent-tabs-mode:t; tab-width:8; coding:utf-8 -*-│ │vi: set et ft=asm ts=8 sw=8 fenc=utf-8 :vi│ ╞═════════════════════════════════════════════════â•...
4,686
123
jart/cosmopolitan
false
cosmopolitan/ape/ape.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───────────────────────┘ # # OVERVIEW # # αcτµαlly pδrταblε εxεcµταblε # # DESCRIPTION # # This file defines the libraries, run...
6,226
238
jart/cosmopolitan
false
cosmopolitan/ape/public/ape.lds
#include "ape/ape.lds"
23
2
jart/cosmopolitan
false
cosmopolitan/.github/FUNDING.yml
# These are supported funding model platforms github: [jart]
62
4
jart/cosmopolitan
false
cosmopolitan/.github/workflows/build.yml
name: build on: push: branches: - "master" - "flake" pull_request: branches: - "master" # run workflow manually from the Actions tab workflow_dispatch: jobs: matrix_on_mode: runs-on: ubuntu-latest strategy: matrix: mode: ["", tiny, opt, rel] steps: ...
649
32
jart/cosmopolitan
false
cosmopolitan/third_party/third_party.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───────────────────────┘ .PHONY: o/$(MODE)/third_party o/$(MODE)/third_party: \ o/$(MODE)/third_party/argon2 \ o/$(MODE)/third_party/awk ...
1,456
43
jart/cosmopolitan
false
cosmopolitan/third_party/sed/compile.c
// clang-format off /* $NetBSD: compile.c,v 1.48 2019/10/05 20:23:55 christos Exp $ */ /*- * Copyright (c) 1992 Diomidis Spinellis. * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by * Diomidis Spinelli...
25,760
1,112
jart/cosmopolitan
false
cosmopolitan/third_party/sed/sed.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 += THIRD_PARTY_SED THIRD_PARTY_SED = $(THIRD_PARTY_SED_A_DEPS) $(THIRD_PARTY_SED_A) THIRD_PARTY_SED_A = o/$(MODE)...
1,888
61
jart/cosmopolitan
false
cosmopolitan/third_party/sed/sed.1
.\" $NetBSD: sed.1,v 1.40 2014/06/25 02:05:58 uwe Exp $ .\" Copyright (c) 1992, 1993 .\" The Regents of the University of California. All rights reserved. .\" .\" This code is derived from software contributed to Berkeley by .\" the Institute of Electrical and Electronics Engineers, Inc. .\" .\" Redistribution and use...
17,350
641
jart/cosmopolitan
false
cosmopolitan/third_party/sed/extern.h
#ifndef COSMOPOLITAN_THIRD_PARTY_SED_EXTERN_H_ #define COSMOPOLITAN_THIRD_PARTY_SED_EXTERN_H_ #include "libc/calls/typedef/u.h" #include "libc/stdio/stdio.h" #include "third_party/regex/regex.h" #include "third_party/sed/defs.h" #if !(__ASSEMBLER__ + __LINKER__ + 0) COSMOPOLITAN_C_START_ // clang-format off extern str...
1,137
38
jart/cosmopolitan
false
cosmopolitan/third_party/sed/README.cosmo
DESCRIPTION sed is a stream editor program ORIGIN https://github.com/netbsd/src 6348f192439798ea49b672bb9a00490240376889 LOCAL CHANGES None.
154
13
jart/cosmopolitan
false
cosmopolitan/third_party/sed/README
SED(1) BSD General Commands Manual SED(1) 𝐍𝐀𝐌𝐄 𝘀𝗲𝗱 — stream editor 𝐒𝐘𝐍𝐎𝐏𝐒𝐈𝐒 𝘀𝗲𝗱 [-𝗮𝐄𝗹𝗻𝗿𝘂] c̲o̲m̲m̲a̲n̲d̲ [f̲i̲l̲e̲ .̲.̲.̲] 𝘀𝗲𝗱 [-𝗮𝐄𝗹𝗻𝗿𝘂] [-𝗲 c̲o...
19,014
387
jart/cosmopolitan
false
cosmopolitan/third_party/sed/main.c
/* $NetBSD: main.c,v 1.36 2020/05/15 22:39:54 christos Exp $ */ /*- * Copyright (c) 2013 Johann 'Myrkraverk' Oskarsson. * Copyright (c) 1992 Diomidis Spinellis. * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Ber...
12,508
532
jart/cosmopolitan
false
cosmopolitan/third_party/sed/process.c
/* $NetBSD: process.c,v 1.53 2020/05/15 22:39:54 christos Exp $ */ /*- * Copyright (c) 1992 Diomidis Spinellis. * Copyright (c) 1992, 1993, 1994 * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by * Diomidis Spinellis of Imperial C...
18,999
789
jart/cosmopolitan
false
cosmopolitan/third_party/sed/defs.h
#ifndef COSMOPOLITAN_THIRD_PARTY_SED_DEFS_H_ #define COSMOPOLITAN_THIRD_PARTY_SED_DEFS_H_ #include "libc/calls/typedef/u.h" #include "libc/limits.h" #include "third_party/regex/regex.h" #if !(__ASSEMBLER__ + __LINKER__ + 0) COSMOPOLITAN_C_START_ // clang-format off /* * Types of address specifications */ enum e_atyp...
2,948
127
jart/cosmopolitan
false
cosmopolitan/third_party/sed/misc.c
/* $NetBSD: misc.c,v 1.15 2014/06/26 02:14:32 christos Exp $ */ /*- * Copyright (c) 1992 Diomidis Spinellis. * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by * Diomidis Spinellis of Imperial College, U...
2,901
98
jart/cosmopolitan
false
cosmopolitan/third_party/sed/cmd.h
#ifndef COSMOPOLITAN_THIRD_PARTY_SED_CMD_H_ #define COSMOPOLITAN_THIRD_PARTY_SED_CMD_H_ #if !(__ASSEMBLER__ + __LINKER__ + 0) COSMOPOLITAN_C_START_ int _sed(int, char *[]); COSMOPOLITAN_C_END_ #endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */ #endif /* COSMOPOLITAN_THIRD_PARTY_SED_CMD_H_ */
291
11
jart/cosmopolitan
false
cosmopolitan/third_party/sed/cmd.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,934
24
jart/cosmopolitan
false
cosmopolitan/third_party/nsync/mu_wait.h
#ifndef NSYNC_MU_WAIT_H_ #define NSYNC_MU_WAIT_H_ #include "third_party/nsync/mu.h" #include "third_party/nsync/time.h" #if !(__ASSEMBLER__ + __LINKER__ + 0) COSMOPOLITAN_C_START_ /* nsync_mu_wait() and nsync_mu_wait_with_deadline() can be used instead of condition variables. In many straightforward situations they...
5,075
119
jart/cosmopolitan
false
cosmopolitan/third_party/nsync/compat.S
/*-*- mode:unix-assembly; indent-tabs-mode:t; tab-width:8; coding:utf-8 -*-│ │vi: set et ft=asm ts=8 tw=8 fenc=utf-8 :vi│ ╞═════════════════════════════════════════════════â•...
2,411
52
jart/cosmopolitan
false
cosmopolitan/third_party/nsync/mu_semaphore_gcd.c
/*-*- mode:c;indent-tabs-mode:t;c-basic-offset:8;tab-width:8;coding:utf-8 -*-│ │vi: set et ft=c ts=8 tw=8 fenc=utf-8 :vi│ ╞═════════════════════════════════════════════════â•...
4,400
100
jart/cosmopolitan
false
cosmopolitan/third_party/nsync/common.c
/*-*- mode:c;indent-tabs-mode:t;c-basic-offset:8;tab-width:8;coding:utf-8 -*-│ │vi: set et ft=c ts=8 tw=8 fenc=utf-8 :vi│ ╞═════════════════════════════════════════════════â•...
10,732
248
jart/cosmopolitan
false
cosmopolitan/third_party/nsync/mu_semaphore.c
/*-*- mode:c;indent-tabs-mode:t;c-basic-offset:8;tab-width:8;coding:utf-8 -*-│ │vi: set et ft=c ts=8 tw=8 fenc=utf-8 :vi│ ╞═════════════════════════════════════════════════â•...
3,402
73
jart/cosmopolitan
false
cosmopolitan/third_party/nsync/wait_s.internal.h
#ifndef COSMOPOLITAN_LIBC_THREAD_WAIT_INTERNAL_H_ #define COSMOPOLITAN_LIBC_THREAD_WAIT_INTERNAL_H_ #include "third_party/nsync/atomic.h" #include "third_party/nsync/dll.h" #if !(__ASSEMBLER__ + __LINKER__ + 0) COSMOPOLITAN_C_START_ /* Implementations of "struct nsync_waitable_s" must provide functions in struct ns...
1,121
27
jart/cosmopolitan
false
cosmopolitan/third_party/nsync/waiter_per_thread.c
/*-*- mode:c;indent-tabs-mode:t;c-basic-offset:8;tab-width:8;coding:utf-8 -*-│ │vi: set et ft=c ts=8 tw=8 fenc=utf-8 :vi│ ╞═════════════════════════════════════════════════â•...
2,755
57
jart/cosmopolitan
false
cosmopolitan/third_party/nsync/note.h
#ifndef NSYNC_NOTE_H_ #define NSYNC_NOTE_H_ #include "third_party/nsync/time.h" #if !(__ASSEMBLER__ + __LINKER__ + 0) COSMOPOLITAN_C_START_ /* An nsync_note represents a single bit that can transition from 0 to 1 at most once. When 1, the note is said to be notified. There are operations to wait for the transiti...
2,068
52
jart/cosmopolitan
false
cosmopolitan/third_party/nsync/panic.c
/*-*- mode:c;indent-tabs-mode:t;c-basic-offset:8;tab-width:8;coding:utf-8 -*-│ │vi: set et ft=c ts=8 tw=8 fenc=utf-8 :vi│ ╞═════════════════════════════════════════════════â•...
2,163
32
jart/cosmopolitan
false
cosmopolitan/third_party/nsync/mu_semaphore_futex.c
/*-*- mode:c;indent-tabs-mode:t;c-basic-offset:8;tab-width:8;coding:utf-8 -*-│ │vi: set et ft=c ts=8 tw=8 fenc=utf-8 :vi│ ╞═════════════════════════════════════════════════â•...
5,271
126
jart/cosmopolitan
false
cosmopolitan/third_party/nsync/heap.internal.h
#ifndef NSYNC_TESTING_HEAP_H_ #define NSYNC_TESTING_HEAP_H_ /* clang-format off */ /* A heap. Optionally, elements may have storage for the index to allow deletions from arbitrary elements. A "set" operation sets the field. Use heap_no_set when no field is available. Let: set (e,i) sets the inde...
1,800
61
jart/cosmopolitan
false
cosmopolitan/third_party/nsync/dll.h
#ifndef NSYNC_DLL_H_ #define NSYNC_DLL_H_ #if !(__ASSEMBLER__ + __LINKER__ + 0) COSMOPOLITAN_C_START_ /* A nsync_dll_element_ represents an element of a doubly-linked list of waiters. */ typedef struct nsync_dll_element_s_ { struct nsync_dll_element_s_ *next; struct nsync_dll_element_s_ *prev; /* points to th...
2,896
70
jart/cosmopolitan
false
cosmopolitan/third_party/nsync/README.cosmo
DESCRIPTION *NSYNC is a synchronization primitives library. LICENSE Apache 2.0 ORIGIN git@github.com:google/nsync commit ac5489682760393fe21bd2a8e038b528442412a7 Author: Mike Burrows <m3b@google.com> Date: Wed Jun 1 16:47:52 2022 -0700 LOCAL CHANGES - nsync_malloc_() is implemented as kmalloc() ...
479
22
jart/cosmopolitan
false
cosmopolitan/third_party/nsync/mu_semaphore_sem.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,204
107
jart/cosmopolitan
false
cosmopolitan/third_party/nsync/futex.c
/*-*- mode:c;indent-tabs-mode:t;c-basic-offset:8;tab-width:8;coding:utf-8 -*-│ │vi: set et ft=c ts=8 tw=8 fenc=utf-8 :vi│ ╞═════════════════════════════════════════════════â•...
10,524
341
jart/cosmopolitan
false
cosmopolitan/third_party/nsync/once.h
#ifndef NSYNC_ONCE_H_ #define NSYNC_ONCE_H_ #include "third_party/nsync/atomic.h" #if !(__ASSEMBLER__ + __LINKER__ + 0) COSMOPOLITAN_C_START_ /* An nsync_once allows a function to be called exactly once, when first referenced. */ typedef nsync_atomic_uint32_ nsync_once; /* An initializer for nsync_once; it is guar...
1,540
38
jart/cosmopolitan
false
cosmopolitan/third_party/nsync/mu.c
/*-*- mode:c;indent-tabs-mode:t;c-basic-offset:8;tab-width:8;coding:utf-8 -*-│ │vi: set et ft=c ts=8 tw=8 fenc=utf-8 :vi│ ╞═════════════════════════════════════════════════â•...
22,164
552
jart/cosmopolitan
false
cosmopolitan/third_party/nsync/debug.h
#ifndef NSYNC_DEBUG_H_ #define NSYNC_DEBUG_H_ #include "third_party/nsync/cv.h" #include "third_party/nsync/mu.h" #if !(__ASSEMBLER__ + __LINKER__ + 0) COSMOPOLITAN_C_START_ /* Debugging operations for mutexes and condition variables. These operations should not be relied upon for normal functionality. The impl...
1,798
40
jart/cosmopolitan
false
cosmopolitan/third_party/nsync/LICENSE.txt
Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, ...
11,358
203
jart/cosmopolitan
false
cosmopolitan/third_party/nsync/futex.internal.h
#ifndef NSYNC_FUTEX_INTERNAL_H_ #define NSYNC_FUTEX_INTERNAL_H_ #include "libc/calls/struct/timespec.h" #include "libc/dce.h" #if !(__ASSEMBLER__ + __LINKER__ + 0) COSMOPOLITAN_C_START_ int nsync_futex_wake_(_Atomic(int) *, int, char); int nsync_futex_wait_(_Atomic(int) *, int, char, struct timespec *); COSMOPOLITAN_...
411
14
jart/cosmopolitan
false
cosmopolitan/third_party/nsync/dll.c
/*-*- mode:c;indent-tabs-mode:t;c-basic-offset:8;tab-width:8;coding:utf-8 -*-│ │vi: set et ft=c ts=8 tw=8 fenc=utf-8 :vi│ ╞═════════════════════════════════════════════════â•...
5,879
144
jart/cosmopolitan
false
cosmopolitan/third_party/nsync/cv.h
#ifndef NSYNC_CV_H_ #define NSYNC_CV_H_ #include "third_party/nsync/mu.h" #include "third_party/nsync/time.h" #if !(__ASSEMBLER__ + __LINKER__ + 0) COSMOPOLITAN_C_START_ #define NSYNC_CV_INIT \ { NSYNC_ATOMIC_UINT32_INIT_, 0 } struct nsync_dll_element_s_; struct nsync_note_s_; /* An nsync_cv is a condition variabl...
7,112
162
jart/cosmopolitan
false
cosmopolitan/third_party/nsync/counter.h
#ifndef NSYNC_COUNTER_H_ #define NSYNC_COUNTER_H_ #include "third_party/nsync/atomic.h" #include "third_party/nsync/time.h" #if !(__ASSEMBLER__ + __LINKER__ + 0) COSMOPOLITAN_C_START_ struct nsync_dll_element_s_; /* An nsync_counter represents an unsigned integer that can count up and down, and wake waiters when z...
1,640
44
jart/cosmopolitan
false
cosmopolitan/third_party/nsync/mu.h
#ifndef NSYNC_MU_H_ #define NSYNC_MU_H_ #include "third_party/nsync/atomic.h" #if !(__ASSEMBLER__ + __LINKER__ + 0) COSMOPOLITAN_C_START_ struct nsync_dll_element_s_; /* An nsync_mu is a lock. If initialized to zero, it's valid and unlocked. An nsync_mu can be "free", held by a single thread (aka fiber, gorout...
3,945
105
jart/cosmopolitan
false
cosmopolitan/third_party/nsync/atomic.internal.h
#ifndef NSYNC_ATOMIC_INTERNAL_H_ #define NSYNC_ATOMIC_INTERNAL_H_ #include "libc/intrin/atomic.h" #include "libc/intrin/cmpxchg.h" #include "third_party/nsync/atomic.h" #if !(__ASSEMBLER__ + __LINKER__ + 0) COSMOPOLITAN_C_START_ /* Atomic operations on nsync_atomic_uint32_ quantities CAS, load, and store. Norma...
4,933
115
jart/cosmopolitan
false
cosmopolitan/third_party/nsync/races.internal.h
#ifndef COSMOPOLITAN_THIRD_PARTY_NSYNC_RACES_INTERNAL_H_ #define COSMOPOLITAN_THIRD_PARTY_NSYNC_RACES_INTERNAL_H_ #if !(__ASSEMBLER__ + __LINKER__ + 0) COSMOPOLITAN_C_START_ /* Annotations for race detectors. */ #if defined(__has_feature) && !defined(__SANITIZE_THREAD__) #if __has_feature(thread_sanitizer) /* used by ...
1,349
37
jart/cosmopolitan
false
cosmopolitan/third_party/nsync/README.md
# *NSYNC *NSYNC is a library providing scalable synchronization primitives. The following packages are provided: - `THIRD_PARTY_NSYNC` has `nsync_mu` which doesn't depend on malloc(). - `THIRD_PARTY_NSYNC_MEM` has the rest of *NSYNC, e.g. `nsync_cv`. The origin of this code is here: git@github.com:google/ns...
1,002
27
jart/cosmopolitan
false
cosmopolitan/third_party/nsync/mu_semaphore.h
#ifndef NSYNC_SEM_H_ #define NSYNC_SEM_H_ #include "third_party/nsync/time.h" #if !(__ASSEMBLER__ + __LINKER__ + 0) COSMOPOLITAN_C_START_ typedef struct nsync_semaphore_s_ { void *sem_space[32]; /* internal storage */ } nsync_semaphore; /* Initialize *s; the initial value is 0. */ void nsync_mu_semaphore_init(nsync...
931
29
jart/cosmopolitan
false
cosmopolitan/third_party/nsync/mu_semaphore.internal.h
#ifndef COSMOPOLITAN_THIRD_PARTY_NSYNC_MU_SEMAPHORE_INTERNAL_H_ #define COSMOPOLITAN_THIRD_PARTY_NSYNC_MU_SEMAPHORE_INTERNAL_H_ #include "third_party/nsync/mu_semaphore.h" #include "third_party/nsync/time.h" #if !(__ASSEMBLER__ + __LINKER__ + 0) COSMOPOLITAN_C_START_ void nsync_mu_semaphore_init_futex(nsync_semaphore ...
1,121
26
jart/cosmopolitan
false
cosmopolitan/third_party/nsync/nsync.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 += THIRD_PARTY_NSYNC THIRD_PARTY_NSYNC_SRCS = $(THIRD_PARTY_NSYNC_A_SRCS) THIRD_PARTY_NSYNC_HDRS = $(THIRD_PARTY_...
2,336
67
jart/cosmopolitan
false
cosmopolitan/third_party/nsync/atomic.h
#ifndef NSYNC_ATOMIC_H_ #define NSYNC_ATOMIC_H_ #include "libc/atomic.h" #if !(__ASSEMBLER__ + __LINKER__ + 0) COSMOPOLITAN_C_START_ typedef atomic_uint_fast32_t nsync_atomic_uint32_; #define NSYNC_ATOMIC_UINT32_INIT_ 0 #define NSYNC_ATOMIC_UINT32_LOAD_(p) (*(p)) #define NSYNC_ATOMIC_UINT32_STORE_(p, v) (*...
473
17
jart/cosmopolitan
false
cosmopolitan/third_party/nsync/yield.c
/*-*- mode:c;indent-tabs-mode:t;c-basic-offset:8;tab-width:8;coding:utf-8 -*-│ │vi: set et ft=c ts=8 tw=8 fenc=utf-8 :vi│ ╞═════════════════════════════════════════════════â•...
2,049
28
jart/cosmopolitan
false
cosmopolitan/third_party/nsync/common.internal.h
#ifndef NSYNC_COMMON_H_ #define NSYNC_COMMON_H_ #include "libc/assert.h" #include "third_party/nsync/atomic.h" #include "third_party/nsync/atomic.internal.h" #include "third_party/nsync/cv.h" #include "third_party/nsync/dll.h" #include "third_party/nsync/mu.h" #include "third_party/nsync/mu_semaphore.h" #include "third...
12,305
290
jart/cosmopolitan
false
cosmopolitan/third_party/nsync/waiter.h
#ifndef NSYNC_WAITER_H_ #define NSYNC_WAITER_H_ #include "third_party/nsync/time.h" #if !(__ASSEMBLER__ + __LINKER__ + 0) COSMOPOLITAN_C_START_ /* nsync_wait_n() allows the client to wait on multiple objects (condition variables, nsync_notes, nsync_counters, etc.) until at least one of them becomes ready, or a d...
5,430
139
jart/cosmopolitan
false
cosmopolitan/third_party/nsync/array.internal.h
#ifndef NSYNC_ARRAY_H_ #define NSYNC_ARRAY_H_ /* clang-format off */ /* Return the number of elements in a C array a. A constant expression if a is a constant expression. */ #define NELEM(a) ((int) (sizeof (a) / sizeof (a[0]))) /* A dynamic array */ /* internal routines */ void a_ensure_ (void *v, int delta, int...
2,338
62
jart/cosmopolitan
false
cosmopolitan/third_party/nsync/time.h
#ifndef NSYNC_TIME_H_ #define NSYNC_TIME_H_ #include "libc/calls/struct/timespec.h" #if !(__ASSEMBLER__ + __LINKER__ + 0) COSMOPOLITAN_C_START_ #define NSYNC_TIME_SEC(t) ((t).tv_sec) #define NSYNC_TIME_NSEC(t) ((t).tv_nsec) #define NSYNC_TIME_STATIC_INIT(t, ns) \ { (t), (ns) } /* The type nsync_time represents the...
2,081
61
jart/cosmopolitan
false
cosmopolitan/third_party/nsync/mem/nsync_cv.c
/*-*- mode:c;indent-tabs-mode:t;c-basic-offset:8;tab-width:8;coding:utf-8 -*-│ │vi: set et ft=c ts=8 tw=8 fenc=utf-8 :vi│ ╞═════════════════════════════════════════════════â•...
20,906
510
jart/cosmopolitan
false
cosmopolitan/third_party/nsync/mem/nsync_note.c
/*-*- mode:c;indent-tabs-mode:t;c-basic-offset:8;tab-width:8;coding:utf-8 -*-│ │vi: set et ft=c ts=8 tw=8 fenc=utf-8 :vi│ ╞═════════════════════════════════════════════════â•...
11,182
308
jart/cosmopolitan
false
cosmopolitan/third_party/nsync/mem/array.c
/*-*- mode:c;indent-tabs-mode:t;c-basic-offset:8;tab-width:8;coding:utf-8 -*-│ │vi: set et ft=c ts=8 tw=8 fenc=utf-8 :vi│ ╞═════════════════════════════════════════════════â•...
2,417
47
jart/cosmopolitan
false
cosmopolitan/third_party/nsync/mem/nsync_debug.c
/*-*- mode:c;indent-tabs-mode:t;c-basic-offset:8;tab-width:8;coding:utf-8 -*-│ │vi: set et ft=c ts=8 tw=8 fenc=utf-8 :vi│ ╞═════════════════════════════════════════════════â•...
12,400
293
jart/cosmopolitan
false
cosmopolitan/third_party/nsync/mem/nsync_counter.c
/*-*- mode:c;indent-tabs-mode:t;c-basic-offset:8;tab-width:8;coding:utf-8 -*-│ │vi: set et ft=c ts=8 tw=8 fenc=utf-8 :vi│ ╞═════════════════════════════════════════════════â•...
5,837
159
jart/cosmopolitan
false
cosmopolitan/third_party/nsync/mem/nsync_sem_wait.c
/*-*- mode:c;indent-tabs-mode:t;c-basic-offset:8;tab-width:8;coding:utf-8 -*-│ │vi: set et ft=c ts=8 tw=8 fenc=utf-8 :vi│ ╞═════════════════════════════════════════════════â•...
4,064
85
jart/cosmopolitan
false
cosmopolitan/third_party/nsync/mem/nsync_wait.c
/*-*- mode:c;indent-tabs-mode:t;c-basic-offset:8;tab-width:8;coding:utf-8 -*-│ │vi: set et ft=c ts=8 tw=8 fenc=utf-8 :vi│ ╞═════════════════════════════════════════════════â•...
4,500
113
jart/cosmopolitan
false
cosmopolitan/third_party/nsync/mem/mem.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 += THIRD_PARTY_NSYNC_MEM THIRD_PARTY_NSYNC_MEM_SRCS = $(THIRD_PARTY_NSYNC_MEM_A_SRCS) THIRD_PARTY_NSYNC_MEM_HDRS ...
2,175
56
jart/cosmopolitan
false
cosmopolitan/third_party/nsync/mem/nsync_mu_wait.c
/*-*- mode:c;indent-tabs-mode:t;c-basic-offset:8;tab-width:8;coding:utf-8 -*-│ │vi: set et ft=c ts=8 tw=8 fenc=utf-8 :vi│ ╞═════════════════════════════════════════════════â•...
14,888
326
jart/cosmopolitan
false
cosmopolitan/third_party/nsync/mem/nsync_once.c
/*-*- mode:c;indent-tabs-mode:t;c-basic-offset:8;tab-width:8;coding:utf-8 -*-│ │vi: set et ft=c ts=8 tw=8 fenc=utf-8 :vi│ ╞═════════════════════════════════════════════════â•...
5,858
151
jart/cosmopolitan
false
cosmopolitan/third_party/nsync/testing/mu_wait_example_test.c
/*-*- mode:c;indent-tabs-mode:t;c-basic-offset:8;tab-width:8;coding:utf-8 -*-│ │vi: set et ft=c ts=8 tw=8 fenc=utf-8 :vi│ ╞═════════════════════════════════════════════════â•...
7,096
182
jart/cosmopolitan
false
cosmopolitan/third_party/nsync/testing/counter_test.c
/*-*- mode:c;indent-tabs-mode:t;c-basic-offset:8;tab-width:8;coding:utf-8 -*-│ │vi: set et ft=c ts=8 tw=8 fenc=utf-8 :vi│ ╞═════════════════════════════════════════════════â•...
6,576
157
jart/cosmopolitan
false
cosmopolitan/third_party/nsync/testing/closure.c
/*-*- mode:c;indent-tabs-mode:t;c-basic-offset:8;tab-width:8;coding:utf-8 -*-│ │vi: set et ft=c ts=8 tw=8 fenc=utf-8 :vi│ ╞═════════════════════════════════════════════════â•...
2,177
36
jart/cosmopolitan
false
cosmopolitan/third_party/nsync/testing/pingpong_test.c
/*-*- mode:c;indent-tabs-mode:t;c-basic-offset:8;tab-width:8;coding:utf-8 -*-│ │vi: set et ft=c ts=8 tw=8 fenc=utf-8 :vi│ ╞═════════════════════════════════════════════════â•...
13,640
390
jart/cosmopolitan
false
cosmopolitan/third_party/nsync/testing/cv_mu_timeout_stress_test_.c
/*-*- mode:c;indent-tabs-mode:t;c-basic-offset:8;tab-width:8;coding:utf-8 -*-│ │vi: set et ft=c ts=8 tw=8 fenc=utf-8 :vi│ ╞═════════════════════════════════════════════════â•...
20,975
560
jart/cosmopolitan
false
cosmopolitan/third_party/nsync/testing/smprintf.c
/*-*- mode:c;indent-tabs-mode:t;c-basic-offset:8;tab-width:8;coding:utf-8 -*-│ │vi: set et ft=c ts=8 tw=8 fenc=utf-8 :vi│ ╞═════════════════════════════════════════════════â•...
2,361
46
jart/cosmopolitan
false
cosmopolitan/third_party/nsync/testing/atm_log.h
#ifndef NSYNC_TESTING_ATM_LOG_H_ #define NSYNC_TESTING_ATM_LOG_H_ void nsync_atm_log_(int, void *, uint32_t, uint32_t, const char *, int); void nsync_atm_log_print_(void); #endif /*NSYNC_TESTING_ATM_LOG_H_*/
210
8
jart/cosmopolitan
false
cosmopolitan/third_party/nsync/testing/time_extra.c
/*-*- mode:c;indent-tabs-mode:t;c-basic-offset:8;tab-width:8;coding:utf-8 -*-│ │vi: set et ft=c ts=8 tw=8 fenc=utf-8 :vi│ ╞═════════════════════════════════════════════════â•...
2,722
55
jart/cosmopolitan
false