From 9b29358511ecb028d46e019dbad9df5ff689d7da Mon Sep 17 00:00:00 2001 From: Justine Tunney Date: Fri, 13 Aug 2021 03:20:45 -0700 Subject: [PATCH] Make whitespace changes Status lines for Emacs and Vim have been added to Python sources so they'll be easier to edit using Python's preferred coding style. Some DNS helper functions have been broken up into multiple files. It's nice to have one function per file whenever possible, since that way we don't need -ffunction-sections. Another reason it's good to have small source files, is because the build will be enforcing resource limits on compilation and testing soon. --- libc/calls/cfgetispeed.c | 7 +- libc/calls/cfgetospeed.c | 7 +- libc/calls/cfsetospeed.c | 12 +- libc/dns/dns.h | 4 +- libc/dns/ent.h | 1 - libc/dns/getaddrinfo.c | 5 +- libc/dns/gethostbyaddr.c | 11 -- libc/dns/gethostbyname.c | 1 - libc/dns/getnameinfo.c | 1 - libc/dns/getntprotocolstxtpath.c | 41 ++++++ libc/dns/getntservicestxtpath.c | 40 ++++++ libc/dns/getprotobyname.c | 1 - libc/dns/getprotobynumber.c | 1 - libc/dns/getservbyname.c | 6 - libc/dns/getservbyport.c | 8 +- libc/dns/herror.c | 3 +- libc/dns/hostent.c | 1 - libc/dns/{prototxt.c => lookupprotobyname.c} | 100 +-------------- libc/dns/lookupprotobynumber.c | 93 ++++++++++++++ .../{servicestxt.c => lookupservicesbyname.c} | 118 +----------------- libc/dns/lookupservicesbyport.c | 108 ++++++++++++++++ libc/dns/netent.c | 1 - libc/dns/protoent.c | 1 - libc/dns/prototxt.h | 2 +- libc/dns/resolvednsreverse.c | 5 - libc/dns/servent.c | 1 - libc/dns/servicestxt.h | 2 +- libc/log/backtrace3.c | 2 +- libc/log/startfatal.c | 22 ++-- libc/log/startfatal_ndebug.c | 14 ++- third_party/python/Modules/_asynciomodule.c | 6 + third_party/python/Modules/_bisectmodule.c | 6 + third_party/python/Modules/_codecsmodule.c | 6 + third_party/python/Modules/_cryptmodule.c | 6 + third_party/python/Modules/_curses_panel.c | 7 ++ third_party/python/Modules/_datetimemodule.c | 6 + .../python/Modules/_decimal/_decimal.c | 5 +- .../Modules/_decimal/libmpdec/basearith.c | 5 +- .../Modules/_decimal/libmpdec/constants.c | 4 +- .../Modules/_decimal/libmpdec/context.c | 4 +- .../Modules/_decimal/libmpdec/convolute.c | 4 +- .../python/Modules/_decimal/libmpdec/crt.c | 2 +- .../Modules/_decimal/libmpdec/difradix2.c | 4 +- .../python/Modules/_decimal/libmpdec/fnt.c | 5 +- .../Modules/_decimal/libmpdec/fourstep.c | 4 +- .../python/Modules/_decimal/libmpdec/io.c | 4 +- .../python/Modules/_decimal/libmpdec/memory.c | 4 +- .../Modules/_decimal/libmpdec/mpdecimal.c | 5 +- .../Modules/_decimal/libmpdec/numbertheory.c | 4 +- .../Modules/_decimal/libmpdec/sixstep.c | 4 +- .../Modules/_decimal/libmpdec/transpose.c | 4 +- third_party/python/Modules/_elementtree.c | 7 ++ third_party/python/Modules/_gdbmmodule.c | 6 + third_party/python/Modules/_heapqmodule.c | 7 +- third_party/python/Modules/_io/_iomodule.c | 3 +- third_party/python/Modules/_io/bufferedio.c | 6 + third_party/python/Modules/_io/bytesio.c | 6 + .../python/Modules/_io/clinic/textio.inc | 2 +- third_party/python/Modules/_io/fileio.c | 6 + third_party/python/Modules/_io/iobase.c | 6 + third_party/python/Modules/_io/stringio.c | 6 + third_party/python/Modules/_io/textio.c | 6 + third_party/python/Modules/_io/winconsoleio.c | 6 + third_party/python/Modules/_localemodule.c | 6 + third_party/python/Modules/_lzmamodule.c | 6 + .../_multiprocessing/multiprocessing.c | 7 ++ .../Modules/_multiprocessing/semaphore.c | 7 ++ third_party/python/Modules/_opcode.c | 6 + third_party/python/Modules/_operator.c | 6 + third_party/python/Modules/_pickle.c | 6 + third_party/python/Modules/_posixsubprocess.c | 6 + third_party/python/Modules/_randommodule.c | 6 + third_party/python/Modules/_sha3.c | 6 + third_party/python/Modules/_sre.c | 6 + third_party/python/Modules/_ssl.c | 8 +- third_party/python/Modules/_stat.c | 6 + third_party/python/Modules/_struct.c | 6 + third_party/python/Modules/_testbuffer.c | 6 + third_party/python/Modules/_testcapimodule.c | 6 + .../python/Modules/_testimportmultiple.c | 58 --------- third_party/python/Modules/_testmultiphase.c | 6 + third_party/python/Modules/_threadmodule.c | 6 + third_party/python/Modules/_tracemalloc.c | 6 + third_party/python/Modules/_weakref.c | 6 + third_party/python/Modules/_winapi.c | 14 ++- third_party/python/Modules/arraymodule.c | 6 + third_party/python/Modules/atexitmodule.c | 6 + third_party/python/Modules/audioop.c | 6 + third_party/python/Modules/binascii.c | 11 +- .../python/Modules/cjkcodecs/_codecs_cn.c | 6 + .../python/Modules/cjkcodecs/_codecs_hk.c | 6 + .../Modules/cjkcodecs/_codecs_iso2022.c | 6 + .../python/Modules/cjkcodecs/_codecs_jp.c | 6 + .../python/Modules/cjkcodecs/_codecs_kr.c | 7 ++ .../python/Modules/cjkcodecs/multibytecodec.c | 6 + third_party/python/Modules/cmathmodule.c | 6 + third_party/python/Modules/config.c | 7 ++ third_party/python/Modules/errnomodule.c | 6 + third_party/python/Modules/faulthandler.c | 6 + third_party/python/Modules/fcntlmodule.c | 6 + third_party/python/Modules/fpectlmodule.c | 6 + third_party/python/Modules/fpetestmodule.c | 6 + third_party/python/Modules/gcmodule.c | 6 + third_party/python/Modules/getbuildinfo.c | 6 + third_party/python/Modules/getpath.c | 6 + third_party/python/Modules/grpmodule.c | 6 + third_party/python/Modules/hashtable.c | 6 + third_party/python/Modules/itertoolsmodule.c | 7 +- third_party/python/Modules/main.c | 6 + third_party/python/Modules/mathmodule.c | 6 + third_party/python/Modules/md5module.c | 6 + third_party/python/Modules/mmapmodule.c | 6 + third_party/python/Modules/ossaudiodev.c | 48 ++----- third_party/python/Modules/overlapped.c | 7 ++ third_party/python/Modules/parsermodule.c | 11 +- third_party/python/Modules/posixmodule.c | 11 +- third_party/python/Modules/pwdmodule.c | 6 + third_party/python/Modules/pyexpat.c | 6 + third_party/python/Modules/readline.c | 6 + third_party/python/Modules/resource.c | 6 + third_party/python/Modules/rotatingtree.c | 6 + third_party/python/Modules/selectmodule.c | 6 + third_party/python/Modules/sha1module.c | 6 + third_party/python/Modules/sha256module.c | 6 + third_party/python/Modules/sha512module.c | 7 +- third_party/python/Modules/signalmodule.c | 6 + third_party/python/Modules/socketmodule.c | 7 +- third_party/python/Modules/spwdmodule.c | 6 + third_party/python/Modules/sre_lib.inc | 7 ++ third_party/python/Modules/symtablemodule.c | 6 + third_party/python/Modules/syslogmodule.c | 6 + third_party/python/Modules/termios.c | 6 + third_party/python/Modules/testcapi_long.inc | 7 ++ third_party/python/Modules/timemodule.c | 6 + third_party/python/Modules/unicodedata.c | 6 + third_party/python/Modules/unicodedata_db.inc | 7 ++ third_party/python/Modules/unicodename_db.inc | 7 ++ third_party/python/Modules/xxlimited.c | 6 + third_party/python/Modules/xxmodule.c | 6 + third_party/python/Modules/xxsubtype.c | 6 + third_party/python/Modules/zipimport.c | 6 + third_party/python/Modules/zlibmodule.c | 6 + third_party/python/Objects/abstract.c | 6 + third_party/python/Objects/accu.c | 8 +- third_party/python/Objects/boolobject.c | 6 + third_party/python/Objects/bytearrayobject.c | 8 +- third_party/python/Objects/bytes_methods.c | 6 + third_party/python/Objects/bytesobject.c | 8 +- third_party/python/Objects/capsule.c | 7 ++ third_party/python/Objects/cellobject.c | 7 +- third_party/python/Objects/classobject.c | 6 + .../python/Objects/clinic/bytearrayobject.inc | 7 ++ .../python/Objects/clinic/bytesobject.inc | 7 ++ .../python/Objects/clinic/dictobject.inc | 7 ++ .../python/Objects/clinic/unicodeobject.inc | 7 ++ third_party/python/Objects/codeobject.c | 6 + third_party/python/Objects/complexobject.c | 7 +- third_party/python/Objects/descrobject.c | 6 + third_party/python/Objects/dictobject.c | 6 + third_party/python/Objects/enumobject.c | 8 +- third_party/python/Objects/exceptions.c | 7 ++ third_party/python/Objects/fileobject.c | 6 + third_party/python/Objects/floatobject.c | 8 +- third_party/python/Objects/frameobject.c | 8 +- third_party/python/Objects/funcobject.c | 8 +- third_party/python/Objects/genobject.c | 7 +- third_party/python/Objects/iterobject.c | 7 +- third_party/python/Objects/listobject.c | 8 +- third_party/python/Objects/longobject.c | 6 + third_party/python/Objects/memoryobject.c | 8 +- third_party/python/Objects/methodobject.c | 8 +- third_party/python/Objects/moduleobject.c | 6 + third_party/python/Objects/namespaceobject.c | 6 + third_party/python/Objects/object.c | 6 + third_party/python/Objects/obmalloc.c | 6 + third_party/python/Objects/odictobject.c | 6 + third_party/python/Objects/rangeobject.c | 6 + third_party/python/Objects/setobject.c | 6 + third_party/python/Objects/sliceobject.c | 6 + .../python/Objects/stringlib/asciilib.inc | 8 +- .../python/Objects/stringlib/codecs.inc | 7 ++ .../python/Objects/stringlib/count.inc | 7 ++ .../python/Objects/stringlib/ctype.inc | 7 ++ third_party/python/Objects/stringlib/eq.inc | 7 ++ .../python/Objects/stringlib/fastsearch.inc | 7 ++ third_party/python/Objects/stringlib/find.inc | 11 +- .../Objects/stringlib/find_max_char.inc | 7 ++ third_party/python/Objects/stringlib/join.inc | 7 ++ .../python/Objects/stringlib/localeutil.inc | 7 ++ .../python/Objects/stringlib/partition.inc | 7 ++ .../python/Objects/stringlib/replace.inc | 7 ++ .../python/Objects/stringlib/split.inc | 7 ++ .../python/Objects/stringlib/stringdefs.inc | 7 ++ .../python/Objects/stringlib/transmogrify.inc | 7 ++ .../python/Objects/stringlib/ucs1lib.inc | 7 ++ .../python/Objects/stringlib/ucs2lib.inc | 7 ++ .../python/Objects/stringlib/ucs4lib.inc | 7 ++ .../python/Objects/stringlib/undef.inc | 7 ++ .../Objects/stringlib/unicode_format.inc | 7 ++ .../python/Objects/stringlib/unicodedefs.inc | 41 +++--- third_party/python/Objects/structseq.c | 6 + third_party/python/Objects/tupleobject.c | 6 + third_party/python/Objects/typeobject.c | 6 + third_party/python/Objects/unicodectype.c | 6 + third_party/python/Objects/unicodeobject.c | 6 + third_party/python/Objects/weakrefobject.c | 6 + third_party/python/PC/clinic/winreg.inc | 8 ++ third_party/python/PC/clinic/winsound.inc | 8 ++ third_party/python/PC/dl_nt.c | 7 ++ third_party/python/PC/frozen_dllmain.c | 7 ++ third_party/python/PC/getpathp.c | 8 +- third_party/python/PC/launcher.c | 7 ++ third_party/python/PC/winreg.c | 7 ++ third_party/python/PC/winsound.c | 7 ++ third_party/python/Parser/acceler.c | 7 +- third_party/python/Parser/bitset.c | 8 +- third_party/python/Parser/firstsets.c | 8 +- third_party/python/Parser/grammar.c | 8 +- third_party/python/Parser/grammar1.c | 9 +- third_party/python/Parser/listnode.c | 9 +- third_party/python/Parser/metagrammar.c | 6 + third_party/python/Parser/myreadline.c | 6 + third_party/python/Parser/node.c | 8 +- third_party/python/Parser/parser.c | 108 ++++++++-------- third_party/python/Parser/parsetok.c | 9 +- third_party/python/Parser/pgen.c | 67 +++++----- third_party/python/Parser/pgenmain.c | 8 +- third_party/python/Parser/printgrammar.c | 6 + third_party/python/Parser/tokenizer.c | 6 + third_party/python/Parser/tokenizer_pgen.c | 1 - .../python/Programs/_freeze_importlib.c | 8 ++ third_party/python/Programs/_testembed.c | 6 + third_party/python/Programs/python.c | 6 + third_party/python/Python/Python-ast.c | 6 + third_party/python/Python/_warnings.c | 6 + third_party/python/Python/asdl.c | 6 + third_party/python/Python/ast.c | 6 + third_party/python/Python/bltinmodule.c | 6 + third_party/python/Python/ceval.c | 6 + third_party/python/Python/ceval_gil.inc | 6 + .../python/Python/clinic/bltinmodule.inc | 7 ++ third_party/python/Python/clinic/import.inc | 7 ++ third_party/python/Python/codecs.c | 6 + third_party/python/Python/compile.c | 6 + third_party/python/Python/dtoa.c | 6 + .../python/Python/dynamic_annotations.c | 6 + third_party/python/Python/dynload_dl.c | 6 + third_party/python/Python/dynload_shlib.c | 6 + third_party/python/Python/dynload_stub.c | 6 + third_party/python/Python/dynload_win.c | 6 + third_party/python/Python/errors.c | 6 + third_party/python/Python/fileutils.c | 6 + third_party/python/Python/formatter_unicode.c | 6 + third_party/python/Python/frozen.c | 6 + third_party/python/Python/frozenmain.c | 6 + third_party/python/Python/future.c | 6 + third_party/python/Python/getargs.c | 6 + third_party/python/Python/getcompiler.c | 6 + third_party/python/Python/getcopyright.c | 6 + third_party/python/Python/getopt.c | 7 ++ third_party/python/Python/getplatform.c | 6 + third_party/python/Python/getversion.c | 6 + third_party/python/Python/graminit.c | 8 ++ third_party/python/Python/import.c | 6 + third_party/python/Python/importdl.c | 6 + third_party/python/Python/importlib.inc | 8 ++ .../python/Python/importlib_external.inc | 9 ++ third_party/python/Python/marshal.c | 6 + third_party/python/Python/modsupport.c | 6 + third_party/python/Python/mysnprintf.c | 6 + third_party/python/Python/mystrtoul.c | 6 + third_party/python/Python/opcode_targets.inc | 7 ++ third_party/python/Python/peephole.c | 6 + third_party/python/Python/pyarena.c | 6 + third_party/python/Python/pyfpe.c | 6 + third_party/python/Python/pyhash.c | 6 + third_party/python/Python/pylifecycle.c | 2 +- third_party/python/Python/pymath.c | 6 + third_party/python/Python/pystate.c | 6 + third_party/python/Python/pystrcmp.c | 6 + third_party/python/Python/pystrhex.c | 6 + third_party/python/Python/pystrtod.c | 6 + third_party/python/Python/pythonrun.c | 6 + third_party/python/Python/pytime.c | 6 + third_party/python/Python/random.c | 6 + third_party/python/Python/sigcheck.c | 6 + third_party/python/Python/structmember.c | 6 + third_party/python/Python/symtable.c | 6 + third_party/python/Python/sysmodule.c | 6 + third_party/python/Python/thread.c | 6 + third_party/python/Python/thread_pthread.inc | 6 + third_party/python/Python/traceback.c | 6 + .../python/Python/wordcode_helpers.inc | 6 + 293 files changed, 1975 insertions(+), 609 deletions(-) create mode 100644 libc/dns/getntprotocolstxtpath.c create mode 100644 libc/dns/getntservicestxtpath.c rename libc/dns/{prototxt.c => lookupprotobyname.c} (64%) create mode 100644 libc/dns/lookupprotobynumber.c rename libc/dns/{servicestxt.c => lookupservicesbyname.c} (62%) create mode 100644 libc/dns/lookupservicesbyport.c delete mode 100644 third_party/python/Modules/_testimportmultiple.c diff --git a/libc/calls/cfgetispeed.c b/libc/calls/cfgetispeed.c index 14cc6ba23..51fefc120 100644 --- a/libc/calls/cfgetispeed.c +++ b/libc/calls/cfgetispeed.c @@ -20,6 +20,9 @@ #include "libc/sysv/consts/termios.h" uint32_t cfgetispeed(const struct termios *t) { - /* return t->c_cflag & CBAUD; */ /* ??? */ - return t->c_ispeed; + if (CBAUD) { + return t->c_cflag & CBAUD; + } else { + return t->c_ispeed; + } } diff --git a/libc/calls/cfgetospeed.c b/libc/calls/cfgetospeed.c index 8b57f02ca..f0e57fc16 100644 --- a/libc/calls/cfgetospeed.c +++ b/libc/calls/cfgetospeed.c @@ -20,6 +20,9 @@ #include "libc/sysv/consts/termios.h" uint32_t cfgetospeed(const struct termios *t) { - /* return t->c_cflag & CBAUD; */ /* ??? */ - return t->c_ospeed; + if (CBAUD) { + return t->c_cflag & CBAUD; + } else { + return t->c_ospeed; + } } diff --git a/libc/calls/cfsetospeed.c b/libc/calls/cfsetospeed.c index 5c2696c0d..e996ec1ac 100644 --- a/libc/calls/cfsetospeed.c +++ b/libc/calls/cfsetospeed.c @@ -22,11 +22,15 @@ int cfsetospeed(struct termios *t, int speed) { if (CBAUD) { - if (speed & ~CBAUD) return einval(); - t->c_cflag &= ~CBAUD; - t->c_cflag |= speed; + if (!(speed & ~CBAUD)) { + t->c_cflag &= ~CBAUD; + t->c_cflag |= speed; + return 0; + } else { + return einval(); + } } else { t->c_ospeed = speed; + return 0; } - return 0; } diff --git a/libc/dns/dns.h b/libc/dns/dns.h index 31764a4f5..60f9f0b7d 100644 --- a/libc/dns/dns.h +++ b/libc/dns/dns.h @@ -64,8 +64,8 @@ int CompareDnsNames(const char *, const char *) paramsnonnull(); int PascalifyDnsName(uint8_t *, size_t, const char *) paramsnonnull(); int ResolveDns(const struct ResolvConf *, int, const char *, struct sockaddr *, uint32_t) paramsnonnull(); -int ResolveDnsReverse(const struct ResolvConf *resolvconf, int, const char *, - char *, size_t) paramsnonnull(); +int ResolveDnsReverse(const struct ResolvConf *, int, const char *, char *, + size_t) paramsnonnull(); struct addrinfo *newaddrinfo(uint16_t); COSMOPOLITAN_C_END_ diff --git a/libc/dns/ent.h b/libc/dns/ent.h index 930ce0f31..13180ba92 100644 --- a/libc/dns/ent.h +++ b/libc/dns/ent.h @@ -1,7 +1,6 @@ #ifndef COSMOPOLITAN_LIBC_DNS_ENT_H_ #define COSMOPOLITAN_LIBC_DNS_ENT_H_ #include "libc/dns/dns.h" - #if !(__ASSEMBLER__ + __LINKER__ + 0) COSMOPOLITAN_C_START_ diff --git a/libc/dns/getaddrinfo.c b/libc/dns/getaddrinfo.c index 0d6865b22..b30ce2e32 100644 --- a/libc/dns/getaddrinfo.c +++ b/libc/dns/getaddrinfo.c @@ -50,7 +50,6 @@ int getaddrinfo(const char *name, const char *service, struct addrinfo *ai; char proto[32]; port = 0; - if (!name && !service) return EAI_NONAME; if (!name && (hints->ai_flags & AI_CANONNAME)) return EAI_BADFLAGS; if (service && (port = parseport(service)) == -1) { @@ -60,10 +59,10 @@ int getaddrinfo(const char *name, const char *service, strcpy(proto, "udp"); else /* ai_socktype == 0 */ strcpy(proto, ""); - if ((port = LookupServicesByName(service, proto, sizeof(proto), NULL, 0, - NULL)) == -1) + NULL)) == -1) { return EAI_NONAME; + } } if (!(ai = newaddrinfo(port))) return EAI_MEMORY; if (service) ai->ai_addr4->sin_port = htons(port); diff --git a/libc/dns/gethostbyaddr.c b/libc/dns/gethostbyaddr.c index ad30f2a24..1f570f825 100644 --- a/libc/dns/gethostbyaddr.c +++ b/libc/dns/gethostbyaddr.c @@ -23,7 +23,6 @@ │ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, │ │ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR │ │ OTHER DEALINGS IN THE SOFTWARE. │ -│ │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/dns/ent.h" #include "libc/mem/mem.h" @@ -35,35 +34,25 @@ struct hostent *gethostbyaddr(const void *s_addr, socklen_t len, int type) { static char *h_aliases[1]; static char *h_addr_list[2]; static char h_addr_list0[4]; - struct sockaddr_in addr; - if (!ptr1) { he1.h_name = h_name; - he1.h_aliases = h_aliases; he1.h_aliases[0] = NULL; - he1.h_addrtype = AF_INET; he1.h_length = 4; he1.h_addr_list = h_addr_list; - he1.h_addr_list[0] = h_addr_list0; he1.h_addr_list[1] = NULL; - ptr1 = &he1; } - if (type != AF_INET || len != sizeof(uint32_t)) return NULL; addr.sin_family = AF_INET; addr.sin_port = 0; addr.sin_addr.s_addr = *(uint32_t *)(s_addr); - if (getnameinfo((struct sockaddr *)&addr, sizeof(addr), ptr1->h_name, DNS_NAME_MAX, NULL, 0, 0)) return NULL; - *((uint32_t *)ptr1->h_addr_list[0]) = (addr.sin_addr.s_addr); - return ptr1; } diff --git a/libc/dns/gethostbyname.c b/libc/dns/gethostbyname.c index cc7d4365e..dd70de244 100644 --- a/libc/dns/gethostbyname.c +++ b/libc/dns/gethostbyname.c @@ -23,7 +23,6 @@ │ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, │ │ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR │ │ OTHER DEALINGS IN THE SOFTWARE. │ -│ │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/dns/ent.h" #include "libc/mem/mem.h" diff --git a/libc/dns/getnameinfo.c b/libc/dns/getnameinfo.c index 10a62f5ae..0966a676b 100644 --- a/libc/dns/getnameinfo.c +++ b/libc/dns/getnameinfo.c @@ -23,7 +23,6 @@ │ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, │ │ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR │ │ OTHER DEALINGS IN THE SOFTWARE. │ -│ │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/bits/safemacros.internal.h" #include "libc/calls/calls.h" diff --git a/libc/dns/getntprotocolstxtpath.c b/libc/dns/getntprotocolstxtpath.c new file mode 100644 index 000000000..8717b5ab8 --- /dev/null +++ b/libc/dns/getntprotocolstxtpath.c @@ -0,0 +1,41 @@ +/*-*- 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│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ This is free and unencumbered software released into the public domain. │ +│ │ +│ Anyone is free to copy, modify, publish, use, compile, sell, or │ +│ distribute this software, either in source code form or as a compiled │ +│ binary, for any purpose, commercial or non-commercial, and by any │ +│ means. │ +│ │ +│ In jurisdictions that recognize copyright laws, the author or authors │ +│ of this software dedicate any and all copyright interest in the │ +│ software to the public domain. We make this dedication for the benefit │ +│ of the public at large and to the detriment of our heirs and │ +│ successors. We intend this dedication to be an overt act of │ +│ relinquishment in perpetuity of all present and future rights to this │ +│ software under copyright law. │ +│ │ +│ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, │ +│ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF │ +│ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. │ +│ IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR │ +│ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, │ +│ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR │ +│ OTHER DEALINGS IN THE SOFTWARE. │ +╚─────────────────────────────────────────────────────────────────────────────*/ +#include "libc/dns/prototxt.h" +#include "libc/nt/systeminfo.h" + +textwindows char *GetNtProtocolsTxtPath(char *pathbuf, uint32_t size) { + /* protocol, not plural */ + const char *const kWinHostsPath = "\\drivers\\etc\\protocol"; + uint32_t len = GetSystemDirectoryA(&pathbuf[0], size); + if (len && len + strlen(kWinHostsPath) + 1 < size) { + if (pathbuf[len] == '\\') pathbuf[len--] = '\0'; + memcpy(&pathbuf[len], kWinHostsPath, strlen(kWinHostsPath) + 1); + return &pathbuf[0]; + } else { + return NULL; + } +} diff --git a/libc/dns/getntservicestxtpath.c b/libc/dns/getntservicestxtpath.c new file mode 100644 index 000000000..7f02cac88 --- /dev/null +++ b/libc/dns/getntservicestxtpath.c @@ -0,0 +1,40 @@ +/*-*- 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│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ This is free and unencumbered software released into the public domain. │ +│ │ +│ Anyone is free to copy, modify, publish, use, compile, sell, or │ +│ distribute this software, either in source code form or as a compiled │ +│ binary, for any purpose, commercial or non-commercial, and by any │ +│ means. │ +│ │ +│ In jurisdictions that recognize copyright laws, the author or authors │ +│ of this software dedicate any and all copyright interest in the │ +│ software to the public domain. We make this dedication for the benefit │ +│ of the public at large and to the detriment of our heirs and │ +│ successors. We intend this dedication to be an overt act of │ +│ relinquishment in perpetuity of all present and future rights to this │ +│ software under copyright law. │ +│ │ +│ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, │ +│ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF │ +│ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. │ +│ IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR │ +│ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, │ +│ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR │ +│ OTHER DEALINGS IN THE SOFTWARE. │ +╚─────────────────────────────────────────────────────────────────────────────*/ +#include "libc/dns/servicestxt.h" +#include "libc/nt/systeminfo.h" + +textwindows char *GetNtServicesTxtPath(char *pathbuf, uint32_t size) { + const char *const kWinHostsPath = "\\drivers\\etc\\services"; + uint32_t len = GetSystemDirectoryA(&pathbuf[0], size); + if (len && len + strlen(kWinHostsPath) + 1 < size) { + if (pathbuf[len] == '\\') pathbuf[len--] = '\0'; + memcpy(&pathbuf[len], kWinHostsPath, strlen(kWinHostsPath) + 1); + return &pathbuf[0]; + } else { + return NULL; + } +} diff --git a/libc/dns/getprotobyname.c b/libc/dns/getprotobyname.c index 5a7099b2f..f15fd744c 100644 --- a/libc/dns/getprotobyname.c +++ b/libc/dns/getprotobyname.c @@ -23,7 +23,6 @@ │ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, │ │ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR │ │ OTHER DEALINGS IN THE SOFTWARE. │ -│ │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/dns/ent.h" #include "libc/dns/prototxt.h" diff --git a/libc/dns/getprotobynumber.c b/libc/dns/getprotobynumber.c index 800d3efab..9f92dbda2 100644 --- a/libc/dns/getprotobynumber.c +++ b/libc/dns/getprotobynumber.c @@ -23,7 +23,6 @@ │ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, │ │ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR │ │ OTHER DEALINGS IN THE SOFTWARE. │ -│ │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/dns/ent.h" #include "libc/dns/prototxt.h" diff --git a/libc/dns/getservbyname.c b/libc/dns/getservbyname.c index 4c20cc43a..293fd528e 100644 --- a/libc/dns/getservbyname.c +++ b/libc/dns/getservbyname.c @@ -23,7 +23,6 @@ │ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, │ │ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR │ │ OTHER DEALINGS IN THE SOFTWARE. │ -│ │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/dns/ent.h" #include "libc/dns/servicestxt.h" @@ -35,7 +34,6 @@ struct servent *getservbyname(const char *name, const char *proto) { static char s_name[DNS_NAME_MAX + 1]; static char localproto[DNS_NAME_MAX + 1]; int p; - if (!ptr0) { se0.s_name = s_name; if (!(se0.s_aliases = calloc(1, sizeof(char *)))) return NULL; @@ -43,17 +41,13 @@ struct servent *getservbyname(const char *name, const char *proto) { se0.s_proto = localproto; ptr0 = &se0; } - if (proto) { if (!memccpy(localproto, proto, '\0', DNS_NAME_MAX)) return NULL; } else strcpy(localproto, ""); - p = LookupServicesByName(name, ptr0->s_proto, DNS_NAME_MAX, ptr0->s_name, DNS_NAME_MAX, NULL); if (p == -1) return NULL; - ptr0->s_port = htons(p); - return ptr0; } diff --git a/libc/dns/getservbyport.c b/libc/dns/getservbyport.c index 891766b7c..091674823 100644 --- a/libc/dns/getservbyport.c +++ b/libc/dns/getservbyport.c @@ -23,7 +23,6 @@ │ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, │ │ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR │ │ OTHER DEALINGS IN THE SOFTWARE. │ -│ │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/dns/ent.h" #include "libc/dns/servicestxt.h" @@ -34,7 +33,6 @@ struct servent *getservbyport(int port, const char *proto) { static struct servent *ptr1, se1; static char s_name[DNS_NAME_MAX + 1]; static char localproto[DNS_NAME_MAX + 1]; - if (!ptr1) { se1.s_name = s_name; if (!(se1.s_aliases = calloc(1, sizeof(char *)))) return NULL; @@ -42,16 +40,14 @@ struct servent *getservbyport(int port, const char *proto) { se1.s_proto = localproto; ptr1 = &se1; } - if (proto) { if (!memccpy(localproto, proto, '\0', DNS_NAME_MAX)) return NULL; } else strcpy(localproto, ""); - if (LookupServicesByPort(ntohs(port), ptr1->s_proto, DNS_NAME_MAX, - ptr1->s_name, DNS_NAME_MAX, NULL) == -1) + ptr1->s_name, DNS_NAME_MAX, NULL) == -1) { return NULL; - + } ptr1->s_port = port; return ptr1; } diff --git a/libc/dns/herror.c b/libc/dns/herror.c index fc11db00b..7b9480714 100644 --- a/libc/dns/herror.c +++ b/libc/dns/herror.c @@ -23,11 +23,10 @@ │ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, │ │ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR │ │ OTHER DEALINGS IN THE SOFTWARE. │ -│ │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/dns/ent.h" -int h_errno = 0; +int h_errno; void herror(const char *s) { } diff --git a/libc/dns/hostent.c b/libc/dns/hostent.c index b376c6ac0..86f98f129 100644 --- a/libc/dns/hostent.c +++ b/libc/dns/hostent.c @@ -23,7 +23,6 @@ │ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, │ │ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR │ │ OTHER DEALINGS IN THE SOFTWARE. │ -│ │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/dns/ent.h" diff --git a/libc/dns/prototxt.c b/libc/dns/lookupprotobyname.c similarity index 64% rename from libc/dns/prototxt.c rename to libc/dns/lookupprotobyname.c index e974ab442..921cf371d 100644 --- a/libc/dns/prototxt.c +++ b/libc/dns/lookupprotobyname.c @@ -23,103 +23,12 @@ │ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, │ │ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR │ │ OTHER DEALINGS IN THE SOFTWARE. │ -│ │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/dns/prototxt.h" - #include "libc/bits/safemacros.internal.h" -#include "libc/dce.h" +#include "libc/dns/prototxt.h" #include "libc/errno.h" #include "libc/fmt/conv.h" -#include "libc/fmt/fmt.h" #include "libc/macros.internal.h" -#include "libc/mem/mem.h" -#include "libc/nt/systeminfo.h" -#include "libc/runtime/runtime.h" -#include "libc/str/str.h" - -static textwindows noinline char *GetNtProtocolsTxtPath(char *pathbuf, - uint32_t size) { - /* protocol, not plural */ - const char *const kWinHostsPath = "\\drivers\\etc\\protocol"; - uint32_t len = GetSystemDirectoryA(&pathbuf[0], size); - if (len && len + strlen(kWinHostsPath) + 1 < size) { - if (pathbuf[len] == '\\') pathbuf[len--] = '\0'; - memcpy(&pathbuf[len], kWinHostsPath, strlen(kWinHostsPath) + 1); - return &pathbuf[0]; - } else { - return NULL; - } -} - -/** - * Opens and searches /etc/protocols to find name for a given number. - * - * format of /etc/protocols is like this: - * - * # comment - * # NAME PROTOCOL ALIASES - * ip 0 IP - * icmp 1 ICMP - * - * @param protonum is the protocol number - * @param buf is a buffer to store the official name of the protocol - * @param bufsize is the size of buf - * @param filepath is the location of the protocols file - * (if NULL, uses /etc/protocols) - * @return 0 on success, -1 on error - * - * @note aliases are not read from the file. - */ -int LookupProtoByNumber(const int protonum, char *buf, size_t bufsize, - const char *filepath) { - FILE *f; - char *line; - char pathbuf[PATH_MAX]; - const char *path; - size_t linesize; - int found; - char *name, *number, *comment, *tok; - - if (!(path = filepath)) { - path = "/etc/protocols"; - if (IsWindows()) { - path = - firstnonnull(GetNtProtocolsTxtPath(pathbuf, ARRAYLEN(pathbuf)), path); - } - } - - if (bufsize == 0 || !(f = fopen(path, "r"))) { - return -1; - } - line = NULL; - linesize = 0; - found = 0; - - while (found == 0 && (getline(&line, &linesize, f)) != -1) { - if ((comment = strchr(line, '#'))) *comment = '\0'; - name = strtok_r(line, " \t\r\n\v", &tok); - number = strtok_r(NULL, " \t\r\n\v", &tok); - if (name && number && protonum == atoi(number)) { - if (!memccpy(buf, name, '\0', bufsize)) { - strcpy(buf, ""); - break; - } - found = 1; - } - } - free(line); - - if (ferror(f)) { - errno = ferror(f); - return -1; - } - fclose(f); - - if (!found) return -1; - - return 0; -} /** * Opens and searches /etc/protocols to find number for a given name. @@ -144,7 +53,6 @@ int LookupProtoByName(const char *protoname, char *buf, size_t bufsize, size_t linesize; int found, result; char *name, *number, *alias, *comment, *tok; - if (!(path = filepath)) { path = "/etc/protocols"; if (IsWindows()) { @@ -152,7 +60,6 @@ int LookupProtoByName(const char *protoname, char *buf, size_t bufsize, firstnonnull(GetNtProtocolsTxtPath(pathbuf, ARRAYLEN(pathbuf)), path); } } - if (bufsize == 0 || !(f = fopen(path, "r"))) { return -1; } @@ -160,7 +67,6 @@ int LookupProtoByName(const char *protoname, char *buf, size_t bufsize, linesize = 0; found = 0; result = -1; - while (found == 0 && (getline(&line, &linesize, f)) != -1) { if ((comment = strchr(line, '#'))) *comment = '\0'; name = strtok_r(line, " \t\r\n\v", &tok); @@ -169,7 +75,6 @@ int LookupProtoByName(const char *protoname, char *buf, size_t bufsize, alias = name; while (alias && strcasecmp(alias, protoname) != 0) alias = strtok_r(NULL, " \t\r\n\v", &tok); - if (alias) /* alias matched with protoname */ { if (!memccpy(buf, name, '\0', bufsize)) { @@ -182,14 +87,11 @@ int LookupProtoByName(const char *protoname, char *buf, size_t bufsize, } } free(line); - if (ferror(f)) { errno = ferror(f); return -1; } fclose(f); - if (!found) return -1; - return result; } diff --git a/libc/dns/lookupprotobynumber.c b/libc/dns/lookupprotobynumber.c new file mode 100644 index 000000000..c543b047c --- /dev/null +++ b/libc/dns/lookupprotobynumber.c @@ -0,0 +1,93 @@ +/*-*- 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│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ This is free and unencumbered software released into the public domain. │ +│ │ +│ Anyone is free to copy, modify, publish, use, compile, sell, or │ +│ distribute this software, either in source code form or as a compiled │ +│ binary, for any purpose, commercial or non-commercial, and by any │ +│ means. │ +│ │ +│ In jurisdictions that recognize copyright laws, the author or authors │ +│ of this software dedicate any and all copyright interest in the │ +│ software to the public domain. We make this dedication for the benefit │ +│ of the public at large and to the detriment of our heirs and │ +│ successors. We intend this dedication to be an overt act of │ +│ relinquishment in perpetuity of all present and future rights to this │ +│ software under copyright law. │ +│ │ +│ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, │ +│ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF │ +│ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. │ +│ IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR │ +│ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, │ +│ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR │ +│ OTHER DEALINGS IN THE SOFTWARE. │ +╚─────────────────────────────────────────────────────────────────────────────*/ +#include "libc/bits/safemacros.internal.h" +#include "libc/dns/prototxt.h" +#include "libc/errno.h" +#include "libc/fmt/conv.h" +#include "libc/macros.internal.h" + +/** + * Opens and searches /etc/protocols to find name for a given number. + * + * The format of /etc/protocols is like this: + * + * # comment + * # NAME PROTOCOL ALIASES + * ip 0 IP + * icmp 1 ICMP + * + * @param protonum is the protocol number + * @param buf is a buffer to store the official name of the protocol + * @param bufsize is the size of buf + * @param filepath is the location of the protocols file + * (if NULL, uses /etc/protocols) + * @return 0 on success, -1 on error + * @note aliases are not read from the file. + */ +int LookupProtoByNumber(const int protonum, char *buf, size_t bufsize, + const char *filepath) { + FILE *f; + char *line; + char pathbuf[PATH_MAX]; + const char *path; + size_t linesize; + int found; + char *name, *number, *comment, *tok; + if (!(path = filepath)) { + path = "/etc/protocols"; + if (IsWindows()) { + path = + firstnonnull(GetNtProtocolsTxtPath(pathbuf, ARRAYLEN(pathbuf)), path); + } + } + if (bufsize == 0 || !(f = fopen(path, "r"))) { + return -1; + } + line = NULL; + linesize = 0; + found = 0; + while (found == 0 && (getline(&line, &linesize, f)) != -1) { + if ((comment = strchr(line, '#'))) *comment = '\0'; + name = strtok_r(line, " \t\r\n\v", &tok); + number = strtok_r(NULL, " \t\r\n\v", &tok); + if (name && number && protonum == atoi(number)) { + if (!memccpy(buf, name, '\0', bufsize)) { + strcpy(buf, ""); + break; + } + found = 1; + } + } + free(line); + if (ferror(f)) { + errno = ferror(f); + return -1; + } + fclose(f); + if (!found) return -1; + return 0; +} diff --git a/libc/dns/servicestxt.c b/libc/dns/lookupservicesbyname.c similarity index 62% rename from libc/dns/servicestxt.c rename to libc/dns/lookupservicesbyname.c index 24742066a..ffefbf45c 100644 --- a/libc/dns/servicestxt.c +++ b/libc/dns/lookupservicesbyname.c @@ -23,117 +23,12 @@ │ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, │ │ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR │ │ OTHER DEALINGS IN THE SOFTWARE. │ -│ │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/dns/servicestxt.h" - #include "libc/bits/safemacros.internal.h" -#include "libc/dce.h" +#include "libc/dns/servicestxt.h" #include "libc/errno.h" #include "libc/fmt/conv.h" -#include "libc/fmt/fmt.h" #include "libc/macros.internal.h" -#include "libc/mem/mem.h" -#include "libc/nt/systeminfo.h" -#include "libc/runtime/runtime.h" -#include "libc/str/str.h" - -static textwindows noinline char *GetNtServicesTxtPath(char *pathbuf, - uint32_t size) { - const char *const kWinHostsPath = "\\drivers\\etc\\services"; - uint32_t len = GetSystemDirectoryA(&pathbuf[0], size); - if (len && len + strlen(kWinHostsPath) + 1 < size) { - if (pathbuf[len] == '\\') pathbuf[len--] = '\0'; - memcpy(&pathbuf[len], kWinHostsPath, strlen(kWinHostsPath) + 1); - return &pathbuf[0]; - } else { - return NULL; - } -} - -/** - * Opens and searches /etc/services to find name for a given port. - * - * format of /etc/services is like this: - * - * # comment - * # NAME PORT/PROTOCOL ALIASES - * ftp 21/tcp - * fsp 21/udp fspd - * ssh 22/tcp - * - * @param servport is the port number - * @param servproto is a NULL-terminated string (eg "tcp", "udp") - * (if servproto is an empty string, - * if is filled with the first matching - * protocol) - * @param servprotolen the size of servproto - * @param buf is a buffer to store the official name of the service - * @param bufsize is the size of buf - * @param filepath is the location of the services file - * (if NULL, uses /etc/services) - * @return 0 on success, -1 on error - * - * @note aliases are not read from the file. - */ -int LookupServicesByPort(const int servport, char *servproto, - size_t servprotolen, char *buf, size_t bufsize, - const char *filepath) { - FILE *f; - char *line; - char pathbuf[PATH_MAX]; - const char *path; - size_t linesize; - int found; - char *name, *port, *proto, *comment, *tok; - - if (!(path = filepath)) { - path = "/etc/services"; - if (IsWindows()) { - path = - firstnonnull(GetNtServicesTxtPath(pathbuf, ARRAYLEN(pathbuf)), path); - } - } - - if (servprotolen == 0 || bufsize == 0 || !(f = fopen(path, "r"))) { - return -1; - } - line = NULL; - linesize = 0; - found = 0; - strcpy(buf, ""); - - while (found == 0 && (getline(&line, &linesize, f)) != -1) { - if ((comment = strchr(line, '#'))) *comment = '\0'; - name = strtok_r(line, " \t\r\n\v", &tok); - port = strtok_r(NULL, "/ \t\r\n\v", &tok); - proto = strtok_r(NULL, " \t\r\n\v", &tok); - if (name && port && proto && servport == atoi(port)) { - if (!servproto[0] || strncasecmp(proto, servproto, servprotolen) == 0) { - if (!servproto[0] && !memccpy(servproto, proto, '\0', servprotolen)) { - strcpy(servproto, ""); - break; - } - if (!memccpy(buf, name, '\0', bufsize)) { - strcpy(buf, ""); - break; - } - found = 1; - } - } - } - free(line); - - if (ferror(f)) { - errno = ferror(f); - return -1; - } - fclose(f); - - if (!found) return -1; - - return 0; -} /** * Opens and searches /etc/services to find port for a given name. @@ -149,9 +44,7 @@ int LookupServicesByPort(const int servport, char *servproto, * @param bufsize is the size of buf * @param filepath is the location of services file * (if NULL, uses /etc/services) - * @return -1 on error, or - * positive port number - * + * @return -1 on error, or positive port number * @note aliases are read from file for comparison, but not returned. * @see LookupServicesByPort */ @@ -165,7 +58,6 @@ int LookupServicesByName(const char *servname, char *servproto, size_t linesize; int found, result; char *name, *port, *proto, *alias, *comment, *tok; - if (!(path = filepath)) { path = "/etc/services"; if (IsWindows()) { @@ -173,7 +65,6 @@ int LookupServicesByName(const char *servname, char *servproto, firstnonnull(GetNtServicesTxtPath(pathbuf, ARRAYLEN(pathbuf)), path); } } - if (servprotolen == 0 || !(f = fopen(path, "r"))) { return -1; } @@ -182,7 +73,6 @@ int LookupServicesByName(const char *servname, char *servproto, found = 0; result = -1; if (buf && bufsize != 0) strcpy(buf, ""); - while (found == 0 && (getline(&line, &linesize, f)) != -1) { if ((comment = strchr(line, '#'))) *comment = '\0'; name = strtok_r(line, " \t\r\n\v", &tok); @@ -192,7 +82,6 @@ int LookupServicesByName(const char *servname, char *servproto, alias = name; while (alias && strcasecmp(alias, servname) != 0) alias = strtok_r(NULL, " \t\r\n\v", &tok); - if (alias) /* alias matched with servname */ { if (!servproto[0] || strncasecmp(proto, servproto, servprotolen) == 0) { @@ -211,14 +100,11 @@ int LookupServicesByName(const char *servname, char *servproto, } } free(line); - if (ferror(f)) { errno = ferror(f); return -1; } fclose(f); - if (!found) return -1; - return result; } diff --git a/libc/dns/lookupservicesbyport.c b/libc/dns/lookupservicesbyport.c new file mode 100644 index 000000000..4fa9a364c --- /dev/null +++ b/libc/dns/lookupservicesbyport.c @@ -0,0 +1,108 @@ +/*-*- 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│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ This is free and unencumbered software released into the public domain. │ +│ │ +│ Anyone is free to copy, modify, publish, use, compile, sell, or │ +│ distribute this software, either in source code form or as a compiled │ +│ binary, for any purpose, commercial or non-commercial, and by any │ +│ means. │ +│ │ +│ In jurisdictions that recognize copyright laws, the author or authors │ +│ of this software dedicate any and all copyright interest in the │ +│ software to the public domain. We make this dedication for the benefit │ +│ of the public at large and to the detriment of our heirs and │ +│ successors. We intend this dedication to be an overt act of │ +│ relinquishment in perpetuity of all present and future rights to this │ +│ software under copyright law. │ +│ │ +│ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, │ +│ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF │ +│ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. │ +│ IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR │ +│ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, │ +│ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR │ +│ OTHER DEALINGS IN THE SOFTWARE. │ +╚─────────────────────────────────────────────────────────────────────────────*/ +#include "libc/bits/safemacros.internal.h" +#include "libc/dns/servicestxt.h" +#include "libc/errno.h" +#include "libc/fmt/conv.h" +#include "libc/macros.internal.h" + +/** + * Opens and searches /etc/services to find name for a given port. + * + * The format of /etc/services is like this: + * + * # comment + * # NAME PORT/PROTOCOL ALIASES + * ftp 21/tcp + * fsp 21/udp fspd + * ssh 22/tcp + * + * @param servport is the port number + * @param servproto is a NULL-terminated string (eg "tcp", "udp") + * (if servproto is an empty string, + * if is filled with the first matching + * protocol) + * @param servprotolen the size of servproto + * @param buf is a buffer to store the official name of the service + * @param bufsize is the size of buf + * @param filepath is the location of the services file + * (if NULL, uses /etc/services) + * @return 0 on success, -1 on error + * @note aliases are not read from the file. + */ +int LookupServicesByPort(const int servport, char *servproto, + size_t servprotolen, char *buf, size_t bufsize, + const char *filepath) { + FILE *f; + char *line; + char pathbuf[PATH_MAX]; + const char *path; + size_t linesize; + int found; + char *name, *port, *proto, *comment, *tok; + if (!(path = filepath)) { + path = "/etc/services"; + if (IsWindows()) { + path = + firstnonnull(GetNtServicesTxtPath(pathbuf, ARRAYLEN(pathbuf)), path); + } + } + if (servprotolen == 0 || bufsize == 0 || !(f = fopen(path, "r"))) { + return -1; + } + line = NULL; + linesize = 0; + found = 0; + strcpy(buf, ""); + while (found == 0 && (getline(&line, &linesize, f)) != -1) { + if ((comment = strchr(line, '#'))) *comment = '\0'; + name = strtok_r(line, " \t\r\n\v", &tok); + port = strtok_r(NULL, "/ \t\r\n\v", &tok); + proto = strtok_r(NULL, " \t\r\n\v", &tok); + if (name && port && proto && servport == atoi(port)) { + if (!servproto[0] || strncasecmp(proto, servproto, servprotolen) == 0) { + if (!servproto[0] && !memccpy(servproto, proto, '\0', servprotolen)) { + strcpy(servproto, ""); + break; + } + if (!memccpy(buf, name, '\0', bufsize)) { + strcpy(buf, ""); + break; + } + found = 1; + } + } + } + free(line); + if (ferror(f)) { + errno = ferror(f); + return -1; + } + fclose(f); + if (!found) return -1; + return 0; +} diff --git a/libc/dns/netent.c b/libc/dns/netent.c index abca500f0..f534c6a58 100644 --- a/libc/dns/netent.c +++ b/libc/dns/netent.c @@ -23,7 +23,6 @@ │ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, │ │ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR │ │ OTHER DEALINGS IN THE SOFTWARE. │ -│ │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/dns/ent.h" diff --git a/libc/dns/protoent.c b/libc/dns/protoent.c index bcc35c254..c03ff56ad 100644 --- a/libc/dns/protoent.c +++ b/libc/dns/protoent.c @@ -23,7 +23,6 @@ │ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, │ │ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR │ │ OTHER DEALINGS IN THE SOFTWARE. │ -│ │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/dns/ent.h" diff --git a/libc/dns/prototxt.h b/libc/dns/prototxt.h index 0b6d6f9ba..61d19a228 100644 --- a/libc/dns/prototxt.h +++ b/libc/dns/prototxt.h @@ -2,7 +2,6 @@ #define COSMOPOLITAN_LIBC_DNS_PROTOTXT_H_ #include "libc/sock/sock.h" #include "libc/stdio/stdio.h" - #if !(__ASSEMBLER__ + __LINKER__ + 0) COSMOPOLITAN_C_START_ @@ -10,6 +9,7 @@ int LookupProtoByNumber(const int, char *, size_t, const char *) paramsnonnull((2)); int LookupProtoByName(const char *, char *, size_t, const char *) paramsnonnull((1, 2)); +char *GetNtProtocolsTxtPath(char *, uint32_t); /* TODO: implement like struct HostsTxt? */ diff --git a/libc/dns/resolvednsreverse.c b/libc/dns/resolvednsreverse.c index a0efe532e..146e1c479 100644 --- a/libc/dns/resolvednsreverse.c +++ b/libc/dns/resolvednsreverse.c @@ -23,7 +23,6 @@ │ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, │ │ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR │ │ OTHER DEALINGS IN THE SOFTWARE. │ -│ │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/bits/bits.h" #include "libc/calls/calls.h" @@ -52,7 +51,6 @@ * @param name is a reversed IP address string ending with .in-addr.arpa * @param buf to store the obtained hostname if any * @param bufsize is size of buf - * * @return 0 on success, or -1 w/ errno * @error EAFNOSUPPORT, ENETDOWN, ENAMETOOLONG, EBADMSG */ @@ -63,7 +61,6 @@ int ResolveDnsReverse(const struct ResolvConf *resolvconf, int af, struct DnsHeader h, h2; uint8_t *p, *pe, msg[512]; uint16_t rtype, rclass, rdlength; - if (af != AF_INET && af != AF_UNSPEC) return eafnosupport(); if (!resolvconf->nameservers.i) return 0; memset(&h, 0, sizeof(h)); @@ -76,7 +73,6 @@ int ResolveDnsReverse(const struct ResolvConf *resolvconf, int af, q.qclass = DNS_CLASS_IN; memset(msg, 0, sizeof(msg)); SerializeDnsHeader(msg, &h); - if ((n = SerializeDnsQuestion(msg + 12, 500, &q)) == -1) return -1; if ((fd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) == -1) return -1; if (sendto(fd, msg, 12 + n, 0, resolvconf->nameservers.p, @@ -103,7 +99,6 @@ int ResolveDnsReverse(const struct ResolvConf *resolvconf, int af, rclass = READ16BE(p), p += 2; /* ttl */ p += 4; rdlength = READ16BE(p), p += 2; - if (p + rdlength <= pe && rtype == DNS_TYPE_PTR && rclass == DNS_CLASS_IN) { if (strnlen((char *)p, pe - p) + 1 > bufsize) diff --git a/libc/dns/servent.c b/libc/dns/servent.c index 8df8d3332..73a3d29a8 100644 --- a/libc/dns/servent.c +++ b/libc/dns/servent.c @@ -23,7 +23,6 @@ │ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, │ │ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR │ │ OTHER DEALINGS IN THE SOFTWARE. │ -│ │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/dns/ent.h" diff --git a/libc/dns/servicestxt.h b/libc/dns/servicestxt.h index 28e69eb37..2bd39dd28 100644 --- a/libc/dns/servicestxt.h +++ b/libc/dns/servicestxt.h @@ -2,7 +2,6 @@ #define COSMOPOLITAN_LIBC_DNS_SERVICESTXT_H_ #include "libc/sock/sock.h" #include "libc/stdio/stdio.h" - #if !(__ASSEMBLER__ + __LINKER__ + 0) COSMOPOLITAN_C_START_ @@ -10,6 +9,7 @@ int LookupServicesByPort(const int, char *, size_t, char *, size_t, const char *) paramsnonnull((2, 4)); int LookupServicesByName(const char *, char *, size_t, char *, size_t, const char *) paramsnonnull((1, 2)); +char *GetNtServicesTxtPath(char *, uint32_t); /* TODO: implement like struct HostsTxt? */ diff --git a/libc/log/backtrace3.c b/libc/log/backtrace3.c index 85a1c4982..e0708ad30 100644 --- a/libc/log/backtrace3.c +++ b/libc/log/backtrace3.c @@ -33,7 +33,7 @@ /** * Prints stack frames with symbols. * - * PrintBacktraceUsingSymbols(STDOUT_FILENO, NULL, GetSymbolTable()); + * PrintBacktraceUsingSymbols(STDOUT_FILENO, NULL, GetSymbolTable()); * * @param f is output stream * @param bp is rbp which can be NULL to detect automatically diff --git a/libc/log/startfatal.c b/libc/log/startfatal.c index abecaa951..ad8eadd30 100644 --- a/libc/log/startfatal.c +++ b/libc/log/startfatal.c @@ -22,7 +22,6 @@ #include "libc/log/internal.h" #include "libc/runtime/runtime.h" #include "libc/str/str.h" -#include "libc/sysv/consts/fileno.h" /** * Prints initial part of fatal message. @@ -31,18 +30,21 @@ * @see __start_fatal_ndebug() */ relegated void __start_fatal(const char *file, int line) { - char s[16 + 16 + 16 + 16 + PATH_MAX + 16 + NAME_MAX + 16], *p; - p = stpcpy(s, CLS); - p = stpcpy(p, RED); + bool colorful; + char s[16 + 16 + 16 + 16 + PATH_MAX + 16 + NAME_MAX + 16], *p = s; + colorful = cancolor(); + *p++ = '\r'; + if (colorful) p = stpcpy(p, "\e[J\e[30;101m"); p = stpcpy(p, "error"); - p = stpcpy(p, BLUE1); - p = stpcpy(p, ":"); + if (colorful) p = stpcpy(p, "\e[94;49m"); + *p++ = ':'; p = stpcpy(p, file); - p = stpcpy(p, ":"); + *p++ = ':'; p += int64toarray_radix10(line, p); - p = stpcpy(p, ":"); + *p++ = ':'; p = stpcpy(p, program_invocation_short_name); - p = stpcpy(p, RESET); - p = stpcpy(p, ": "); + if (colorful) p = stpcpy(p, "\e[0m"); + *p++ = ':'; + *p++ = ' '; write(2, s, p - s); } diff --git a/libc/log/startfatal_ndebug.c b/libc/log/startfatal_ndebug.c index 6e900b503..6a7d96540 100644 --- a/libc/log/startfatal_ndebug.c +++ b/libc/log/startfatal_ndebug.c @@ -16,8 +16,9 @@ │ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ +#include "libc/calls/calls.h" #include "libc/log/color.internal.h" -#include "libc/runtime/runtime.h" +#include "libc/log/internal.h" #include "libc/stdio/stdio.h" /** @@ -27,8 +28,11 @@ * @see __start_fatal() */ relegated void __start_fatal_ndebug(void) { - if (cancolor()) __print_string("\r\e[J"); - __print_string("error:"); - __print_string(program_invocation_name); - __print_string(": "); + char s[16 + 16 + 16 + 16 + PATH_MAX + 16], *p = s; + *p++ = '\r'; + if (cancolor()) p = stpcpy(p, "\e[J"); + p = stpcpy(p, "error:"); + p = stpcpy(p, program_invocation_name); + p = stpcpy(p, ": "); + write(2, s, p - s); } diff --git a/third_party/python/Modules/_asynciomodule.c b/third_party/python/Modules/_asynciomodule.c index d2c02139c..37666b4c7 100644 --- a/third_party/python/Modules/_asynciomodule.c +++ b/third_party/python/Modules/_asynciomodule.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "third_party/python/Include/abstract.h" #include "third_party/python/Include/boolobject.h" #include "third_party/python/Include/descrobject.h" diff --git a/third_party/python/Modules/_bisectmodule.c b/third_party/python/Modules/_bisectmodule.c index e8e0650eb..ba150569d 100644 --- a/third_party/python/Modules/_bisectmodule.c +++ b/third_party/python/Modules/_bisectmodule.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #define PY_SSIZE_T_CLEAN #include "third_party/python/Include/abstract.h" #include "third_party/python/Include/longobject.h" diff --git a/third_party/python/Modules/_codecsmodule.c b/third_party/python/Modules/_codecsmodule.c index 00ca0570e..3179b295c 100644 --- a/third_party/python/Modules/_codecsmodule.c +++ b/third_party/python/Modules/_codecsmodule.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #define PY_SSIZE_T_CLEAN #include "third_party/python/Include/abstract.h" #include "third_party/python/Include/bytesobject.h" diff --git a/third_party/python/Modules/_cryptmodule.c b/third_party/python/Modules/_cryptmodule.c index edfa461a2..294e824b5 100644 --- a/third_party/python/Modules/_cryptmodule.c +++ b/third_party/python/Modules/_cryptmodule.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "third_party/python/Include/modsupport.h" #include "third_party/python/Include/object.h" #include "third_party/python/Include/pymacro.h" diff --git a/third_party/python/Modules/_curses_panel.c b/third_party/python/Modules/_curses_panel.c index 6b8ef4fd4..0856b9a4c 100644 --- a/third_party/python/Modules/_curses_panel.c +++ b/third_party/python/Modules/_curses_panel.c @@ -1,4 +1,11 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ /* clang-format off */ + /* * Interface to the ncurses panel library * diff --git a/third_party/python/Modules/_datetimemodule.c b/third_party/python/Modules/_datetimemodule.c index c3bd82242..ec621a707 100644 --- a/third_party/python/Modules/_datetimemodule.c +++ b/third_party/python/Modules/_datetimemodule.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/assert.h" #include "libc/calls/weirdtypes.h" #include "libc/fmt/fmt.h" diff --git a/third_party/python/Modules/_decimal/_decimal.c b/third_party/python/Modules/_decimal/_decimal.c index 0273e1a89..4ae4dbf7e 100644 --- a/third_party/python/Modules/_decimal/_decimal.c +++ b/third_party/python/Modules/_decimal/_decimal.c @@ -1,5 +1,5 @@ /*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ -│vi: set net ft=c ts=2 sts=2 sw=2 fenc=utf-8 :vi│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ ╞══════════════════════════════════════════════════════════════════════════════╡ │ Copyright (c) 2008-2016 Stefan Krah. All rights reserved. │ │ │ @@ -27,7 +27,6 @@ │ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, │ │ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ - #include "libc/fmt/fmt.h" #include "third_party/python/Include/abstract.h" #include "third_party/python/Include/boolobject.h" @@ -5946,5 +5945,3 @@ error: return NULL; /* GCOV_NOT_REACHED */ } - - diff --git a/third_party/python/Modules/_decimal/libmpdec/basearith.c b/third_party/python/Modules/_decimal/libmpdec/basearith.c index 43d3e7fb2..e0fc20f3c 100644 --- a/third_party/python/Modules/_decimal/libmpdec/basearith.c +++ b/third_party/python/Modules/_decimal/libmpdec/basearith.c @@ -1,5 +1,5 @@ /*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ -│vi: set net ft=c ts=2 sts=2 sw=2 fenc=utf-8 :vi│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ ╞══════════════════════════════════════════════════════════════════════════════╡ │ Copyright (c) 2008-2016 Stefan Krah. All rights reserved. │ │ │ @@ -654,6 +654,3 @@ _mpd_shortdiv_b(mpd_uint_t *w, const mpd_uint_t *u, mpd_size_t n, return rem; } - - - diff --git a/third_party/python/Modules/_decimal/libmpdec/constants.c b/third_party/python/Modules/_decimal/libmpdec/constants.c index 52a7f79b4..198843794 100644 --- a/third_party/python/Modules/_decimal/libmpdec/constants.c +++ b/third_party/python/Modules/_decimal/libmpdec/constants.c @@ -1,5 +1,5 @@ /*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ -│vi: set net ft=c ts=2 sts=2 sw=2 fenc=utf-8 :vi│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ ╞══════════════════════════════════════════════════════════════════════════════╡ │ Copyright (c) 2008-2016 Stefan Krah. All rights reserved. │ │ │ @@ -133,5 +133,3 @@ const char *mpd_clamp_string[MPD_CLAMP_GUARD] = { "CLAMP_DEFAULT", "CLAMP_IEEE_754" }; - - diff --git a/third_party/python/Modules/_decimal/libmpdec/context.c b/third_party/python/Modules/_decimal/libmpdec/context.c index edf09c9df..082174bde 100644 --- a/third_party/python/Modules/_decimal/libmpdec/context.c +++ b/third_party/python/Modules/_decimal/libmpdec/context.c @@ -1,5 +1,5 @@ /*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ -│vi: set net ft=c ts=2 sts=2 sw=2 fenc=utf-8 :vi│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ ╞══════════════════════════════════════════════════════════════════════════════╡ │ Copyright (c) 2008-2016 Stefan Krah. All rights reserved. │ │ │ @@ -287,5 +287,3 @@ mpd_addstatus_raise(mpd_context_t *ctx, uint32_t flags) mpd_traphandler(ctx); } } - - diff --git a/third_party/python/Modules/_decimal/libmpdec/convolute.c b/third_party/python/Modules/_decimal/libmpdec/convolute.c index e501c3508..fe0b2dac5 100644 --- a/third_party/python/Modules/_decimal/libmpdec/convolute.c +++ b/third_party/python/Modules/_decimal/libmpdec/convolute.c @@ -1,5 +1,5 @@ /*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ -│vi: set net ft=c ts=2 sts=2 sw=2 fenc=utf-8 :vi│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ ╞══════════════════════════════════════════════════════════════════════════════╡ │ Copyright (c) 2008-2016 Stefan Krah. All rights reserved. │ │ │ @@ -176,5 +176,3 @@ fnt_autoconvolute(mpd_uint_t *c1, mpd_size_t n, int modnum) return 1; } - - diff --git a/third_party/python/Modules/_decimal/libmpdec/crt.c b/third_party/python/Modules/_decimal/libmpdec/crt.c index 02261b4a5..f0908e0f7 100644 --- a/third_party/python/Modules/_decimal/libmpdec/crt.c +++ b/third_party/python/Modules/_decimal/libmpdec/crt.c @@ -1,5 +1,5 @@ /*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ -│vi: set net ft=c ts=2 sts=2 sw=2 fenc=utf-8 :vi│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ ╞══════════════════════════════════════════════════════════════════════════════╡ │ Copyright (c) 2008-2016 Stefan Krah. All rights reserved. │ │ │ diff --git a/third_party/python/Modules/_decimal/libmpdec/difradix2.c b/third_party/python/Modules/_decimal/libmpdec/difradix2.c index 27cf79557..d34bbe3c5 100644 --- a/third_party/python/Modules/_decimal/libmpdec/difradix2.c +++ b/third_party/python/Modules/_decimal/libmpdec/difradix2.c @@ -1,5 +1,5 @@ /*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ -│vi: set net ft=c ts=2 sts=2 sw=2 fenc=utf-8 :vi│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ ╞══════════════════════════════════════════════════════════════════════════════╡ │ Copyright (c) 2008-2016 Stefan Krah. All rights reserved. │ │ │ @@ -174,5 +174,3 @@ fnt_dif2(mpd_uint_t a[], mpd_size_t n, struct fnt_params *tparams) bitreverse_permute(a, n); } - - diff --git a/third_party/python/Modules/_decimal/libmpdec/fnt.c b/third_party/python/Modules/_decimal/libmpdec/fnt.c index 5e319e7cb..6b36e3120 100644 --- a/third_party/python/Modules/_decimal/libmpdec/fnt.c +++ b/third_party/python/Modules/_decimal/libmpdec/fnt.c @@ -1,5 +1,5 @@ /*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ -│vi: set net ft=c ts=2 sts=2 sw=2 fenc=utf-8 :vi│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ ╞══════════════════════════════════════════════════════════════════════════════╡ │ Copyright (c) 2008-2016 Stefan Krah. All rights reserved. │ │ │ @@ -81,6 +81,3 @@ std_inv_fnt(mpd_uint_t *a, mpd_size_t n, int modnum) mpd_free(tparams); return 1; } - - - diff --git a/third_party/python/Modules/_decimal/libmpdec/fourstep.c b/third_party/python/Modules/_decimal/libmpdec/fourstep.c index af99282b5..ec5cb6e5c 100644 --- a/third_party/python/Modules/_decimal/libmpdec/fourstep.c +++ b/third_party/python/Modules/_decimal/libmpdec/fourstep.c @@ -1,5 +1,5 @@ /*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ -│vi: set net ft=c ts=2 sts=2 sw=2 fenc=utf-8 :vi│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ ╞══════════════════════════════════════════════════════════════════════════════╡ │ Copyright (c) 2008-2016 Stefan Krah. All rights reserved. │ │ │ @@ -259,5 +259,3 @@ inv_four_step_fnt(mpd_uint_t *a, mpd_size_t n, int modnum) return 1; } - - diff --git a/third_party/python/Modules/_decimal/libmpdec/io.c b/third_party/python/Modules/_decimal/libmpdec/io.c index 18835260c..4a91a02f8 100644 --- a/third_party/python/Modules/_decimal/libmpdec/io.c +++ b/third_party/python/Modules/_decimal/libmpdec/io.c @@ -1,5 +1,5 @@ /*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ -│vi: set net ft=c ts=2 sts=2 sw=2 fenc=utf-8 :vi│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ ╞══════════════════════════════════════════════════════════════════════════════╡ │ Copyright (c) 2008-2016 Stefan Krah. All rights reserved. │ │ │ @@ -1581,5 +1581,3 @@ mpd_print(const mpd_t *dec) fputs("mpd_fprint: output error\n", stderr); /* GCOV_NOT_REACHED */ } } - - diff --git a/third_party/python/Modules/_decimal/libmpdec/memory.c b/third_party/python/Modules/_decimal/libmpdec/memory.c index 0fa6f16c3..032c50a5f 100644 --- a/third_party/python/Modules/_decimal/libmpdec/memory.c +++ b/third_party/python/Modules/_decimal/libmpdec/memory.c @@ -1,5 +1,5 @@ /*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ -│vi: set net ft=c ts=2 sts=2 sw=2 fenc=utf-8 :vi│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ ╞══════════════════════════════════════════════════════════════════════════════╡ │ Copyright (c) 2008-2016 Stefan Krah. All rights reserved. │ │ │ @@ -292,5 +292,3 @@ mpd_realloc_dyn(mpd_t *result, mpd_ssize_t nwords, uint32_t *status) return 1; } - - diff --git a/third_party/python/Modules/_decimal/libmpdec/mpdecimal.c b/third_party/python/Modules/_decimal/libmpdec/mpdecimal.c index b52e6655d..3f0be0346 100644 --- a/third_party/python/Modules/_decimal/libmpdec/mpdecimal.c +++ b/third_party/python/Modules/_decimal/libmpdec/mpdecimal.c @@ -1,5 +1,5 @@ /*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ -│vi: set net ft=c ts=2 sts=2 sw=2 fenc=utf-8 :vi│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ ╞══════════════════════════════════════════════════════════════════════════════╡ │ Copyright (c) 2008-2016 Stefan Krah. All rights reserved. │ │ │ @@ -8399,6 +8399,3 @@ mpd_qimport_u32(mpd_t *result, mpd_qresize(result, result->len, status); mpd_qfinalize(result, ctx, status); } - - - diff --git a/third_party/python/Modules/_decimal/libmpdec/numbertheory.c b/third_party/python/Modules/_decimal/libmpdec/numbertheory.c index 1681b546a..02a0e15ac 100644 --- a/third_party/python/Modules/_decimal/libmpdec/numbertheory.c +++ b/third_party/python/Modules/_decimal/libmpdec/numbertheory.c @@ -1,5 +1,5 @@ /*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ -│vi: set net ft=c ts=2 sts=2 sw=2 fenc=utf-8 :vi│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ ╞══════════════════════════════════════════════════════════════════════════════╡ │ Copyright (c) 2008-2016 Stefan Krah. All rights reserved. │ │ │ @@ -133,5 +133,3 @@ _mpd_init_w3table(mpd_uint_t w3table[3], int sign, int modnum) w3table[1] = kernel; w3table[2] = POWMOD(kernel, 2); } - - diff --git a/third_party/python/Modules/_decimal/libmpdec/sixstep.c b/third_party/python/Modules/_decimal/libmpdec/sixstep.c index 65abc1053..d8a047cc2 100644 --- a/third_party/python/Modules/_decimal/libmpdec/sixstep.c +++ b/third_party/python/Modules/_decimal/libmpdec/sixstep.c @@ -1,5 +1,5 @@ /*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ -│vi: set net ft=c ts=2 sts=2 sw=2 fenc=utf-8 :vi│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ ╞══════════════════════════════════════════════════════════════════════════════╡ │ Copyright (c) 2008-2016 Stefan Krah. All rights reserved. │ │ │ @@ -214,5 +214,3 @@ inv_six_step_fnt(mpd_uint_t *a, mpd_size_t n, int modnum) return 1; } - - diff --git a/third_party/python/Modules/_decimal/libmpdec/transpose.c b/third_party/python/Modules/_decimal/libmpdec/transpose.c index 19a81e410..af2199ea5 100644 --- a/third_party/python/Modules/_decimal/libmpdec/transpose.c +++ b/third_party/python/Modules/_decimal/libmpdec/transpose.c @@ -1,5 +1,5 @@ /*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ -│vi: set net ft=c ts=2 sts=2 sw=2 fenc=utf-8 :vi│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ ╞══════════════════════════════════════════════════════════════════════════════╡ │ Copyright (c) 2008-2016 Stefan Krah. All rights reserved. │ │ │ @@ -274,5 +274,3 @@ transpose_pow2(mpd_uint_t *matrix, mpd_size_t rows, mpd_size_t cols) return 1; } - - diff --git a/third_party/python/Modules/_elementtree.c b/third_party/python/Modules/_elementtree.c index 1be08c352..5a1c0f931 100644 --- a/third_party/python/Modules/_elementtree.c +++ b/third_party/python/Modules/_elementtree.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #define PY_SSIZE_T_CLEAN #include "third_party/python/Include/abstract.h" #include "third_party/python/Include/bytesobject.h" @@ -17,6 +23,7 @@ #include "third_party/python/Include/structmember.h" #include "third_party/python/Include/warnings.h" /* clang-format off */ + /*-------------------------------------------------------------------- * Licensed to PSF under a Contributor Agreement. * See http://www.python.org/psf/license for licensing details. diff --git a/third_party/python/Modules/_gdbmmodule.c b/third_party/python/Modules/_gdbmmodule.c index cf504a572..bc73f87e9 100644 --- a/third_party/python/Modules/_gdbmmodule.c +++ b/third_party/python/Modules/_gdbmmodule.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ /* clang-format off */ /* DBM module using dictionary interface */ diff --git a/third_party/python/Modules/_heapqmodule.c b/third_party/python/Modules/_heapqmodule.c index 1d15f0565..d01f62fd8 100644 --- a/third_party/python/Modules/_heapqmodule.c +++ b/third_party/python/Modules/_heapqmodule.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/assert.h" #include "third_party/python/Include/listobject.h" #include "third_party/python/Include/modsupport.h" @@ -13,7 +19,6 @@ annotated by François Pinard, and converted to C by Raymond Hettinger. */ - static int siftdown(PyListObject *heap, Py_ssize_t startpos, Py_ssize_t pos) { diff --git a/third_party/python/Modules/_io/_iomodule.c b/third_party/python/Modules/_io/_iomodule.c index a5f760b53..5e761e9c2 100644 --- a/third_party/python/Modules/_io/_iomodule.c +++ b/third_party/python/Modules/_io/_iomodule.c @@ -1,5 +1,5 @@ /*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ -│vi: set net ft=c ts=2 sts=2 sw=2 fenc=utf-8 :vi│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ ╞══════════════════════════════════════════════════════════════════════════════╡ │ Python 3 │ │ https://docs.python.org/3/license.html │ @@ -21,6 +21,7 @@ #include "third_party/python/Include/weakrefobject.h" #include "third_party/python/Modules/_io/_iomodule.h" /* clang-format off */ + /* An implementation of the new I/O lib as defined by PEP 3116 - "New I/O" diff --git a/third_party/python/Modules/_io/bufferedio.c b/third_party/python/Modules/_io/bufferedio.c index a466c5567..e3f4c27fc 100644 --- a/third_party/python/Modules/_io/bufferedio.c +++ b/third_party/python/Modules/_io/bufferedio.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #define PY_SSIZE_T_CLEAN #include "libc/errno.h" #include "third_party/python/Include/abstract.h" diff --git a/third_party/python/Modules/_io/bytesio.c b/third_party/python/Modules/_io/bytesio.c index ff72ad6fe..cbf25ed97 100644 --- a/third_party/python/Modules/_io/bytesio.c +++ b/third_party/python/Modules/_io/bytesio.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/assert.h" #include "third_party/python/Include/abstract.h" #include "third_party/python/Include/boolobject.h" diff --git a/third_party/python/Modules/_io/clinic/textio.inc b/third_party/python/Modules/_io/clinic/textio.inc index d847d8987..dba53e163 100644 --- a/third_party/python/Modules/_io/clinic/textio.inc +++ b/third_party/python/Modules/_io/clinic/textio.inc @@ -1,5 +1,5 @@ /*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ -│vi: set net ft=c ts=2 sts=2 sw=2 fenc=utf-8 :vi│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ ╞══════════════════════════════════════════════════════════════════════════════╡ │ Python 3 │ │ https://docs.python.org/3/license.html │ diff --git a/third_party/python/Modules/_io/fileio.c b/third_party/python/Modules/_io/fileio.c index af980368b..361666eb8 100644 --- a/third_party/python/Modules/_io/fileio.c +++ b/third_party/python/Modules/_io/fileio.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #define PY_SSIZE_T_CLEAN #include "libc/calls/calls.h" #include "libc/errno.h" diff --git a/third_party/python/Modules/_io/iobase.c b/third_party/python/Modules/_io/iobase.c index 9e3a45251..84d90ee28 100644 --- a/third_party/python/Modules/_io/iobase.c +++ b/third_party/python/Modules/_io/iobase.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #define PY_SSIZE_T_CLEAN #include "third_party/python/Include/abstract.h" #include "third_party/python/Include/boolobject.h" diff --git a/third_party/python/Modules/_io/stringio.c b/third_party/python/Modules/_io/stringio.c index 780774ea0..12019382c 100644 --- a/third_party/python/Modules/_io/stringio.c +++ b/third_party/python/Modules/_io/stringio.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #define PY_SSIZE_T_CLEAN #include "third_party/python/Include/abstract.h" #include "third_party/python/Include/accu.h" diff --git a/third_party/python/Modules/_io/textio.c b/third_party/python/Modules/_io/textio.c index eff6490a9..469bd38f4 100644 --- a/third_party/python/Modules/_io/textio.c +++ b/third_party/python/Modules/_io/textio.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #define PY_SSIZE_T_CLEAN #include "third_party/python/Include/abstract.h" #include "third_party/python/Include/boolobject.h" diff --git a/third_party/python/Modules/_io/winconsoleio.c b/third_party/python/Modules/_io/winconsoleio.c index 84dd7423f..bdef012a4 100644 --- a/third_party/python/Modules/_io/winconsoleio.c +++ b/third_party/python/Modules/_io/winconsoleio.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #define PY_SSIZE_T_CLEAN #include "third_party/python/Modules/_io/_iomodule.h" /* clang-format off */ diff --git a/third_party/python/Modules/_localemodule.c b/third_party/python/Modules/_localemodule.c index 960387dd4..1754a0588 100644 --- a/third_party/python/Modules/_localemodule.c +++ b/third_party/python/Modules/_localemodule.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #define PY_SSIZE_T_CLEAN #include "libc/unicode/locale.h" #include "third_party/python/Include/dictobject.h" diff --git a/third_party/python/Modules/_lzmamodule.c b/third_party/python/Modules/_lzmamodule.c index b18aa95d6..0da2a93ab 100644 --- a/third_party/python/Modules/_lzmamodule.c +++ b/third_party/python/Modules/_lzmamodule.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #define PY_SSIZE_T_CLEAN #include "third_party/python/Include/structmember.h" /* clang-format off */ diff --git a/third_party/python/Modules/_multiprocessing/multiprocessing.c b/third_party/python/Modules/_multiprocessing/multiprocessing.c index 104654202..710b64ba9 100644 --- a/third_party/python/Modules/_multiprocessing/multiprocessing.c +++ b/third_party/python/Modules/_multiprocessing/multiprocessing.c @@ -1,5 +1,12 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "third_party/python/Modules/_multiprocessing/multiprocessing.h" /* clang-format off */ + /* * Extension module used by multiprocessing package * diff --git a/third_party/python/Modules/_multiprocessing/semaphore.c b/third_party/python/Modules/_multiprocessing/semaphore.c index 5414088d0..a854a11b1 100644 --- a/third_party/python/Modules/_multiprocessing/semaphore.c +++ b/third_party/python/Modules/_multiprocessing/semaphore.c @@ -1,5 +1,12 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "third_party/python/Modules/_multiprocessing/multiprocessing.h" /* clang-format off */ + /* * A type which wraps a semaphore * diff --git a/third_party/python/Modules/_opcode.c b/third_party/python/Modules/_opcode.c index 8788d3370..a945f7a71 100644 --- a/third_party/python/Modules/_opcode.c +++ b/third_party/python/Modules/_opcode.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "third_party/python/Include/compile.h" #include "third_party/python/Include/longobject.h" #include "third_party/python/Include/modsupport.h" diff --git a/third_party/python/Modules/_operator.c b/third_party/python/Modules/_operator.c index 59f932247..49628ef8e 100644 --- a/third_party/python/Modules/_operator.c +++ b/third_party/python/Modules/_operator.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "third_party/python/Include/abstract.h" #include "third_party/python/Include/boolobject.h" #include "third_party/python/Include/dictobject.h" diff --git a/third_party/python/Modules/_pickle.c b/third_party/python/Modules/_pickle.c index 793142c3f..7ba727266 100644 --- a/third_party/python/Modules/_pickle.c +++ b/third_party/python/Modules/_pickle.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/errno.h" #include "libc/fmt/conv.h" #include "third_party/python/Include/abstract.h" diff --git a/third_party/python/Modules/_posixsubprocess.c b/third_party/python/Modules/_posixsubprocess.c index 19af5b68b..0b1ad230d 100644 --- a/third_party/python/Modules/_posixsubprocess.c +++ b/third_party/python/Modules/_posixsubprocess.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/calls/calls.h" #include "libc/calls/weirdtypes.h" #include "libc/dce.h" diff --git a/third_party/python/Modules/_randommodule.c b/third_party/python/Modules/_randommodule.c index aa43c87a2..dcc2a33ac 100644 --- a/third_party/python/Modules/_randommodule.c +++ b/third_party/python/Modules/_randommodule.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/calls/calls.h" #include "third_party/python/Include/floatobject.h" #include "third_party/python/Include/longobject.h" diff --git a/third_party/python/Modules/_sha3.c b/third_party/python/Modules/_sha3.c index d8cac112e..31ae55350 100644 --- a/third_party/python/Modules/_sha3.c +++ b/third_party/python/Modules/_sha3.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "third_party/python/Include/abstract.h" #include "third_party/python/Include/bytesobject.h" #include "third_party/python/Include/descrobject.h" diff --git a/third_party/python/Modules/_sre.c b/third_party/python/Modules/_sre.c index bc868ee77..650e5120e 100644 --- a/third_party/python/Modules/_sre.c +++ b/third_party/python/Modules/_sre.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "third_party/python/Include/abstract.h" #include "third_party/python/Include/boolobject.h" #include "third_party/python/Include/bytesobject.h" diff --git a/third_party/python/Modules/_ssl.c b/third_party/python/Modules/_ssl.c index d065c7c9a..d9c0a298a 100644 --- a/third_party/python/Modules/_ssl.c +++ b/third_party/python/Modules/_ssl.c @@ -1,4 +1,11 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #define PY_SSIZE_T_CLEAN +#include "third_party/python/Modules/socketmodule.h" /* clang-format off */ /* SSL socket module @@ -39,7 +46,6 @@ #endif /* Include symbols from _socket module */ -#include "third_party/python/Modules/socketmodule.h" static PySocketModule_APIObject PySocketModule; diff --git a/third_party/python/Modules/_stat.c b/third_party/python/Modules/_stat.c index 7b6b949d5..9a807a24c 100644 --- a/third_party/python/Modules/_stat.c +++ b/third_party/python/Modules/_stat.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #define PY_SSIZE_T_CLEAN #include "libc/calls/calls.h" #include "libc/calls/weirdtypes.h" diff --git a/third_party/python/Modules/_struct.c b/third_party/python/Modules/_struct.c index 759423321..abba200f9 100644 --- a/third_party/python/Modules/_struct.c +++ b/third_party/python/Modules/_struct.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #define PY_SSIZE_T_CLEAN #include "libc/assert.h" #include "third_party/python/Include/abstract.h" diff --git a/third_party/python/Modules/_testbuffer.c b/third_party/python/Modules/_testbuffer.c index 489fbecb2..24f4b66e3 100644 --- a/third_party/python/Modules/_testbuffer.c +++ b/third_party/python/Modules/_testbuffer.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #define PY_SSIZE_T_CLEAN #include "third_party/python/Include/abstract.h" #include "third_party/python/Include/boolobject.h" diff --git a/third_party/python/Modules/_testcapimodule.c b/third_party/python/Modules/_testcapimodule.c index 7c3618b3b..683bf206d 100644 --- a/third_party/python/Modules/_testcapimodule.c +++ b/third_party/python/Modules/_testcapimodule.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #define PY_SSIZE_T_CLEAN #undef Py_BUILD_CORE #include "libc/calls/calls.h" diff --git a/third_party/python/Modules/_testimportmultiple.c b/third_party/python/Modules/_testimportmultiple.c deleted file mode 100644 index 1dc11bd08..000000000 --- a/third_party/python/Modules/_testimportmultiple.c +++ /dev/null @@ -1,58 +0,0 @@ -/* clang-format off */ -/* - * C extensions module to test importing multiple modules from one compiled - * file (issue16421). This file defines 3 modules (_testimportmodule, - * foo, bar), only the first one is called the same as the compiled file. - */ -#include - -static struct PyModuleDef _testimportmultiple = { - PyModuleDef_HEAD_INIT, - "_testimportmultiple", - "_testimportmultiple doc", - -1, - NULL, - NULL, - NULL, - NULL, - NULL -}; - -PyMODINIT_FUNC PyInit__testimportmultiple(void) -{ - return PyModule_Create(&_testimportmultiple); -} - -static struct PyModuleDef _foomodule = { - PyModuleDef_HEAD_INIT, - "_testimportmultiple_foo", - "_testimportmultiple_foo doc", - -1, - NULL, - NULL, - NULL, - NULL, - NULL -}; - -PyMODINIT_FUNC PyInit__testimportmultiple_foo(void) -{ - return PyModule_Create(&_foomodule); -} - -static struct PyModuleDef _barmodule = { - PyModuleDef_HEAD_INIT, - "_testimportmultiple_bar", - "_testimportmultiple_bar doc", - -1, - NULL, - NULL, - NULL, - NULL, - NULL -}; - -PyMODINIT_FUNC PyInit__testimportmultiple_bar(void){ - return PyModule_Create(&_barmodule); -} - diff --git a/third_party/python/Modules/_testmultiphase.c b/third_party/python/Modules/_testmultiphase.c index d386bcf8e..8d4f13e14 100644 --- a/third_party/python/Modules/_testmultiphase.c +++ b/third_party/python/Modules/_testmultiphase.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "third_party/python/Include/dictobject.h" #include "third_party/python/Include/longobject.h" #include "third_party/python/Include/methodobject.h" diff --git a/third_party/python/Modules/_threadmodule.c b/third_party/python/Modules/_threadmodule.c index 50ad09423..007e9b2f1 100644 --- a/third_party/python/Modules/_threadmodule.c +++ b/third_party/python/Modules/_threadmodule.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "third_party/python/Include/structmember.h" /* clang-format off */ diff --git a/third_party/python/Modules/_tracemalloc.c b/third_party/python/Modules/_tracemalloc.c index da772251a..6c8af64a2 100644 --- a/third_party/python/Modules/_tracemalloc.c +++ b/third_party/python/Modules/_tracemalloc.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/errno.h" #include "libc/fmt/conv.h" #include "third_party/python/Include/boolobject.h" diff --git a/third_party/python/Modules/_weakref.c b/third_party/python/Modules/_weakref.c index 3a497c0c3..6566b0d70 100644 --- a/third_party/python/Modules/_weakref.c +++ b/third_party/python/Modules/_weakref.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "third_party/python/Include/dictobject.h" #include "third_party/python/Include/listobject.h" #include "third_party/python/Include/longobject.h" diff --git a/third_party/python/Modules/_winapi.c b/third_party/python/Modules/_winapi.c index f4a284434..394231a95 100644 --- a/third_party/python/Modules/_winapi.c +++ b/third_party/python/Modules/_winapi.c @@ -1,4 +1,14 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ +#include "third_party/python/Include/Python.h" +#include "third_party/python/Include/structmember.h" +#include "third_party/python/Modules/winreparse.h" /* clang-format off */ + /* * Support routines from the Windows API * @@ -35,10 +45,6 @@ /* Licensed to PSF under a Contributor Agreement. */ /* See http://www.python.org/2.4/license for licensing details. */ -#include "third_party/python/Include/Python.h" -#include "third_party/python/Include/structmember.h" -#include "third_party/python/Modules/winreparse.h" - #if defined(MS_WIN32) && !defined(MS_WIN64) #define HANDLE_TO_PYNUM(handle) \ PyLong_FromUnsignedLong((unsigned long) handle) diff --git a/third_party/python/Modules/arraymodule.c b/third_party/python/Modules/arraymodule.c index bbffdc312..3ef511438 100644 --- a/third_party/python/Modules/arraymodule.c +++ b/third_party/python/Modules/arraymodule.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #define PY_SSIZE_T_CLEAN #include "third_party/python/Include/abstract.h" #include "third_party/python/Include/boolobject.h" diff --git a/third_party/python/Modules/atexitmodule.c b/third_party/python/Modules/atexitmodule.c index c84722065..088d76516 100644 --- a/third_party/python/Modules/atexitmodule.c +++ b/third_party/python/Modules/atexitmodule.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "third_party/python/Include/abstract.h" #include "third_party/python/Include/longobject.h" #include "third_party/python/Include/modsupport.h" diff --git a/third_party/python/Modules/audioop.c b/third_party/python/Modules/audioop.c index d58741f9d..b5adb95d5 100644 --- a/third_party/python/Modules/audioop.c +++ b/third_party/python/Modules/audioop.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #define PY_SSIZE_T_CLEAN #include "libc/math.h" #include "third_party/python/Include/dictobject.h" diff --git a/third_party/python/Modules/binascii.c b/third_party/python/Modules/binascii.c index 72e6b55e5..00908fe9c 100644 --- a/third_party/python/Modules/binascii.c +++ b/third_party/python/Modules/binascii.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #define PY_SSIZE_T_CLEAN #include "libc/assert.h" #include "third_party/python/Include/abstract.h" @@ -12,6 +18,7 @@ #include "third_party/python/Include/unicodeobject.h" #include "third_party/zlib/zlib.h" /* clang-format off */ + /* ** Routines to represent binary data in ASCII and vice-versa ** @@ -153,8 +160,6 @@ static const char table_a2b_base64[] = { static const unsigned char table_b2a_base64[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; - - static const unsigned short crctab_hqx[256] = { 0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50a5, 0x60c6, 0x70e7, 0x8108, 0x9129, 0xa14a, 0xb16b, 0xc18c, 0xd1ad, 0xe1ce, 0xf1ef, @@ -1411,11 +1416,9 @@ static struct PyMethodDef binascii_module_methods[] = { {NULL, NULL} /* sentinel */ }; - /* Initialization function for the module (*must* be called PyInit_binascii) */ PyDoc_STRVAR(doc_binascii, "Conversion between binary data and ASCII"); - static struct PyModuleDef binasciimodule = { PyModuleDef_HEAD_INIT, "binascii", diff --git a/third_party/python/Modules/cjkcodecs/_codecs_cn.c b/third_party/python/Modules/cjkcodecs/_codecs_cn.c index 2db085637..e0a2b955d 100644 --- a/third_party/python/Modules/cjkcodecs/_codecs_cn.c +++ b/third_party/python/Modules/cjkcodecs/_codecs_cn.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "third_party/python/Modules/cjkcodecs/cjkcodecs.h" #include "third_party/python/Modules/cjkcodecs/mappings_cn.inc" /* clang-format off */ diff --git a/third_party/python/Modules/cjkcodecs/_codecs_hk.c b/third_party/python/Modules/cjkcodecs/_codecs_hk.c index 4aba5c9b2..1c1965d0c 100644 --- a/third_party/python/Modules/cjkcodecs/_codecs_hk.c +++ b/third_party/python/Modules/cjkcodecs/_codecs_hk.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #define USING_IMPORTED_MAPS #include "third_party/python/Modules/cjkcodecs/cjkcodecs.h" #include "third_party/python/Modules/cjkcodecs/mappings_hk.inc" diff --git a/third_party/python/Modules/cjkcodecs/_codecs_iso2022.c b/third_party/python/Modules/cjkcodecs/_codecs_iso2022.c index 82ab9379c..148afd70d 100644 --- a/third_party/python/Modules/cjkcodecs/_codecs_iso2022.c +++ b/third_party/python/Modules/cjkcodecs/_codecs_iso2022.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ /* clang-format off */ /* * _codecs_iso2022.c: Codecs collection for ISO-2022 encodings. diff --git a/third_party/python/Modules/cjkcodecs/_codecs_jp.c b/third_party/python/Modules/cjkcodecs/_codecs_jp.c index a8c6a4b50..91c8c01d0 100644 --- a/third_party/python/Modules/cjkcodecs/_codecs_jp.c +++ b/third_party/python/Modules/cjkcodecs/_codecs_jp.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ /* clang-format off */ /* * _codecs_jp.c: Codecs collection for Japanese encodings diff --git a/third_party/python/Modules/cjkcodecs/_codecs_kr.c b/third_party/python/Modules/cjkcodecs/_codecs_kr.c index 22ca4bc51..757df9e0e 100644 --- a/third_party/python/Modules/cjkcodecs/_codecs_kr.c +++ b/third_party/python/Modules/cjkcodecs/_codecs_kr.c @@ -1,4 +1,11 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ /* clang-format off */ + /* * _codecs_kr.c: Codecs collection for Korean encodings * diff --git a/third_party/python/Modules/cjkcodecs/multibytecodec.c b/third_party/python/Modules/cjkcodecs/multibytecodec.c index a44284e0c..56ac3e3f7 100644 --- a/third_party/python/Modules/cjkcodecs/multibytecodec.c +++ b/third_party/python/Modules/cjkcodecs/multibytecodec.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #define PY_SSIZE_T_CLEAN #include "third_party/python/Include/abstract.h" #include "third_party/python/Include/codecs.h" diff --git a/third_party/python/Modules/cmathmodule.c b/third_party/python/Modules/cmathmodule.c index bcfa6b1d0..3249300c2 100644 --- a/third_party/python/Modules/cmathmodule.c +++ b/third_party/python/Modules/cmathmodule.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/errno.h" #include "libc/math.h" #include "third_party/python/Include/boolobject.h" diff --git a/third_party/python/Modules/config.c b/third_party/python/Modules/config.c index 8bb6d96f4..5fe5324c2 100644 --- a/third_party/python/Modules/config.c +++ b/third_party/python/Modules/config.c @@ -1,4 +1,11 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ /* clang-format off */ + /* Generated automatically from ./Modules/config.c.in by makesetup. */ /* -*- C -*- *********************************************** Copyright (c) 2000, BeOpen.com. diff --git a/third_party/python/Modules/errnomodule.c b/third_party/python/Modules/errnomodule.c index 65d6b9e48..b7ef78d34 100644 --- a/third_party/python/Modules/errnomodule.c +++ b/third_party/python/Modules/errnomodule.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/dce.h" #include "libc/errno.h" #include "third_party/python/Include/dictobject.h" diff --git a/third_party/python/Modules/faulthandler.c b/third_party/python/Modules/faulthandler.c index 3e93c8171..854cb7de7 100644 --- a/third_party/python/Modules/faulthandler.c +++ b/third_party/python/Modules/faulthandler.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/calls/calls.h" #include "libc/calls/sigbits.h" #include "libc/calls/struct/sigaction.h" diff --git a/third_party/python/Modules/fcntlmodule.c b/third_party/python/Modules/fcntlmodule.c index 5990a2153..a73a27155 100644 --- a/third_party/python/Modules/fcntlmodule.c +++ b/third_party/python/Modules/fcntlmodule.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #define PY_SSIZE_T_CLEAN #include "libc/calls/calls.h" #include "libc/calls/ioctl.h" diff --git a/third_party/python/Modules/fpectlmodule.c b/third_party/python/Modules/fpectlmodule.c index 75a0f50a2..aa24240f7 100644 --- a/third_party/python/Modules/fpectlmodule.c +++ b/third_party/python/Modules/fpectlmodule.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/runtime/runtime.h" #include "third_party/python/Include/dictobject.h" #include "third_party/python/Include/methodobject.h" diff --git a/third_party/python/Modules/fpetestmodule.c b/third_party/python/Modules/fpetestmodule.c index 5a949c7dd..8ba791c4a 100644 --- a/third_party/python/Modules/fpetestmodule.c +++ b/third_party/python/Modules/fpetestmodule.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "third_party/python/Include/dictobject.h" #include "third_party/python/Include/methodobject.h" #include "third_party/python/Include/modsupport.h" diff --git a/third_party/python/Modules/gcmodule.c b/third_party/python/Modules/gcmodule.c index 68979e9a9..b9190f049 100644 --- a/third_party/python/Modules/gcmodule.c +++ b/third_party/python/Modules/gcmodule.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "third_party/python/Include/abstract.h" #include "third_party/python/Include/boolobject.h" #include "third_party/python/Include/classobject.h" diff --git a/third_party/python/Modules/getbuildinfo.c b/third_party/python/Modules/getbuildinfo.c index a92426c95..426f7ec7c 100644 --- a/third_party/python/Modules/getbuildinfo.c +++ b/third_party/python/Modules/getbuildinfo.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "third_party/python/Include/pyerrors.h" #include "third_party/python/Include/pylifecycle.h" /* clang-format off */ diff --git a/third_party/python/Modules/getpath.c b/third_party/python/Modules/getpath.c index c90fa8779..46b6d0214 100644 --- a/third_party/python/Modules/getpath.c +++ b/third_party/python/Modules/getpath.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/calls/calls.h" #include "libc/calls/struct/stat.h" #include "libc/errno.h" diff --git a/third_party/python/Modules/grpmodule.c b/third_party/python/Modules/grpmodule.c index 200e96497..7a6a7f951 100644 --- a/third_party/python/Modules/grpmodule.c +++ b/third_party/python/Modules/grpmodule.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "third_party/musl/passwd.h" #include "third_party/python/Include/abstract.h" #include "third_party/python/Include/bytesobject.h" diff --git a/third_party/python/Modules/hashtable.c b/third_party/python/Modules/hashtable.c index 5984b9dfc..dae163c91 100644 --- a/third_party/python/Modules/hashtable.c +++ b/third_party/python/Modules/hashtable.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "third_party/python/Include/pyhash.h" #include "third_party/python/Include/pymem.h" #include "third_party/python/Modules/hashtable.h" diff --git a/third_party/python/Modules/itertoolsmodule.c b/third_party/python/Modules/itertoolsmodule.c index d35bcf244..971462f93 100644 --- a/third_party/python/Modules/itertoolsmodule.c +++ b/third_party/python/Modules/itertoolsmodule.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #define PY_SSIZE_T_CLEAN #include "third_party/python/Include/abstract.h" #include "third_party/python/Include/boolobject.h" @@ -13,7 +19,6 @@ by Raymond D. Hettinger */ - /* groupby object ************************************************************/ typedef struct { diff --git a/third_party/python/Modules/main.c b/third_party/python/Modules/main.c index e83d64650..2c00911c3 100644 --- a/third_party/python/Modules/main.c +++ b/third_party/python/Modules/main.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/calls/calls.h" #include "libc/errno.h" #include "libc/stdio/stdio.h" diff --git a/third_party/python/Modules/mathmodule.c b/third_party/python/Modules/mathmodule.c index 762e6ac47..188dbf345 100644 --- a/third_party/python/Modules/mathmodule.c +++ b/third_party/python/Modules/mathmodule.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/assert.h" #include "libc/errno.h" #include "libc/math.h" diff --git a/third_party/python/Modules/md5module.c b/third_party/python/Modules/md5module.c index dd02246fe..031e3292b 100644 --- a/third_party/python/Modules/md5module.c +++ b/third_party/python/Modules/md5module.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/assert.h" #include "third_party/python/Include/abstract.h" #include "third_party/python/Include/bytesobject.h" diff --git a/third_party/python/Modules/mmapmodule.c b/third_party/python/Modules/mmapmodule.c index 9420e294b..5fe69aa1b 100644 --- a/third_party/python/Modules/mmapmodule.c +++ b/third_party/python/Modules/mmapmodule.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #define PY_SSIZE_T_CLEAN #include "libc/calls/calls.h" #include "libc/calls/weirdtypes.h" diff --git a/third_party/python/Modules/ossaudiodev.c b/third_party/python/Modules/ossaudiodev.c index dbe92d7ef..802023832 100644 --- a/third_party/python/Modules/ossaudiodev.c +++ b/third_party/python/Modules/ossaudiodev.c @@ -1,6 +1,14 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #define PY_SSIZE_T_CLEAN +#include "libc/sysv/consts/o.h" #include "third_party/python/Include/structmember.h" /* clang-format off */ + /* * ossaudiodev -- Python interface to the OSS (Open Sound System) API. * This is the standard audio API for Linux and some @@ -22,25 +30,8 @@ * $Id$ */ -#ifdef HAVE_FCNTL_H -#include -#else -#define O_RDONLY 00 -#define O_WRONLY 01 -#endif - -#ifdef __linux__ - -#ifndef HAVE_STDINT_H -typedef unsigned long uint32_t; -#endif - -#elif defined(__FreeBSD__) - -# ifndef SNDCTL_DSP_CHANNELS -# define SNDCTL_DSP_CHANNELS SOUND_PCM_WRITE_CHANNELS -# endif - +#ifndef SNDCTL_DSP_CHANNELS +#define SNDCTL_DSP_CHANNELS SOUND_PCM_WRITE_CHANNELS #endif typedef struct { @@ -58,13 +49,10 @@ typedef struct { int fd; /* The open mixer device */ } oss_mixer_t; - static PyTypeObject OSSAudioType; static PyTypeObject OSSMixerType; - static PyObject *OSSAudioError; - /* ---------------------------------------------------------------------- * DSP object initialization/deallocation */ @@ -151,7 +139,6 @@ oss_dealloc(oss_audio_t *self) PyObject_Del(self); } - /* ---------------------------------------------------------------------- * Mixer object initialization/deallocation */ @@ -196,7 +183,6 @@ oss_mixer_dealloc(oss_mixer_t *self) PyObject_Del(self); } - /* Methods to wrap the OSS ioctls. The calling convention is pretty simple: nonblock() -> ioctl(fd, SNDCTL_DSP_NONBLOCK) @@ -204,7 +190,6 @@ oss_mixer_dealloc(oss_mixer_t *self) etc. */ - /* ---------------------------------------------------------------------- * Helper functions */ @@ -249,7 +234,6 @@ _do_ioctl_1(int fd, PyObject *args, char *fname, int cmd) return PyLong_FromLong(arg); } - /* _do_ioctl_1_internal() is a wrapper for ioctls that take no inputs but return an output -- ie. we need to pass a pointer to a local C variable so the driver can write its output there, but from Python @@ -275,7 +259,6 @@ _do_ioctl_1_internal(int fd, PyObject *args, char *fname, int cmd) } - /* _do_ioctl_0() is a private helper for the no-argument ioctls: SNDCTL_DSP_{SYNC,RESET,POST}. */ static PyObject * @@ -303,7 +286,6 @@ _do_ioctl_0(int fd, PyObject *args, char *fname, int cmd) return Py_None; } - /* ---------------------------------------------------------------------- * Methods of DSP objects (OSSAudioType) */ @@ -389,7 +371,6 @@ oss_post(oss_audio_t *self, PyObject *args) return _do_ioctl_0(self->fd, args, "post", SNDCTL_DSP_POST); } - /* Regular file methods: read(), write(), close(), etc. as well as one convenience method, writeall(). */ @@ -551,7 +532,6 @@ oss_fileno(oss_audio_t *self, PyObject *unused) return PyLong_FromLong(self->fd); } - /* Convenience methods: these generally wrap a couple of ioctls into one common task. */ @@ -639,7 +619,6 @@ _ssize(oss_audio_t *self, int *nchannels, int *ssize) return 0; } - /* bufsize returns the size of the hardware audio buffer in number of samples */ static PyObject * @@ -727,7 +706,6 @@ oss_getptr(oss_audio_t *self, PyObject *unused) return Py_BuildValue("iii", info.bytes, info.blocks, info.ptr); } - /* ---------------------------------------------------------------------- * Methods of mixer objects (OSSMixerType) */ @@ -857,7 +835,6 @@ oss_mixer_set_recsrc(oss_mixer_t *self, PyObject *args) SOUND_MIXER_WRITE_RECSRC); } - /* ---------------------------------------------------------------------- * Method tables and other bureaucracy */ @@ -1022,7 +999,6 @@ static PyTypeObject OSSMixerType = { oss_mixer_methods, /*tp_methods*/ }; - static PyObject * ossopen(PyObject *self, PyObject *args) { @@ -1041,15 +1017,12 @@ static PyMethodDef ossaudiodev_methods[] = { { 0, 0 }, }; - #define _EXPORT_INT(mod, name) \ if (PyModule_AddIntConstant(mod, #name, (long) (name)) == -1) return NULL; - static char *control_labels[] = SOUND_DEVICE_LABELS; static char *control_names[] = SOUND_DEVICE_NAMES; - static int build_namelists (PyObject *module) { @@ -1092,7 +1065,6 @@ error1: return -1; } - static struct PyModuleDef ossaudiodevmodule = { PyModuleDef_HEAD_INIT, "ossaudiodev", diff --git a/third_party/python/Modules/overlapped.c b/third_party/python/Modules/overlapped.c index b2ae3fe94..2a84f2a6c 100644 --- a/third_party/python/Modules/overlapped.c +++ b/third_party/python/Modules/overlapped.c @@ -1,5 +1,12 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "third_party/python/Include/structmember.h" /* clang-format off */ + /* * Support for overlapped IO * diff --git a/third_party/python/Modules/parsermodule.c b/third_party/python/Modules/parsermodule.c index 0685b43ae..5adb11a02 100644 --- a/third_party/python/Modules/parsermodule.c +++ b/third_party/python/Modules/parsermodule.c @@ -1,5 +1,12 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "third_party/python/Include/Python-ast.h" #include "third_party/python/Include/abstract.h" +#include "third_party/python/Include/ast.h" #include "third_party/python/Include/boolobject.h" #include "third_party/python/Include/compile.h" #include "third_party/python/Include/dictobject.h" @@ -18,6 +25,7 @@ #include "third_party/python/Include/token.h" #include "third_party/python/Include/unicodeobject.h" /* clang-format off */ + /* parsermodule.c * * Copyright 1995-1996 by Fred L. Drake, Jr. and Virginia Polytechnic @@ -50,9 +58,6 @@ * Lib/symbol.h and Include/token.h. */ -#undef Yield -#include "third_party/python/Include/ast.h" - extern grammar _PyParser_Grammar; /* From graminit.c */ #define NOTE(x) diff --git a/third_party/python/Modules/posixmodule.c b/third_party/python/Modules/posixmodule.c index 64b63b763..687e771cb 100644 --- a/third_party/python/Modules/posixmodule.c +++ b/third_party/python/Modules/posixmodule.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #define PY_SSIZE_T_CLEAN #include "libc/alg/alg.h" #include "libc/assert.h" @@ -59,11 +65,6 @@ of the compiler used. Different compilers define their own feature test macro, e.g. '_MSC_VER'. */ - - -#ifdef __APPLE__ -#endif /* __APPLE__ */ - PyDoc_STRVAR(posix__doc__, "This module provides access to operating system functionality that is\n\ standardized by the C Standard and the POSIX standard (a thinly\n\ diff --git a/third_party/python/Modules/pwdmodule.c b/third_party/python/Modules/pwdmodule.c index 250ad53db..73054a79b 100644 --- a/third_party/python/Modules/pwdmodule.c +++ b/third_party/python/Modules/pwdmodule.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "third_party/musl/passwd.h" #include "third_party/python/Include/bytesobject.h" #include "third_party/python/Include/listobject.h" diff --git a/third_party/python/Modules/pyexpat.c b/third_party/python/Modules/pyexpat.c index e413cae18..1c5cb215a 100644 --- a/third_party/python/Modules/pyexpat.c +++ b/third_party/python/Modules/pyexpat.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/fmt/fmt.h" #include "third_party/python/Include/abstract.h" #include "third_party/python/Include/boolobject.h" diff --git a/third_party/python/Modules/readline.c b/third_party/python/Modules/readline.c index a226761cb..9b5990d67 100644 --- a/third_party/python/Modules/readline.c +++ b/third_party/python/Modules/readline.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ /* clang-format off */ /* This module makes GNU readline available to Python. It has ideas diff --git a/third_party/python/Modules/resource.c b/third_party/python/Modules/resource.c index b5980e2ea..574673cce 100644 --- a/third_party/python/Modules/resource.c +++ b/third_party/python/Modules/resource.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/calls/calls.h" #include "libc/calls/struct/rlimit.h" #include "libc/calls/struct/rusage.h" diff --git a/third_party/python/Modules/rotatingtree.c b/third_party/python/Modules/rotatingtree.c index 0f6874dc6..d66d5ebdf 100644 --- a/third_party/python/Modules/rotatingtree.c +++ b/third_party/python/Modules/rotatingtree.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "third_party/python/Modules/rotatingtree.h" /* clang-format off */ diff --git a/third_party/python/Modules/selectmodule.c b/third_party/python/Modules/selectmodule.c index 27a8c29cb..e593763f2 100644 --- a/third_party/python/Modules/selectmodule.c +++ b/third_party/python/Modules/selectmodule.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/calls/calls.h" #include "libc/errno.h" #include "libc/nt/efi.h" diff --git a/third_party/python/Modules/sha1module.c b/third_party/python/Modules/sha1module.c index 5253099d9..8d81c1c03 100644 --- a/third_party/python/Modules/sha1module.c +++ b/third_party/python/Modules/sha1module.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/assert.h" #include "third_party/python/Include/abstract.h" #include "third_party/python/Include/bytesobject.h" diff --git a/third_party/python/Modules/sha256module.c b/third_party/python/Modules/sha256module.c index 33e57efaa..775860956 100644 --- a/third_party/python/Modules/sha256module.c +++ b/third_party/python/Modules/sha256module.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "third_party/python/Include/abstract.h" #include "third_party/python/Include/bytesobject.h" #include "third_party/python/Include/descrobject.h" diff --git a/third_party/python/Modules/sha512module.c b/third_party/python/Modules/sha512module.c index b80a16fd9..e1885b445 100644 --- a/third_party/python/Modules/sha512module.c +++ b/third_party/python/Modules/sha512module.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "third_party/python/Include/abstract.h" #include "third_party/python/Include/bytesobject.h" #include "third_party/python/Include/descrobject.h" @@ -10,7 +16,6 @@ #include "third_party/python/Include/structmember.h" #include "third_party/python/Modules/hashlib.h" /* clang-format off */ -/* SHA512 module */ /* This module provides an interface to NIST's SHA-512 and SHA-384 Algorithms */ diff --git a/third_party/python/Modules/signalmodule.c b/third_party/python/Modules/signalmodule.c index 597bae9f4..e195db0f6 100644 --- a/third_party/python/Modules/signalmodule.c +++ b/third_party/python/Modules/signalmodule.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/calls/calls.h" #include "libc/calls/struct/itimerval.h" #include "libc/dce.h" diff --git a/third_party/python/Modules/socketmodule.c b/third_party/python/Modules/socketmodule.c index d961e3f36..9b29a54e6 100644 --- a/third_party/python/Modules/socketmodule.c +++ b/third_party/python/Modules/socketmodule.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/calls/calls.h" #include "libc/calls/weirdtypes.h" #include "libc/dce.h" @@ -44,7 +50,6 @@ #include "third_party/python/Modules/socketmodule.h" #include "third_party/python/pyconfig.h" /* clang-format off */ -/* Socket module */ /* diff --git a/third_party/python/Modules/spwdmodule.c b/third_party/python/Modules/spwdmodule.c index b97fef78f..42f64b240 100644 --- a/third_party/python/Modules/spwdmodule.c +++ b/third_party/python/Modules/spwdmodule.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "third_party/python/Include/methodobject.h" #include "third_party/python/Include/modsupport.h" #include "third_party/python/Include/moduleobject.h" diff --git a/third_party/python/Modules/sre_lib.inc b/third_party/python/Modules/sre_lib.inc index c8f1b0e2f..49d13cdb4 100644 --- a/third_party/python/Modules/sre_lib.inc +++ b/third_party/python/Modules/sre_lib.inc @@ -1,4 +1,11 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ /* clang-format off */ + /* * Secret Labs' Regular Expression Engine * diff --git a/third_party/python/Modules/symtablemodule.c b/third_party/python/Modules/symtablemodule.c index 36a1abf98..228f9eca2 100644 --- a/third_party/python/Modules/symtablemodule.c +++ b/third_party/python/Modules/symtablemodule.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "third_party/python/Include/Python-ast.h" #include "third_party/python/Include/code.h" #include "third_party/python/Include/modsupport.h" diff --git a/third_party/python/Modules/syslogmodule.c b/third_party/python/Modules/syslogmodule.c index c12926c5b..f0c9f2c13 100644 --- a/third_party/python/Modules/syslogmodule.c +++ b/third_party/python/Modules/syslogmodule.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/sock/syslog.h" #include "libc/sysv/consts/log.h" #include "third_party/python/Include/ceval.h" diff --git a/third_party/python/Modules/termios.c b/third_party/python/Modules/termios.c index 3c148cd95..db37ec525 100644 --- a/third_party/python/Modules/termios.c +++ b/third_party/python/Modules/termios.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/calls/struct/termios.h" #include "libc/calls/termios.h" #include "libc/calls/weirdtypes.h" diff --git a/third_party/python/Modules/testcapi_long.inc b/third_party/python/Modules/testcapi_long.inc index fa09d8b6c..39187b7e2 100644 --- a/third_party/python/Modules/testcapi_long.inc +++ b/third_party/python/Modules/testcapi_long.inc @@ -1,4 +1,11 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ /* clang-format off */ + /* Poor-man's template. Macros used: TESTNAME name of the test (like test_long_api_inner) TYPENAME the signed type (like long) diff --git a/third_party/python/Modules/timemodule.c b/third_party/python/Modules/timemodule.c index 871b1d26e..b47508d9d 100644 --- a/third_party/python/Modules/timemodule.c +++ b/third_party/python/Modules/timemodule.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/calls/calls.h" #include "libc/calls/struct/rusage.h" #include "libc/calls/struct/timespec.h" diff --git a/third_party/python/Modules/unicodedata.c b/third_party/python/Modules/unicodedata.c index 18478f867..52ebbb5bf 100644 --- a/third_party/python/Modules/unicodedata.c +++ b/third_party/python/Modules/unicodedata.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #define PY_SSIZE_T_CLEAN #include "libc/fmt/fmt.h" #include "third_party/python/Include/floatobject.h" diff --git a/third_party/python/Modules/unicodedata_db.inc b/third_party/python/Modules/unicodedata_db.inc index f33ee6038..1d2bf07d9 100644 --- a/third_party/python/Modules/unicodedata_db.inc +++ b/third_party/python/Modules/unicodedata_db.inc @@ -1,4 +1,11 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ /* clang-format off */ + /* this file was generated by Tools/unicode/makeunicodedata.py 3.2 */ #define UNIDATA_VERSION "9.0.0" diff --git a/third_party/python/Modules/unicodename_db.inc b/third_party/python/Modules/unicodename_db.inc index 09de96e71..a77a05144 100644 --- a/third_party/python/Modules/unicodename_db.inc +++ b/third_party/python/Modules/unicodename_db.inc @@ -1,4 +1,11 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ /* clang-format off */ + /* this file was generated by Tools/unicode/makeunicodedata.py 3.2 */ #define NAME_MAXLEN 256 diff --git a/third_party/python/Modules/xxlimited.c b/third_party/python/Modules/xxlimited.c index aa4f6cc29..90a21acef 100644 --- a/third_party/python/Modules/xxlimited.c +++ b/third_party/python/Modules/xxlimited.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "third_party/python/Include/dictobject.h" #include "third_party/python/Include/longobject.h" #include "third_party/python/Include/methodobject.h" diff --git a/third_party/python/Modules/xxmodule.c b/third_party/python/Modules/xxmodule.c index bfe0d7008..e3a975221 100644 --- a/third_party/python/Modules/xxmodule.c +++ b/third_party/python/Modules/xxmodule.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "third_party/python/Include/dictobject.h" #include "third_party/python/Include/listobject.h" #include "third_party/python/Include/longobject.h" diff --git a/third_party/python/Modules/xxsubtype.c b/third_party/python/Modules/xxsubtype.c index 8c9f8728d..80d36f7cf 100644 --- a/third_party/python/Modules/xxsubtype.c +++ b/third_party/python/Modules/xxsubtype.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/calls/weirdtypes.h" #include "libc/time/time.h" #include "third_party/python/Include/descrobject.h" diff --git a/third_party/python/Modules/zipimport.c b/third_party/python/Modules/zipimport.c index 4b1a82410..b819cf829 100644 --- a/third_party/python/Modules/zipimport.c +++ b/third_party/python/Modules/zipimport.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/bits/bits.h" #include "libc/calls/calls.h" #include "libc/calls/weirdtypes.h" diff --git a/third_party/python/Modules/zlibmodule.c b/third_party/python/Modules/zlibmodule.c index b5735bef9..d2f093cfc 100644 --- a/third_party/python/Modules/zlibmodule.c +++ b/third_party/python/Modules/zlibmodule.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #define PY_SSIZE_T_CLEAN #include "third_party/python/Include/abstract.h" #include "third_party/python/Include/bytesobject.h" diff --git a/third_party/python/Objects/abstract.c b/third_party/python/Objects/abstract.c index 86f2c64bb..55274d117 100644 --- a/third_party/python/Objects/abstract.c +++ b/third_party/python/Objects/abstract.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/assert.h" #include "third_party/python/Include/abstract.h" #include "third_party/python/Include/bytearrayobject.h" diff --git a/third_party/python/Objects/accu.c b/third_party/python/Objects/accu.c index 226ebb099..e8222eaa1 100644 --- a/third_party/python/Objects/accu.c +++ b/third_party/python/Objects/accu.c @@ -1,11 +1,15 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/assert.h" #include "third_party/python/Include/accu.h" #include "third_party/python/Include/listobject.h" #include "third_party/python/Include/unicodeobject.h" /* clang-format off */ -/* Accumulator struct implementation */ - static PyObject * join_list_unicode(PyObject *lst) { diff --git a/third_party/python/Objects/boolobject.c b/third_party/python/Objects/boolobject.c index 1e2574c73..fe11af9f3 100644 --- a/third_party/python/Objects/boolobject.c +++ b/third_party/python/Objects/boolobject.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "third_party/python/Include/boolobject.h" #include "third_party/python/Include/longintrepr.h" #include "third_party/python/Include/modsupport.h" diff --git a/third_party/python/Objects/bytearrayobject.c b/third_party/python/Objects/bytearrayobject.c index c9b27b4b9..76eb2b56e 100644 --- a/third_party/python/Objects/bytearrayobject.c +++ b/third_party/python/Objects/bytearrayobject.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #define PY_SSIZE_T_CLEAN #include "third_party/python/Include/abstract.h" #include "third_party/python/Include/boolobject.h" @@ -20,8 +26,6 @@ #include "third_party/python/Include/warnings.h" /* clang-format off */ -/* PyByteArray (bytearray) implementation */ - /*[clinic input] class bytearray "PyByteArrayObject *" "&PyByteArray_Type" [clinic start generated code]*/ diff --git a/third_party/python/Objects/bytes_methods.c b/third_party/python/Objects/bytes_methods.c index b7a42f39e..a98da7234 100644 --- a/third_party/python/Objects/bytes_methods.c +++ b/third_party/python/Objects/bytes_methods.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #define PY_SSIZE_T_CLEAN #include "third_party/python/Include/abstract.h" #include "third_party/python/Include/boolobject.h" diff --git a/third_party/python/Objects/bytesobject.c b/third_party/python/Objects/bytesobject.c index 5f3ac0ff1..af790f93c 100644 --- a/third_party/python/Objects/bytesobject.c +++ b/third_party/python/Objects/bytesobject.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #define PY_SSIZE_T_CLEAN #include "libc/assert.h" #include "libc/fmt/fmt.h" @@ -24,8 +30,6 @@ #include "third_party/python/Include/warnings.h" /* clang-format off */ -/* bytes object implementation */ - /*[clinic input] class bytes "PyBytesObject *" "&PyBytes_Type" [clinic start generated code]*/ diff --git a/third_party/python/Objects/capsule.c b/third_party/python/Objects/capsule.c index 5feb4a26d..13d7c3e46 100644 --- a/third_party/python/Objects/capsule.c +++ b/third_party/python/Objects/capsule.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "third_party/python/Include/import.h" #include "third_party/python/Include/object.h" #include "third_party/python/Include/objimpl.h" @@ -5,6 +11,7 @@ #include "third_party/python/Include/pyerrors.h" #include "third_party/python/Include/pymacro.h" /* clang-format off */ + /* Wrap void * pointers to be passed between C modules */ /* Internal structure of PyCapsule */ diff --git a/third_party/python/Objects/cellobject.c b/third_party/python/Objects/cellobject.c index d2166c55e..30116abae 100644 --- a/third_party/python/Objects/cellobject.c +++ b/third_party/python/Objects/cellobject.c @@ -1,10 +1,15 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "third_party/python/Include/boolobject.h" #include "third_party/python/Include/cellobject.h" #include "third_party/python/Include/descrobject.h" #include "third_party/python/Include/object.h" #include "third_party/python/Include/objimpl.h" /* clang-format off */ -/* Cell object implementation */ PyObject * PyCell_New(PyObject *obj) diff --git a/third_party/python/Objects/classobject.c b/third_party/python/Objects/classobject.c index 28dfab2c8..2995d2105 100644 --- a/third_party/python/Objects/classobject.c +++ b/third_party/python/Objects/classobject.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "third_party/python/Include/abstract.h" #include "third_party/python/Include/boolobject.h" #include "third_party/python/Include/ceval.h" diff --git a/third_party/python/Objects/clinic/bytearrayobject.inc b/third_party/python/Objects/clinic/bytearrayobject.inc index 2fe1d24e7..24b06102e 100644 --- a/third_party/python/Objects/clinic/bytearrayobject.inc +++ b/third_party/python/Objects/clinic/bytearrayobject.inc @@ -1,4 +1,11 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ /* clang-format off */ + /*[clinic input] preserve [clinic start generated code]*/ diff --git a/third_party/python/Objects/clinic/bytesobject.inc b/third_party/python/Objects/clinic/bytesobject.inc index 2cca9dac8..11e6ef532 100644 --- a/third_party/python/Objects/clinic/bytesobject.inc +++ b/third_party/python/Objects/clinic/bytesobject.inc @@ -1,4 +1,11 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ /* clang-format off */ + /*[clinic input] preserve [clinic start generated code]*/ diff --git a/third_party/python/Objects/clinic/dictobject.inc b/third_party/python/Objects/clinic/dictobject.inc index 8bfb357fa..5dfd38329 100644 --- a/third_party/python/Objects/clinic/dictobject.inc +++ b/third_party/python/Objects/clinic/dictobject.inc @@ -1,4 +1,11 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ /* clang-format off */ + /*[clinic input] preserve [clinic start generated code]*/ diff --git a/third_party/python/Objects/clinic/unicodeobject.inc b/third_party/python/Objects/clinic/unicodeobject.inc index 58c854b17..7d663b844 100644 --- a/third_party/python/Objects/clinic/unicodeobject.inc +++ b/third_party/python/Objects/clinic/unicodeobject.inc @@ -1,4 +1,11 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ /* clang-format off */ + /*[clinic input] preserve [clinic start generated code]*/ diff --git a/third_party/python/Objects/codeobject.c b/third_party/python/Objects/codeobject.c index a8f3759c4..160a8c9db 100644 --- a/third_party/python/Objects/codeobject.c +++ b/third_party/python/Objects/codeobject.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/math.h" #include "third_party/python/Include/abstract.h" #include "third_party/python/Include/boolobject.h" diff --git a/third_party/python/Objects/complexobject.c b/third_party/python/Objects/complexobject.c index 86b60e353..8077b0847 100644 --- a/third_party/python/Objects/complexobject.c +++ b/third_party/python/Objects/complexobject.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/errno.h" #include "libc/math.h" #include "third_party/python/Include/abstract.h" @@ -16,7 +22,6 @@ #include "third_party/python/Include/structmember.h" /* clang-format off */ -/* Complex object implementation */ /* Borrows heavily from floatobject.c */ /* Submitted by Jim Hugunin */ diff --git a/third_party/python/Objects/descrobject.c b/third_party/python/Objects/descrobject.c index 10ce58f30..be1be6949 100644 --- a/third_party/python/Objects/descrobject.c +++ b/third_party/python/Objects/descrobject.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "third_party/python/Include/abstract.h" #include "third_party/python/Include/boolobject.h" #include "third_party/python/Include/ceval.h" diff --git a/third_party/python/Objects/dictobject.c b/third_party/python/Objects/dictobject.c index 4fddcf418..bb74293a4 100644 --- a/third_party/python/Objects/dictobject.c +++ b/third_party/python/Objects/dictobject.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "third_party/python/Include/abstract.h" #include "third_party/python/Include/boolobject.h" #include "third_party/python/Include/longobject.h" diff --git a/third_party/python/Objects/enumobject.c b/third_party/python/Objects/enumobject.c index e15038a04..f7c4711b4 100644 --- a/third_party/python/Objects/enumobject.c +++ b/third_party/python/Objects/enumobject.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/assert.h" #include "third_party/python/Include/abstract.h" #include "third_party/python/Include/enumobject.h" @@ -10,8 +16,6 @@ #include "third_party/python/Include/pymacro.h" /* clang-format off */ -/* enumerate object */ - typedef struct { PyObject_HEAD Py_ssize_t en_index; /* current index of enumeration */ diff --git a/third_party/python/Objects/exceptions.c b/third_party/python/Objects/exceptions.c index 467dc0dce..e77718199 100644 --- a/third_party/python/Objects/exceptions.c +++ b/third_party/python/Objects/exceptions.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #define PY_SSIZE_T_CLEAN #include "libc/errno.h" #include "third_party/python/Include/abstract.h" @@ -14,6 +20,7 @@ #include "third_party/python/Include/traceback.h" #include "third_party/python/Include/tupleobject.h" /* clang-format off */ + /* * New exceptions.c written in Iceland by Richard Jones and Georg Brandl. * diff --git a/third_party/python/Objects/fileobject.c b/third_party/python/Objects/fileobject.c index ebb053082..181817fb0 100644 --- a/third_party/python/Objects/fileobject.c +++ b/third_party/python/Objects/fileobject.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #define PY_SSIZE_T_CLEAN #include "libc/calls/calls.h" #include "libc/errno.h" diff --git a/third_party/python/Objects/floatobject.c b/third_party/python/Objects/floatobject.c index 8d6763005..89f3775d2 100644 --- a/third_party/python/Objects/floatobject.c +++ b/third_party/python/Objects/floatobject.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/errno.h" #include "libc/fmt/conv.h" #include "libc/math.h" @@ -25,8 +31,6 @@ #include "third_party/python/Include/warnings.h" /* clang-format off */ -/* Float object implementation */ - /* XXX There should be overflow checks here, but it's hard to check for any kind of float exception without losing portability. */ diff --git a/third_party/python/Objects/frameobject.c b/third_party/python/Objects/frameobject.c index a757fb48c..1cca50894 100644 --- a/third_party/python/Objects/frameobject.c +++ b/third_party/python/Objects/frameobject.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "third_party/python/Include/abstract.h" #include "third_party/python/Include/cellobject.h" #include "third_party/python/Include/code.h" @@ -14,8 +20,6 @@ #include "third_party/python/Include/tupleobject.h" /* clang-format off */ -/* Frame object implementation */ - #define OFF(x) offsetof(PyFrameObject, x) static PyMemberDef frame_memberlist[] = { diff --git a/third_party/python/Objects/funcobject.c b/third_party/python/Objects/funcobject.c index c11a6829e..4694f065f 100644 --- a/third_party/python/Objects/funcobject.c +++ b/third_party/python/Objects/funcobject.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "third_party/python/Include/boolobject.h" #include "third_party/python/Include/cellobject.h" #include "third_party/python/Include/classobject.h" @@ -14,8 +20,6 @@ #include "third_party/python/Include/unicodeobject.h" /* clang-format off */ -/* Function object implementation */ - PyObject * PyFunction_NewWithQualName(PyObject *code, PyObject *globals, PyObject *qualname) { diff --git a/third_party/python/Objects/genobject.c b/third_party/python/Objects/genobject.c index ccb17025f..1d5ff086d 100644 --- a/third_party/python/Objects/genobject.c +++ b/third_party/python/Objects/genobject.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "third_party/python/Include/abstract.h" #include "third_party/python/Include/bytesobject.h" #include "third_party/python/Include/ceval.h" @@ -13,7 +19,6 @@ #include "third_party/python/Include/traceback.h" #include "third_party/python/Include/warnings.h" /* clang-format off */ -/* Generator object implementation */ static PyObject *gen_close(PyGenObject *, PyObject *); static PyObject *async_gen_asend_new(PyAsyncGenObject *, PyObject *); diff --git a/third_party/python/Objects/iterobject.c b/third_party/python/Objects/iterobject.c index a4820ddcf..2149f9c2c 100644 --- a/third_party/python/Objects/iterobject.c +++ b/third_party/python/Objects/iterobject.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "third_party/python/Include/abstract.h" #include "third_party/python/Include/iterobject.h" #include "third_party/python/Include/longobject.h" @@ -7,7 +13,6 @@ #include "third_party/python/Include/pyerrors.h" #include "third_party/python/Include/pymacro.h" /* clang-format off */ -/* Iterator objects */ typedef struct { PyObject_HEAD diff --git a/third_party/python/Objects/listobject.c b/third_party/python/Objects/listobject.c index 3eaaad27e..fa01c9260 100644 --- a/third_party/python/Objects/listobject.c +++ b/third_party/python/Objects/listobject.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/assert.h" #include "third_party/python/Include/abstract.h" #include "third_party/python/Include/accu.h" @@ -15,8 +21,6 @@ #include "third_party/python/Include/sliceobject.h" /* clang-format off */ -/* List object implementation */ - /* Ensure ob_item has room for at least newsize elements, and set * ob_size to newsize. If newsize > ob_size on entry, the content * of the new slots at exit is undefined heap trash; it's the caller's diff --git a/third_party/python/Objects/longobject.c b/third_party/python/Objects/longobject.c index ff1195cc4..8371f839b 100644 --- a/third_party/python/Objects/longobject.c +++ b/third_party/python/Objects/longobject.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/assert.h" #include "libc/fmt/conv.h" #include "libc/limits.h" diff --git a/third_party/python/Objects/memoryobject.c b/third_party/python/Objects/memoryobject.c index 4c8081dc6..7b04149cf 100644 --- a/third_party/python/Objects/memoryobject.c +++ b/third_party/python/Objects/memoryobject.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "third_party/python/Include/abstract.h" #include "third_party/python/Include/boolobject.h" #include "third_party/python/Include/bytesobject.h" @@ -17,8 +23,6 @@ #include "third_party/python/Include/sliceobject.h" /* clang-format off */ -/* Memoryview object implementation */ - /****************************************************************************/ /* ManagedBuffer Object */ /****************************************************************************/ diff --git a/third_party/python/Objects/methodobject.c b/third_party/python/Objects/methodobject.c index 805c1bba8..e048a58a1 100644 --- a/third_party/python/Objects/methodobject.c +++ b/third_party/python/Objects/methodobject.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "third_party/python/Include/abstract.h" #include "third_party/python/Include/boolobject.h" #include "third_party/python/Include/ceval.h" @@ -11,8 +17,6 @@ #include "third_party/python/Include/structmember.h" /* clang-format off */ -/* Method object implementation */ - /* Free list for method objects to safe malloc/free overhead * The m_self element is used to chain the objects. */ diff --git a/third_party/python/Objects/moduleobject.c b/third_party/python/Objects/moduleobject.c index be61f5ce8..7ee3737c2 100644 --- a/third_party/python/Objects/moduleobject.c +++ b/third_party/python/Objects/moduleobject.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "third_party/python/Include/abstract.h" #include "third_party/python/Include/descrobject.h" #include "third_party/python/Include/dictobject.h" diff --git a/third_party/python/Objects/namespaceobject.c b/third_party/python/Objects/namespaceobject.c index 04ab8f8c0..ce94dd166 100644 --- a/third_party/python/Objects/namespaceobject.c +++ b/third_party/python/Objects/namespaceobject.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/assert.h" #include "third_party/python/Include/abstract.h" #include "third_party/python/Include/descrobject.h" diff --git a/third_party/python/Objects/object.c b/third_party/python/Objects/object.c index 3a6afe500..78943fa81 100644 --- a/third_party/python/Objects/object.c +++ b/third_party/python/Objects/object.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "third_party/python/Include/abstract.h" #include "third_party/python/Include/boolobject.h" #include "third_party/python/Include/bytearrayobject.h" diff --git a/third_party/python/Objects/obmalloc.c b/third_party/python/Objects/obmalloc.c index 8a3e5b71a..19acfabf3 100644 --- a/third_party/python/Objects/obmalloc.c +++ b/third_party/python/Objects/obmalloc.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/assert.h" #include "libc/calls/calls.h" #include "libc/fmt/fmt.h" diff --git a/third_party/python/Objects/odictobject.c b/third_party/python/Objects/odictobject.c index 452bdb5fb..d0480e6c5 100644 --- a/third_party/python/Objects/odictobject.c +++ b/third_party/python/Objects/odictobject.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/assert.h" #include "third_party/python/Include/abstract.h" #include "third_party/python/Include/boolobject.h" diff --git a/third_party/python/Objects/rangeobject.c b/third_party/python/Objects/rangeobject.c index 2517767a6..d5e357863 100644 --- a/third_party/python/Objects/rangeobject.c +++ b/third_party/python/Objects/rangeobject.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "third_party/python/Include/abstract.h" #include "third_party/python/Include/boolobject.h" #include "third_party/python/Include/longobject.h" diff --git a/third_party/python/Objects/setobject.c b/third_party/python/Objects/setobject.c index 149723713..2fc47e39d 100644 --- a/third_party/python/Objects/setobject.c +++ b/third_party/python/Objects/setobject.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/assert.h" #include "third_party/python/Include/abstract.h" #include "third_party/python/Include/boolobject.h" diff --git a/third_party/python/Objects/sliceobject.c b/third_party/python/Objects/sliceobject.c index ea126d04b..2801dfb26 100644 --- a/third_party/python/Objects/sliceobject.c +++ b/third_party/python/Objects/sliceobject.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "third_party/python/Include/abstract.h" #include "third_party/python/Include/boolobject.h" #include "third_party/python/Include/ceval.h" diff --git a/third_party/python/Objects/stringlib/asciilib.inc b/third_party/python/Objects/stringlib/asciilib.inc index 63cdc74f6..5757942fe 100644 --- a/third_party/python/Objects/stringlib/asciilib.inc +++ b/third_party/python/Objects/stringlib/asciilib.inc @@ -1,5 +1,11 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ /* clang-format off */ -/* clang-format off */ + /* this is sort of a hack. there's at least one place (formatting floats) where some stringlib code takes a different path if it's compiled as unicode. */ diff --git a/third_party/python/Objects/stringlib/codecs.inc b/third_party/python/Objects/stringlib/codecs.inc index 0e48428cd..06f08ee4c 100644 --- a/third_party/python/Objects/stringlib/codecs.inc +++ b/third_party/python/Objects/stringlib/codecs.inc @@ -1,4 +1,11 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ /* clang-format off */ + /* stringlib: codec implementations */ #if !STRINGLIB_IS_UNICODE diff --git a/third_party/python/Objects/stringlib/count.inc b/third_party/python/Objects/stringlib/count.inc index b099cedaf..be86f75b2 100644 --- a/third_party/python/Objects/stringlib/count.inc +++ b/third_party/python/Objects/stringlib/count.inc @@ -1,4 +1,11 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ /* clang-format off */ + /* stringlib: count implementation */ #ifndef STRINGLIB_FASTSEARCH_H diff --git a/third_party/python/Objects/stringlib/ctype.inc b/third_party/python/Objects/stringlib/ctype.inc index ce64596de..09add4ada 100644 --- a/third_party/python/Objects/stringlib/ctype.inc +++ b/third_party/python/Objects/stringlib/ctype.inc @@ -1,4 +1,11 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ /* clang-format off */ + #if STRINGLIB_IS_UNICODE # error "ctype.h only compatible with byte-wise strings" #endif diff --git a/third_party/python/Objects/stringlib/eq.inc b/third_party/python/Objects/stringlib/eq.inc index e78806ffc..8740d4946 100644 --- a/third_party/python/Objects/stringlib/eq.inc +++ b/third_party/python/Objects/stringlib/eq.inc @@ -1,4 +1,11 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ /* clang-format off */ + /* Fast unicode equal function optimized for dictobject.c and setobject.c */ /* Return 1 if two unicode objects are equal, 0 if not. diff --git a/third_party/python/Objects/stringlib/fastsearch.inc b/third_party/python/Objects/stringlib/fastsearch.inc index 7087acd8b..5438823d7 100644 --- a/third_party/python/Objects/stringlib/fastsearch.inc +++ b/third_party/python/Objects/stringlib/fastsearch.inc @@ -1,4 +1,11 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ /* clang-format off */ + /* stringlib: fastsearch implementation */ #define STRINGLIB_FASTSEARCH_H diff --git a/third_party/python/Objects/stringlib/find.inc b/third_party/python/Objects/stringlib/find.inc index 3ddee1636..13cc9f569 100644 --- a/third_party/python/Objects/stringlib/find.inc +++ b/third_party/python/Objects/stringlib/find.inc @@ -1,6 +1,13 @@ -/* clang-format off */ -/* stringlib: find/index implementation */ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "third_party/python/Include/modsupport.h" +/* clang-format off */ + +/* stringlib: find/index implementation */ #ifndef STRINGLIB_FASTSEARCH_H #error must include fastsearch.inc before including this module diff --git a/third_party/python/Objects/stringlib/find_max_char.inc b/third_party/python/Objects/stringlib/find_max_char.inc index 944485985..55b70ae30 100644 --- a/third_party/python/Objects/stringlib/find_max_char.inc +++ b/third_party/python/Objects/stringlib/find_max_char.inc @@ -1,4 +1,11 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ /* clang-format off */ + /* Finding the optimal width of unicode characters in a buffer */ #if !STRINGLIB_IS_UNICODE diff --git a/third_party/python/Objects/stringlib/join.inc b/third_party/python/Objects/stringlib/join.inc index 4b0edc300..dc51d46ca 100644 --- a/third_party/python/Objects/stringlib/join.inc +++ b/third_party/python/Objects/stringlib/join.inc @@ -1,4 +1,11 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ /* clang-format off */ + /* stringlib: bytes joining implementation */ #if STRINGLIB_IS_UNICODE diff --git a/third_party/python/Objects/stringlib/localeutil.inc b/third_party/python/Objects/stringlib/localeutil.inc index a5162d061..10e091830 100644 --- a/third_party/python/Objects/stringlib/localeutil.inc +++ b/third_party/python/Objects/stringlib/localeutil.inc @@ -1,4 +1,11 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ /* clang-format off */ + /* _PyUnicode_InsertThousandsGrouping() helper functions */ typedef struct { diff --git a/third_party/python/Objects/stringlib/partition.inc b/third_party/python/Objects/stringlib/partition.inc index 39795146e..ebfa062f9 100644 --- a/third_party/python/Objects/stringlib/partition.inc +++ b/third_party/python/Objects/stringlib/partition.inc @@ -1,4 +1,11 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ /* clang-format off */ + /* stringlib: partition implementation */ #ifndef STRINGLIB_FASTSEARCH_H diff --git a/third_party/python/Objects/stringlib/replace.inc b/third_party/python/Objects/stringlib/replace.inc index 6afcee6f5..e4890e6ee 100644 --- a/third_party/python/Objects/stringlib/replace.inc +++ b/third_party/python/Objects/stringlib/replace.inc @@ -1,4 +1,11 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ /* clang-format off */ + /* stringlib: replace implementation */ #ifndef STRINGLIB_FASTSEARCH_H diff --git a/third_party/python/Objects/stringlib/split.inc b/third_party/python/Objects/stringlib/split.inc index a6ac6ad72..44a8f5d73 100644 --- a/third_party/python/Objects/stringlib/split.inc +++ b/third_party/python/Objects/stringlib/split.inc @@ -1,4 +1,11 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ /* clang-format off */ + /* stringlib: split implementation */ #ifndef STRINGLIB_FASTSEARCH_H diff --git a/third_party/python/Objects/stringlib/stringdefs.inc b/third_party/python/Objects/stringlib/stringdefs.inc index 2cc9e4878..685b5a9f8 100644 --- a/third_party/python/Objects/stringlib/stringdefs.inc +++ b/third_party/python/Objects/stringlib/stringdefs.inc @@ -1,4 +1,11 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ /* clang-format off */ + #ifndef STRINGLIB_STRINGDEFS_H #define STRINGLIB_STRINGDEFS_H diff --git a/third_party/python/Objects/stringlib/transmogrify.inc b/third_party/python/Objects/stringlib/transmogrify.inc index abbb843c1..f0d2b687d 100644 --- a/third_party/python/Objects/stringlib/transmogrify.inc +++ b/third_party/python/Objects/stringlib/transmogrify.inc @@ -1,4 +1,11 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ /* clang-format off */ + #if STRINGLIB_IS_UNICODE # error "transmogrify.h only compatible with byte-wise strings" #endif diff --git a/third_party/python/Objects/stringlib/ucs1lib.inc b/third_party/python/Objects/stringlib/ucs1lib.inc index 3aa300edf..9c311f307 100644 --- a/third_party/python/Objects/stringlib/ucs1lib.inc +++ b/third_party/python/Objects/stringlib/ucs1lib.inc @@ -1,4 +1,11 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ /* clang-format off */ + /* this is sort of a hack. there's at least one place (formatting floats) where some stringlib code takes a different path if it's compiled as unicode. */ diff --git a/third_party/python/Objects/stringlib/ucs2lib.inc b/third_party/python/Objects/stringlib/ucs2lib.inc index d2e8c6e3b..d3ca7a479 100644 --- a/third_party/python/Objects/stringlib/ucs2lib.inc +++ b/third_party/python/Objects/stringlib/ucs2lib.inc @@ -1,4 +1,11 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ /* clang-format off */ + /* this is sort of a hack. there's at least one place (formatting floats) where some stringlib code takes a different path if it's compiled as unicode. */ diff --git a/third_party/python/Objects/stringlib/ucs4lib.inc b/third_party/python/Objects/stringlib/ucs4lib.inc index cb1a80770..28423cac0 100644 --- a/third_party/python/Objects/stringlib/ucs4lib.inc +++ b/third_party/python/Objects/stringlib/ucs4lib.inc @@ -1,4 +1,11 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ /* clang-format off */ + /* this is sort of a hack. there's at least one place (formatting floats) where some stringlib code takes a different path if it's compiled as unicode. */ diff --git a/third_party/python/Objects/stringlib/undef.inc b/third_party/python/Objects/stringlib/undef.inc index 1d39cfadf..8de0e0a24 100644 --- a/third_party/python/Objects/stringlib/undef.inc +++ b/third_party/python/Objects/stringlib/undef.inc @@ -1,4 +1,11 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ /* clang-format off */ + #undef FASTSEARCH #undef STRINGLIB #undef STRINGLIB_SIZEOF_CHAR diff --git a/third_party/python/Objects/stringlib/unicode_format.inc b/third_party/python/Objects/stringlib/unicode_format.inc index 092162d70..f187cd6eb 100644 --- a/third_party/python/Objects/stringlib/unicode_format.inc +++ b/third_party/python/Objects/stringlib/unicode_format.inc @@ -1,4 +1,11 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ /* clang-format off */ + /* unicode_format.h -- implementation of str.format(). */ diff --git a/third_party/python/Objects/stringlib/unicodedefs.inc b/third_party/python/Objects/stringlib/unicodedefs.inc index ebde38fff..308b68d6f 100644 --- a/third_party/python/Objects/stringlib/unicodedefs.inc +++ b/third_party/python/Objects/stringlib/unicodedefs.inc @@ -1,32 +1,31 @@ -/* clang-format off */ #ifndef STRINGLIB_UNICODEDEFS_H #define STRINGLIB_UNICODEDEFS_H /* this is sort of a hack. there's at least one place (formatting floats) where some stringlib code takes a different path if it's compiled as unicode. */ -#define STRINGLIB_IS_UNICODE 1 +#define STRINGLIB_IS_UNICODE 1 -#define FASTSEARCH fastsearch -#define STRINGLIB(F) stringlib_##F -#define STRINGLIB_OBJECT PyUnicodeObject -#define STRINGLIB_SIZEOF_CHAR Py_UNICODE_SIZE -#define STRINGLIB_CHAR Py_UNICODE -#define STRINGLIB_TYPE_NAME "unicode" -#define STRINGLIB_PARSE_CODE "U" -#define STRINGLIB_EMPTY unicode_empty -#define STRINGLIB_ISSPACE Py_UNICODE_ISSPACE -#define STRINGLIB_ISLINEBREAK BLOOM_LINEBREAK -#define STRINGLIB_ISDECIMAL Py_UNICODE_ISDECIMAL -#define STRINGLIB_TODECIMAL Py_UNICODE_TODECIMAL -#define STRINGLIB_STR PyUnicode_AS_UNICODE -#define STRINGLIB_LEN PyUnicode_GET_SIZE -#define STRINGLIB_NEW PyUnicode_FromUnicode -#define STRINGLIB_CHECK PyUnicode_Check -#define STRINGLIB_CHECK_EXACT PyUnicode_CheckExact +#define FASTSEARCH fastsearch +#define STRINGLIB(F) stringlib_##F +#define STRINGLIB_OBJECT PyUnicodeObject +#define STRINGLIB_SIZEOF_CHAR Py_UNICODE_SIZE +#define STRINGLIB_CHAR Py_UNICODE +#define STRINGLIB_TYPE_NAME "unicode" +#define STRINGLIB_PARSE_CODE "U" +#define STRINGLIB_EMPTY unicode_empty +#define STRINGLIB_ISSPACE Py_UNICODE_ISSPACE +#define STRINGLIB_ISLINEBREAK BLOOM_LINEBREAK +#define STRINGLIB_ISDECIMAL Py_UNICODE_ISDECIMAL +#define STRINGLIB_TODECIMAL Py_UNICODE_TODECIMAL +#define STRINGLIB_STR PyUnicode_AS_UNICODE +#define STRINGLIB_LEN PyUnicode_GET_SIZE +#define STRINGLIB_NEW PyUnicode_FromUnicode +#define STRINGLIB_CHECK PyUnicode_Check +#define STRINGLIB_CHECK_EXACT PyUnicode_CheckExact -#define STRINGLIB_TOSTR PyObject_Str -#define STRINGLIB_TOASCII PyObject_ASCII +#define STRINGLIB_TOSTR PyObject_Str +#define STRINGLIB_TOASCII PyObject_ASCII #define STRINGLIB_WANT_CONTAINS_OBJ 1 diff --git a/third_party/python/Objects/structseq.c b/third_party/python/Objects/structseq.c index 904214300..eb69f2454 100644 --- a/third_party/python/Objects/structseq.c +++ b/third_party/python/Objects/structseq.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "third_party/python/Include/abstract.h" #include "third_party/python/Include/dictobject.h" #include "third_party/python/Include/longobject.h" diff --git a/third_party/python/Objects/tupleobject.c b/third_party/python/Objects/tupleobject.c index f9006ca67..9961da13f 100644 --- a/third_party/python/Objects/tupleobject.c +++ b/third_party/python/Objects/tupleobject.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "third_party/python/Include/abstract.h" #include "third_party/python/Include/accu.h" #include "third_party/python/Include/boolobject.h" diff --git a/third_party/python/Objects/typeobject.c b/third_party/python/Objects/typeobject.c index 36e19c135..dfb45208d 100644 --- a/third_party/python/Objects/typeobject.c +++ b/third_party/python/Objects/typeobject.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/assert.h" #include "libc/fmt/fmt.h" #include "third_party/python/Include/abstract.h" diff --git a/third_party/python/Objects/unicodectype.c b/third_party/python/Objects/unicodectype.c index e7de2e615..f9a27ef1c 100644 --- a/third_party/python/Objects/unicodectype.c +++ b/third_party/python/Objects/unicodectype.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "third_party/python/Include/unicodeobject.h" /* clang-format off */ diff --git a/third_party/python/Objects/unicodeobject.c b/third_party/python/Objects/unicodeobject.c index fd2731a11..c018b7a3f 100644 --- a/third_party/python/Objects/unicodeobject.c +++ b/third_party/python/Objects/unicodeobject.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #define PY_SSIZE_T_CLEAN #include "libc/assert.h" #include "libc/errno.h" diff --git a/third_party/python/Objects/weakrefobject.c b/third_party/python/Objects/weakrefobject.c index 8b7ea473f..ce51d7ce1 100644 --- a/third_party/python/Objects/weakrefobject.c +++ b/third_party/python/Objects/weakrefobject.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "third_party/python/Include/abstract.h" #include "third_party/python/Include/boolobject.h" #include "third_party/python/Include/ceval.h" diff --git a/third_party/python/PC/clinic/winreg.inc b/third_party/python/PC/clinic/winreg.inc index c7d5b9e45..3651dc57b 100644 --- a/third_party/python/PC/clinic/winreg.inc +++ b/third_party/python/PC/clinic/winreg.inc @@ -1,3 +1,11 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ +/* clang-format off */ + /*[clinic input] preserve [clinic start generated code]*/ diff --git a/third_party/python/PC/clinic/winsound.inc b/third_party/python/PC/clinic/winsound.inc index 52d25b243..b794f4f08 100644 --- a/third_party/python/PC/clinic/winsound.inc +++ b/third_party/python/PC/clinic/winsound.inc @@ -1,3 +1,11 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ +/* clang-format off */ + /*[clinic input] preserve [clinic start generated code]*/ diff --git a/third_party/python/PC/dl_nt.c b/third_party/python/PC/dl_nt.c index ed55d72f9..207a01241 100644 --- a/third_party/python/PC/dl_nt.c +++ b/third_party/python/PC/dl_nt.c @@ -1,4 +1,11 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ /* clang-format off */ + /* Entry point for the Windows NT DLL. diff --git a/third_party/python/PC/frozen_dllmain.c b/third_party/python/PC/frozen_dllmain.c index b70042c67..07c5d5f2a 100644 --- a/third_party/python/PC/frozen_dllmain.c +++ b/third_party/python/PC/frozen_dllmain.c @@ -1,3 +1,10 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ + /* FreezeDLLMain.cpp This is a DLLMain suitable for frozen applications/DLLs on diff --git a/third_party/python/PC/getpathp.c b/third_party/python/PC/getpathp.c index ca9ba321a..c1c277a00 100644 --- a/third_party/python/PC/getpathp.c +++ b/third_party/python/PC/getpathp.c @@ -1,5 +1,11 @@ -/* clang-format off */ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "windows.h" +/* clang-format off */ /* Return the initial module search path. */ /* Used by DOS, Windows 3.1, Windows 95/98, Windows NT. */ diff --git a/third_party/python/PC/launcher.c b/third_party/python/PC/launcher.c index c34a58b93..ab4264a1c 100644 --- a/third_party/python/PC/launcher.c +++ b/third_party/python/PC/launcher.c @@ -1,4 +1,11 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ /* clang-format off */ + /* * Copyright (C) 2011-2013 Vinay Sajip. * Licensed to PSF under a contributor agreement. diff --git a/third_party/python/PC/winreg.c b/third_party/python/PC/winreg.c index 6cd0b586c..e8e57a6a7 100644 --- a/third_party/python/PC/winreg.c +++ b/third_party/python/PC/winreg.c @@ -1,4 +1,11 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ /* clang-format off */ + /* winreg.c diff --git a/third_party/python/PC/winsound.c b/third_party/python/PC/winsound.c index f89dce6ef..fbacbf7b8 100644 --- a/third_party/python/PC/winsound.c +++ b/third_party/python/PC/winsound.c @@ -1,4 +1,11 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ /* clang-format off */ + /* Author: Toby Dickenson * * Copyright (c) 1999 Toby Dickenson diff --git a/third_party/python/Parser/acceler.c b/third_party/python/Parser/acceler.c index 3b0c943e3..2a83c234f 100644 --- a/third_party/python/Parser/acceler.c +++ b/third_party/python/Parser/acceler.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "third_party/python/Include/grammar.h" #include "third_party/python/Include/node.h" #include "third_party/python/Include/objimpl.h" @@ -5,7 +11,6 @@ #include "third_party/python/Include/token.h" #include "third_party/python/Parser/parser.h" /* clang-format off */ -/* Parser accelerator module */ /* The parser as originally conceived had disappointing performance. This module does some precomputation that speeds up the selection diff --git a/third_party/python/Parser/bitset.c b/third_party/python/Parser/bitset.c index 242b27d7c..57d65c16c 100644 --- a/third_party/python/Parser/bitset.c +++ b/third_party/python/Parser/bitset.c @@ -1,9 +1,13 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "third_party/python/Include/bitset.h" #include "third_party/python/Include/objimpl.h" /* clang-format off */ -/* Bitset primitives used by the parser generator */ - bitset newbitset(int nbits) { diff --git a/third_party/python/Parser/firstsets.c b/third_party/python/Parser/firstsets.c index af246f85a..477a3f011 100644 --- a/third_party/python/Parser/firstsets.c +++ b/third_party/python/Parser/firstsets.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "third_party/python/Include/bitset.h" #include "third_party/python/Include/grammar.h" #include "third_party/python/Include/objimpl.h" @@ -5,8 +11,6 @@ #include "third_party/python/Include/token.h" /* clang-format off */ -/* Computation of FIRST stets */ - extern int Py_DebugFlag; /* Forward */ diff --git a/third_party/python/Parser/grammar.c b/third_party/python/Parser/grammar.c index 8055c46c0..bfc4acdd6 100644 --- a/third_party/python/Parser/grammar.c +++ b/third_party/python/Parser/grammar.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "third_party/python/Include/grammar.h" #include "third_party/python/Include/objimpl.h" #include "third_party/python/Include/pgenheaders.h" @@ -5,8 +11,6 @@ #include "third_party/python/Include/token.h" /* clang-format off */ -/* Grammar implementation */ - extern int Py_DebugFlag; grammar * diff --git a/third_party/python/Parser/grammar1.c b/third_party/python/Parser/grammar1.c index 6b122d5bc..fc70c578d 100644 --- a/third_party/python/Parser/grammar1.c +++ b/third_party/python/Parser/grammar1.c @@ -1,13 +1,16 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/assert.h" #include "third_party/python/Include/grammar.h" #include "third_party/python/Include/pyerrors.h" #include "third_party/python/Include/token.h" /* clang-format off */ -/* Grammar subroutines needed by parser */ - /* Return the DFA for the given type */ - dfa * PyGrammar_FindDFA(grammar *g, int type) { diff --git a/third_party/python/Parser/listnode.c b/third_party/python/Parser/listnode.c index b4e6484bc..131f5539a 100644 --- a/third_party/python/Parser/listnode.c +++ b/third_party/python/Parser/listnode.c @@ -1,12 +1,15 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/stdio/stdio.h" #include "third_party/python/Include/node.h" #include "third_party/python/Include/pgenheaders.h" #include "third_party/python/Include/token.h" /* clang-format off */ -/* List a node on a file */ - -/* Forward */ static void list1node(FILE *, node *); static void listnode(FILE *, node *); diff --git a/third_party/python/Parser/metagrammar.c b/third_party/python/Parser/metagrammar.c index bddc031ed..76b2a9a99 100644 --- a/third_party/python/Parser/metagrammar.c +++ b/third_party/python/Parser/metagrammar.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "third_party/python/Include/grammar.h" #include "third_party/python/Include/metagrammar.h" #include "third_party/python/Include/pgen.h" diff --git a/third_party/python/Parser/myreadline.c b/third_party/python/Parser/myreadline.c index d3ca968a4..8f53c393d 100644 --- a/third_party/python/Parser/myreadline.c +++ b/third_party/python/Parser/myreadline.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/calls/calls.h" #include "libc/errno.h" #include "libc/limits.h" diff --git a/third_party/python/Parser/node.c b/third_party/python/Parser/node.c index 211628d60..a0cce63bc 100644 --- a/third_party/python/Parser/node.c +++ b/third_party/python/Parser/node.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/assert.h" #include "libc/nexgen32e/bsr.h" #include "third_party/python/Include/errcode.h" @@ -5,8 +11,6 @@ #include "third_party/python/Include/objimpl.h" /* clang-format off */ -/* Parse tree node implementation */ - node * PyNode_New(int type) { diff --git a/third_party/python/Parser/parser.c b/third_party/python/Parser/parser.c index 88d450144..66c5587f7 100644 --- a/third_party/python/Parser/parser.c +++ b/third_party/python/Parser/parser.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/assert.h" #include "third_party/python/Include/errcode.h" #include "third_party/python/Include/grammar.h" @@ -8,9 +14,53 @@ #include "third_party/python/Parser/parser.h" /* clang-format off */ -/* Parser implementation */ -/* For a description, see the comments at end of this file */ -/* XXX To do: error recovery */ +/* + +Description +----------- + +The parser's interface is different than usual: the function addtoken() +must be called for each token in the input. This makes it possible to +turn it into an incremental parsing system later. The parsing system +constructs a parse tree as it goes. + +A parsing rule is represented as a Deterministic Finite-state Automaton +(DFA). A node in a DFA represents a state of the parser; an arc represents +a transition. Transitions are either labeled with terminal symbols or +with non-terminals. When the parser decides to follow an arc labeled +with a non-terminal, it is invoked recursively with the DFA representing +the parsing rule for that as its initial state; when that DFA accepts, +the parser that invoked it continues. The parse tree constructed by the +recursively called parser is inserted as a child in the current parse tree. + +The DFA's can be constructed automatically from a more conventional +language description. An extended LL(1) grammar (ELL(1)) is suitable. +Certain restrictions make the parser's life easier: rules that can produce +the empty string should be outlawed (there are other ways to put loops +or optional parts in the language). To avoid the need to construct +FIRST sets, we can require that all but the last alternative of a rule +(really: arc going out of a DFA's state) must begin with a terminal +symbol. + +As an example, consider this grammar: + +expr: term (OP term)* +term: CONSTANT | '(' expr ')' + +The DFA corresponding to the rule for expr is: + +------->.---term-->.-------> + ^ | + | | + \----OP----/ + +The parse tree generated for the input a+b is: + +(expr: (term: (NAME: a)), (OP: +), (term: (NAME: b))) + +TODO(XXX): error recovery + +*/ #ifdef Py_DEBUG extern int Py_DebugFlag; @@ -19,7 +69,6 @@ extern int Py_DebugFlag; #define D(x) #endif - /* STACK DATA TYPE */ static void s_reset(stack *); @@ -48,7 +97,6 @@ s_push(stack *s, dfa *d, node *parent) } #ifdef Py_DEBUG - static void s_pop(stack *s) { @@ -56,14 +104,10 @@ s_pop(stack *s) Py_FatalError("s_pop: parser stack underflow -- FATAL"); s->s_top++; } - #else /* !Py_DEBUG */ - #define s_pop(s) (s)->s_top++ - #endif - /* PARSER CREATION */ parser_state * @@ -397,49 +441,3 @@ printtree(parser_state *ps) } #endif /* Py_DEBUG */ - -/* - -Description ------------ - -The parser's interface is different than usual: the function addtoken() -must be called for each token in the input. This makes it possible to -turn it into an incremental parsing system later. The parsing system -constructs a parse tree as it goes. - -A parsing rule is represented as a Deterministic Finite-state Automaton -(DFA). A node in a DFA represents a state of the parser; an arc represents -a transition. Transitions are either labeled with terminal symbols or -with non-terminals. When the parser decides to follow an arc labeled -with a non-terminal, it is invoked recursively with the DFA representing -the parsing rule for that as its initial state; when that DFA accepts, -the parser that invoked it continues. The parse tree constructed by the -recursively called parser is inserted as a child in the current parse tree. - -The DFA's can be constructed automatically from a more conventional -language description. An extended LL(1) grammar (ELL(1)) is suitable. -Certain restrictions make the parser's life easier: rules that can produce -the empty string should be outlawed (there are other ways to put loops -or optional parts in the language). To avoid the need to construct -FIRST sets, we can require that all but the last alternative of a rule -(really: arc going out of a DFA's state) must begin with a terminal -symbol. - -As an example, consider this grammar: - -expr: term (OP term)* -term: CONSTANT | '(' expr ')' - -The DFA corresponding to the rule for expr is: - -------->.---term-->.-------> - ^ | - | | - \----OP----/ - -The parse tree generated for the input a+b is: - -(expr: (term: (NAME: a)), (OP: +), (term: (NAME: b))) - -*/ diff --git a/third_party/python/Parser/parsetok.c b/third_party/python/Parser/parsetok.c index a201c1321..089971169 100644 --- a/third_party/python/Parser/parsetok.c +++ b/third_party/python/Parser/parsetok.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "third_party/python/Include/errcode.h" #include "third_party/python/Include/graminit.h" #include "third_party/python/Include/grammar.h" @@ -10,9 +16,6 @@ #include "third_party/python/Parser/tokenizer.h" /* clang-format off */ -/* Parser-tokenizer link implementation */ - -/* Forward */ static node *parsetok(struct tok_state *, grammar *, int, perrdetail *, int *); static int initerr(perrdetail *err_ret, PyObject * filename); diff --git a/third_party/python/Parser/pgen.c b/third_party/python/Parser/pgen.c index c3e06976c..c1ba4f4c2 100644 --- a/third_party/python/Parser/pgen.c +++ b/third_party/python/Parser/pgen.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "third_party/python/Include/grammar.h" #include "third_party/python/Include/metagrammar.h" #include "third_party/python/Include/node.h" @@ -7,8 +13,35 @@ #include "third_party/python/Include/token.h" /* clang-format off */ -/* Parser generator */ -/* For a description, see the comments at end of this file */ +/* + +Description +----------- + +Input is a grammar in extended BNF (using * for repetition, + for +at-least-once repetition, [] for optional parts, | for alternatives and +() for grouping). This has already been parsed and turned into a parse +tree. + +Each rule is considered as a regular expression in its own right. +It is turned into a Non-deterministic Finite Automaton (NFA), which +is then turned into a Deterministic Finite Automaton (DFA), which is then +optimized to reduce the number of states. See [Aho&Ullman 77] chapter 3, +or similar compiler books (this technique is more often used for lexical +analyzers). + +The DFA's are used by the parser as parsing tables in a special way +that's probably unique. Before they are usable, the FIRST sets of all +non-terminals are computed. + +Reference +--------- + +[Aho&Ullman 77] + Aho&Ullman, Principles of Compiler Design, Addison-Wesley 1977 + (first edition) + +*/ extern int Py_DebugFlag; extern int Py_IgnoreEnvironmentFlag; /* needed by Py_GETENV */ @@ -691,33 +724,3 @@ Py_pgen(node *n) { return pgen(n); } - -/* - -Description ------------ - -Input is a grammar in extended BNF (using * for repetition, + for -at-least-once repetition, [] for optional parts, | for alternatives and -() for grouping). This has already been parsed and turned into a parse -tree. - -Each rule is considered as a regular expression in its own right. -It is turned into a Non-deterministic Finite Automaton (NFA), which -is then turned into a Deterministic Finite Automaton (DFA), which is then -optimized to reduce the number of states. See [Aho&Ullman 77] chapter 3, -or similar compiler books (this technique is more often used for lexical -analyzers). - -The DFA's are used by the parser as parsing tables in a special way -that's probably unique. Before they are usable, the FIRST sets of all -non-terminals are computed. - -Reference ---------- - -[Aho&Ullman 77] - Aho&Ullman, Principles of Compiler Design, Addison-Wesley 1977 - (first edition) - -*/ diff --git a/third_party/python/Parser/pgenmain.c b/third_party/python/Parser/pgenmain.c index f13de46d3..e2cf524b8 100644 --- a/third_party/python/Parser/pgenmain.c +++ b/third_party/python/Parser/pgenmain.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #define PGEN #include "libc/log/log.h" #include "third_party/python/Include/grammar.h" @@ -10,8 +16,6 @@ #include "third_party/python/Include/pymem.h" /* clang-format off */ -/* Parser generator main program */ - /* This expects a filename containing the grammar as argv[1] (UNIX) or asks the console for such a file name (THINK C). It writes its output on two files in the current directory: diff --git a/third_party/python/Parser/printgrammar.c b/third_party/python/Parser/printgrammar.c index dfb684e92..b1f97a80f 100644 --- a/third_party/python/Parser/printgrammar.c +++ b/third_party/python/Parser/printgrammar.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #define PGEN #include "third_party/python/Include/grammar.h" #include "third_party/python/Include/pgenheaders.h" diff --git a/third_party/python/Parser/tokenizer.c b/third_party/python/Parser/tokenizer.c index b196277af..8e232522d 100644 --- a/third_party/python/Parser/tokenizer.c +++ b/third_party/python/Parser/tokenizer.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/calls/calls.h" #include "third_party/python/Include/errcode.h" #include "third_party/python/Include/pgenheaders.h" diff --git a/third_party/python/Parser/tokenizer_pgen.c b/third_party/python/Parser/tokenizer_pgen.c index 663788411..03bbe041b 100644 --- a/third_party/python/Parser/tokenizer_pgen.c +++ b/third_party/python/Parser/tokenizer_pgen.c @@ -1,3 +1,2 @@ -/* clang-format off */ #define PGEN #include "third_party/python/Parser/tokenizer.c" diff --git a/third_party/python/Programs/_freeze_importlib.c b/third_party/python/Programs/_freeze_importlib.c index 1069966a1..e62f5ca42 100644 --- a/third_party/python/Programs/_freeze_importlib.c +++ b/third_party/python/Programs/_freeze_importlib.c @@ -1,3 +1,11 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ +/* clang-format off */ + /* This is built as a stand-alone executable by the Makefile, and helps turn Lib/importlib/_bootstrap.py into a frozen module in Python/importlib.h */ diff --git a/third_party/python/Programs/_testembed.c b/third_party/python/Programs/_testembed.c index 9eaa4e183..9a8b628b9 100644 --- a/third_party/python/Programs/_testembed.c +++ b/third_party/python/Programs/_testembed.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/stdio/stdio.h" #include "third_party/python/Include/ceval.h" #include "third_party/python/Include/fileutils.h" diff --git a/third_party/python/Programs/python.c b/third_party/python/Programs/python.c index e5481e84f..d88da5fd7 100644 --- a/third_party/python/Programs/python.c +++ b/third_party/python/Programs/python.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/stdio/stdio.h" #include "libc/unicode/locale.h" #include "third_party/python/Include/fileutils.h" diff --git a/third_party/python/Python/Python-ast.c b/third_party/python/Python/Python-ast.c index bec3305b7..4093909ad 100644 --- a/third_party/python/Python/Python-ast.c +++ b/third_party/python/Python/Python-ast.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "third_party/python/Include/Python-ast.h" #include "third_party/python/Include/abstract.h" #include "third_party/python/Include/boolobject.h" diff --git a/third_party/python/Python/_warnings.c b/third_party/python/Python/_warnings.c index 569f288bb..f5acf4a34 100644 --- a/third_party/python/Python/_warnings.c +++ b/third_party/python/Python/_warnings.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "third_party/python/Include/abstract.h" #include "third_party/python/Include/boolobject.h" #include "third_party/python/Include/dictobject.h" diff --git a/third_party/python/Python/asdl.c b/third_party/python/Python/asdl.c index 6c90bfa71..e5947f50e 100644 --- a/third_party/python/Python/asdl.c +++ b/third_party/python/Python/asdl.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "third_party/python/Include/asdl.h" #include "third_party/python/Include/pyerrors.h" /* clang-format off */ diff --git a/third_party/python/Python/ast.c b/third_party/python/Python/ast.c index 4784c4050..d22815260 100644 --- a/third_party/python/Python/ast.c +++ b/third_party/python/Python/ast.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/assert.h" #include "libc/errno.h" #include "libc/fmt/fmt.h" diff --git a/third_party/python/Python/bltinmodule.c b/third_party/python/Python/bltinmodule.c index c9dfa6945..10dfdfa80 100644 --- a/third_party/python/Python/bltinmodule.c +++ b/third_party/python/Python/bltinmodule.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/calls/calls.h" #include "third_party/python/Include/Python-ast.h" #include "third_party/python/Include/abstract.h" diff --git a/third_party/python/Python/ceval.c b/third_party/python/Python/ceval.c index b7577d544..0273526e5 100644 --- a/third_party/python/Python/ceval.c +++ b/third_party/python/Python/ceval.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #define PY_LOCAL_AGGRESSIVE #include "third_party/python/Include/abstract.h" #include "third_party/python/Include/boolobject.h" diff --git a/third_party/python/Python/ceval_gil.inc b/third_party/python/Python/ceval_gil.inc index fdd69e910..383dc0cb9 100644 --- a/third_party/python/Python/ceval_gil.inc +++ b/third_party/python/Python/ceval_gil.inc @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "third_party/python/Python/condvar.h" /* clang-format off */ diff --git a/third_party/python/Python/clinic/bltinmodule.inc b/third_party/python/Python/clinic/bltinmodule.inc index 37824993e..aaa3318ec 100644 --- a/third_party/python/Python/clinic/bltinmodule.inc +++ b/third_party/python/Python/clinic/bltinmodule.inc @@ -1,4 +1,11 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ /* clang-format off */ + /*[clinic input] preserve [clinic start generated code]*/ diff --git a/third_party/python/Python/clinic/import.inc b/third_party/python/Python/clinic/import.inc index 0b94ee096..2087ab4fb 100644 --- a/third_party/python/Python/clinic/import.inc +++ b/third_party/python/Python/clinic/import.inc @@ -1,4 +1,11 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "third_party/python/Include/pymacro.h" + /*[clinic input] preserve [clinic start generated code]*/ diff --git a/third_party/python/Python/codecs.c b/third_party/python/Python/codecs.c index 25e27879e..370bf5e72 100644 --- a/third_party/python/Python/codecs.c +++ b/third_party/python/Python/codecs.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "third_party/python/Include/abstract.h" #include "third_party/python/Include/bytesobject.h" #include "third_party/python/Include/ceval.h" diff --git a/third_party/python/Python/compile.c b/third_party/python/Python/compile.c index dbafa214a..3cf751b30 100644 --- a/third_party/python/Python/compile.c +++ b/third_party/python/Python/compile.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "third_party/python/Include/Python-ast.h" #include "third_party/python/Include/abstract.h" #include "third_party/python/Include/ast.h" diff --git a/third_party/python/Python/dtoa.c b/third_party/python/Python/dtoa.c index 0ccb0ff14..9a402c9fe 100644 --- a/third_party/python/Python/dtoa.c +++ b/third_party/python/Python/dtoa.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/assert.h" #include "libc/errno.h" #include "libc/math.h" diff --git a/third_party/python/Python/dynamic_annotations.c b/third_party/python/Python/dynamic_annotations.c index 35824fd33..3f39cb553 100644 --- a/third_party/python/Python/dynamic_annotations.c +++ b/third_party/python/Python/dynamic_annotations.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "third_party/python/Include/dynamic_annotations.h" /* clang-format off */ diff --git a/third_party/python/Python/dynload_dl.c b/third_party/python/Python/dynload_dl.c index a42734d73..ca2e5695e 100644 --- a/third_party/python/Python/dynload_dl.c +++ b/third_party/python/Python/dynload_dl.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "third_party/python/Include/pyerrors.h" #include "third_party/python/Python/importdl.h" /* clang-format off */ diff --git a/third_party/python/Python/dynload_shlib.c b/third_party/python/Python/dynload_shlib.c index 5eb046b58..f5bbfb716 100644 --- a/third_party/python/Python/dynload_shlib.c +++ b/third_party/python/Python/dynload_shlib.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/calls/weirdtypes.h" #include "libc/runtime/dlfcn.h" #include "third_party/python/Include/fileutils.h" diff --git a/third_party/python/Python/dynload_stub.c b/third_party/python/Python/dynload_stub.c index 41b7fb978..de551cf21 100644 --- a/third_party/python/Python/dynload_stub.c +++ b/third_party/python/Python/dynload_stub.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "third_party/python/Python/importdl.h" /* clang-format off */ diff --git a/third_party/python/Python/dynload_win.c b/third_party/python/Python/dynload_win.c index ec4fc70fc..052eefbfa 100644 --- a/third_party/python/Python/dynload_win.c +++ b/third_party/python/Python/dynload_win.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "third_party/python/Include/patchlevel.h" #include "third_party/python/Python/importdl.h" /* clang-format off */ diff --git a/third_party/python/Python/errors.c b/third_party/python/Python/errors.c index a297a4c64..f4a336c69 100644 --- a/third_party/python/Python/errors.c +++ b/third_party/python/Python/errors.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/errno.h" #include "third_party/python/Include/abstract.h" #include "third_party/python/Include/dictobject.h" diff --git a/third_party/python/Python/fileutils.c b/third_party/python/Python/fileutils.c index 330a3d8d2..892aee18c 100644 --- a/third_party/python/Python/fileutils.c +++ b/third_party/python/Python/fileutils.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/calls/calls.h" #include "libc/calls/ioctl.h" #include "libc/dce.h" diff --git a/third_party/python/Python/formatter_unicode.c b/third_party/python/Python/formatter_unicode.c index 2f2d0146e..4ffb80010 100644 --- a/third_party/python/Python/formatter_unicode.c +++ b/third_party/python/Python/formatter_unicode.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/math.h" #include "libc/unicode/locale.h" #include "third_party/python/Include/abstract.h" diff --git a/third_party/python/Python/frozen.c b/third_party/python/Python/frozen.c index f9f445dff..f99857139 100644 --- a/third_party/python/Python/frozen.c +++ b/third_party/python/Python/frozen.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "third_party/python/Include/import.h" #include "third_party/python/Python/importlib.inc" #include "third_party/python/Python/importlib_external.inc" diff --git a/third_party/python/Python/frozenmain.c b/third_party/python/Python/frozenmain.c index 5c2d1e18a..e94925fcf 100644 --- a/third_party/python/Python/frozenmain.c +++ b/third_party/python/Python/frozenmain.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/calls/calls.h" #include "libc/stdio/stdio.h" #include "libc/unicode/locale.h" diff --git a/third_party/python/Python/future.c b/third_party/python/Python/future.c index 20553144e..3879ad710 100644 --- a/third_party/python/Python/future.c +++ b/third_party/python/Python/future.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "third_party/python/Include/Python-ast.h" #include "third_party/python/Include/code.h" #include "third_party/python/Include/graminit.h" diff --git a/third_party/python/Python/getargs.c b/third_party/python/Python/getargs.c index 4a7793d4c..b448bff4e 100644 --- a/third_party/python/Python/getargs.c +++ b/third_party/python/Python/getargs.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/assert.h" #include "third_party/python/Include/abstract.h" #include "third_party/python/Include/bytearrayobject.h" diff --git a/third_party/python/Python/getcompiler.c b/third_party/python/Python/getcompiler.c index 5eaa3bebe..08e7b3a63 100644 --- a/third_party/python/Python/getcompiler.c +++ b/third_party/python/Python/getcompiler.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "third_party/python/Include/pylifecycle.h" /* clang-format off */ diff --git a/third_party/python/Python/getcopyright.c b/third_party/python/Python/getcopyright.c index ca1dee7dd..4f1228c3f 100644 --- a/third_party/python/Python/getcopyright.c +++ b/third_party/python/Python/getcopyright.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "third_party/python/Include/pylifecycle.h" /* clang-format off */ diff --git a/third_party/python/Python/getopt.c b/third_party/python/Python/getopt.c index b078b7da3..df4c5bf48 100644 --- a/third_party/python/Python/getopt.c +++ b/third_party/python/Python/getopt.c @@ -1,7 +1,14 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/stdio/stdio.h" #include "libc/str/str.h" #include "third_party/python/Include/pygetopt.h" /* clang-format off */ + /*---------------------------------------------------------------------------* * * diff --git a/third_party/python/Python/getplatform.c b/third_party/python/Python/getplatform.c index 006c70004..79b628def 100644 --- a/third_party/python/Python/getplatform.c +++ b/third_party/python/Python/getplatform.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ /* clang-format off */ #ifndef PLATFORM diff --git a/third_party/python/Python/getversion.c b/third_party/python/Python/getversion.c index 5879086bd..404070a4a 100644 --- a/third_party/python/Python/getversion.c +++ b/third_party/python/Python/getversion.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "third_party/python/Include/patchlevel.h" #include "third_party/python/Include/pyerrors.h" #include "third_party/python/Include/pylifecycle.h" diff --git a/third_party/python/Python/graminit.c b/third_party/python/Python/graminit.c index 0b149ef9f..6d9095db6 100644 --- a/third_party/python/Python/graminit.c +++ b/third_party/python/Python/graminit.c @@ -1,5 +1,13 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ /* clang-format off */ + /* Generated by Parser/pgen */ + #include "third_party/python/Include/pgenheaders.h" #include "third_party/python/Include/grammar.h" extern grammar _PyParser_Grammar; diff --git a/third_party/python/Python/import.c b/third_party/python/Python/import.c index 67bc63251..076e37c38 100644 --- a/third_party/python/Python/import.c +++ b/third_party/python/Python/import.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "third_party/python/Include/Python-ast.h" #include "third_party/python/Include/abstract.h" #include "third_party/python/Include/boolobject.h" diff --git a/third_party/python/Python/importdl.c b/third_party/python/Python/importdl.c index b696aaf9a..881880ab7 100644 --- a/third_party/python/Python/importdl.c +++ b/third_party/python/Python/importdl.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "third_party/python/Include/abstract.h" #include "third_party/python/Include/bytesobject.h" #include "third_party/python/Include/import.h" diff --git a/third_party/python/Python/importlib.inc b/third_party/python/Python/importlib.inc index faa2f0159..325c155a2 100644 --- a/third_party/python/Python/importlib.inc +++ b/third_party/python/Python/importlib.inc @@ -1,5 +1,13 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ /* clang-format off */ + /* Auto-generated by Programs/_freeze_importlib.c */ + const unsigned char _Py_M__importlib[] = { 99,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0, 0,64,0,0,0,115,208,1,0,0,100,0,90,0,100,1, diff --git a/third_party/python/Python/importlib_external.inc b/third_party/python/Python/importlib_external.inc index 886aa6800..c801b60d1 100644 --- a/third_party/python/Python/importlib_external.inc +++ b/third_party/python/Python/importlib_external.inc @@ -1,4 +1,13 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ +/* clang-format off */ + /* Auto-generated by Programs/_freeze_importlib.c */ + const unsigned char _Py_M__importlib_external[] = { 99,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0, 0,64,0,0,0,115,248,1,0,0,100,0,90,0,100,91, diff --git a/third_party/python/Python/marshal.c b/third_party/python/Python/marshal.c index 18999f4e4..652120fee 100644 --- a/third_party/python/Python/marshal.c +++ b/third_party/python/Python/marshal.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #define PY_SSIZE_T_CLEAN #include "dsp/mpeg/video.h" #include "libc/calls/calls.h" diff --git a/third_party/python/Python/modsupport.c b/third_party/python/Python/modsupport.c index e5c843c2b..5dad7dfb1 100644 --- a/third_party/python/Python/modsupport.c +++ b/third_party/python/Python/modsupport.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/assert.h" #include "third_party/python/Include/ceval.h" #include "third_party/python/Include/complexobject.h" diff --git a/third_party/python/Python/mysnprintf.c b/third_party/python/Python/mysnprintf.c index 9bc535e71..0a0fc3307 100644 --- a/third_party/python/Python/mysnprintf.c +++ b/third_party/python/Python/mysnprintf.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/assert.h" #include "libc/fmt/fmt.h" #include "third_party/python/Include/pyerrors.h" diff --git a/third_party/python/Python/mystrtoul.c b/third_party/python/Python/mystrtoul.c index ecab76377..66440642b 100644 --- a/third_party/python/Python/mystrtoul.c +++ b/third_party/python/Python/mystrtoul.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/errno.h" #include "libc/limits.h" #include "third_party/python/Include/longobject.h" diff --git a/third_party/python/Python/opcode_targets.inc b/third_party/python/Python/opcode_targets.inc index 26869fef5..4a1fe4d6e 100644 --- a/third_party/python/Python/opcode_targets.inc +++ b/third_party/python/Python/opcode_targets.inc @@ -1,4 +1,11 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ /* clang-format off */ + static void *opcode_targets[256] = { &&_unknown_opcode, &&TARGET_POP_TOP, diff --git a/third_party/python/Python/peephole.c b/third_party/python/Python/peephole.c index 8e825cdf3..7b4db7082 100644 --- a/third_party/python/Python/peephole.c +++ b/third_party/python/Python/peephole.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "third_party/python/Include/Python-ast.h" #include "third_party/python/Include/abstract.h" #include "third_party/python/Include/ast.h" diff --git a/third_party/python/Python/pyarena.c b/third_party/python/Python/pyarena.c index 094214f69..b49f42dbc 100644 --- a/third_party/python/Python/pyarena.c +++ b/third_party/python/Python/pyarena.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/assert.h" #include "libc/mem/mem.h" #include "third_party/python/Include/listobject.h" diff --git a/third_party/python/Python/pyfpe.c b/third_party/python/Python/pyfpe.c index ed4464094..bf7de3823 100644 --- a/third_party/python/Python/pyfpe.c +++ b/third_party/python/Python/pyfpe.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ /* clang-format off */ #include "third_party/python/pyconfig.h" #include "third_party/python/Include/pyfpe.h" diff --git a/third_party/python/Python/pyhash.c b/third_party/python/Python/pyhash.c index 995e479fb..6d0f6c2c9 100644 --- a/third_party/python/Python/pyhash.c +++ b/third_party/python/Python/pyhash.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "third_party/python/Include/pyhash.h" /* clang-format off */ diff --git a/third_party/python/Python/pylifecycle.c b/third_party/python/Python/pylifecycle.c index 98a45d73d..ec5e5bcc5 100644 --- a/third_party/python/Python/pylifecycle.c +++ b/third_party/python/Python/pylifecycle.c @@ -1,5 +1,5 @@ /*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ -│vi: set net ft=c ts=2 sts=2 sw=2 fenc=utf-8 :vi│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ ╞══════════════════════════════════════════════════════════════════════════════╡ │ Python 3 │ │ https://docs.python.org/3/license.html │ diff --git a/third_party/python/Python/pymath.c b/third_party/python/Python/pymath.c index f9ded77a5..c73476f82 100644 --- a/third_party/python/Python/pymath.c +++ b/third_party/python/Python/pymath.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "third_party/python/pyconfig.h" /* clang-format off */ diff --git a/third_party/python/Python/pystate.c b/third_party/python/Python/pystate.c index 95a119db1..4eb62e431 100644 --- a/third_party/python/Python/pystate.c +++ b/third_party/python/Python/pystate.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/bits/pushpop.h" #include "libc/runtime/dlfcn.h" #include "third_party/python/Include/ceval.h" diff --git a/third_party/python/Python/pystrcmp.c b/third_party/python/Python/pystrcmp.c index 3f9e30cd8..192a16b5e 100644 --- a/third_party/python/Python/pystrcmp.c +++ b/third_party/python/Python/pystrcmp.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "third_party/python/Include/object.h" #include "third_party/python/Include/pyctype.h" /* clang-format off */ diff --git a/third_party/python/Python/pystrhex.c b/third_party/python/Python/pystrhex.c index b044780c9..bf51a6029 100644 --- a/third_party/python/Python/pystrhex.c +++ b/third_party/python/Python/pystrhex.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/assert.h" #include "third_party/python/Include/bytesobject.h" #include "third_party/python/Include/codecs.h" diff --git a/third_party/python/Python/pystrtod.c b/third_party/python/Python/pystrtod.c index 6c8f9b514..91050fc83 100644 --- a/third_party/python/Python/pystrtod.c +++ b/third_party/python/Python/pystrtod.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/assert.h" #include "libc/errno.h" #include "libc/fmt/fmt.h" diff --git a/third_party/python/Python/pythonrun.c b/third_party/python/Python/pythonrun.c index 7524d9cd8..a9d7f354c 100644 --- a/third_party/python/Python/pythonrun.c +++ b/third_party/python/Python/pythonrun.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/unicode/locale.h" #include "third_party/python/Include/Python-ast.h" #include "third_party/python/Include/abstract.h" diff --git a/third_party/python/Python/pytime.c b/third_party/python/Python/pytime.c index fc0e1c31a..25ae99e26 100644 --- a/third_party/python/Python/pytime.c +++ b/third_party/python/Python/pytime.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/calls/weirdtypes.h" #include "libc/math.h" #include "libc/sysv/consts/clock.h" diff --git a/third_party/python/Python/random.c b/third_party/python/Python/random.c index 2360e50a8..3526993d7 100644 --- a/third_party/python/Python/random.c +++ b/third_party/python/Python/random.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/calls/calls.h" #include "libc/calls/weirdtypes.h" #include "libc/errno.h" diff --git a/third_party/python/Python/sigcheck.c b/third_party/python/Python/sigcheck.c index bd9438d0a..004ee4bd1 100644 --- a/third_party/python/Python/sigcheck.c +++ b/third_party/python/Python/sigcheck.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "third_party/python/Include/intrcheck.h" #include "third_party/python/Include/pyerrors.h" /* clang-format off */ diff --git a/third_party/python/Python/structmember.c b/third_party/python/Python/structmember.c index 1e7076aa1..b627b2c22 100644 --- a/third_party/python/Python/structmember.c +++ b/third_party/python/Python/structmember.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "third_party/python/Include/boolobject.h" #include "third_party/python/Include/floatobject.h" #include "third_party/python/Include/longobject.h" diff --git a/third_party/python/Python/symtable.c b/third_party/python/Python/symtable.c index 845b75509..9b46cdbde 100644 --- a/third_party/python/Python/symtable.c +++ b/third_party/python/Python/symtable.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "third_party/python/Include/Python-ast.h" #include "third_party/python/Include/abstract.h" #include "third_party/python/Include/ceval.h" diff --git a/third_party/python/Python/sysmodule.c b/third_party/python/Python/sysmodule.c index 041f0f195..2757fe41c 100644 --- a/third_party/python/Python/sysmodule.c +++ b/third_party/python/Python/sysmodule.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/calls/calls.h" #include "libc/dce.h" #include "libc/runtime/runtime.h" diff --git a/third_party/python/Python/thread.c b/third_party/python/Python/thread.c index 9a2bd71a4..cc108aa2d 100644 --- a/third_party/python/Python/thread.c +++ b/third_party/python/Python/thread.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/assert.h" #include "third_party/python/Include/pyerrors.h" #include "third_party/python/Include/pymacro.h" diff --git a/third_party/python/Python/thread_pthread.inc b/third_party/python/Python/thread_pthread.inc index e4de1bf94..6412c0bd9 100644 --- a/third_party/python/Python/thread_pthread.inc +++ b/third_party/python/Python/thread_pthread.inc @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ /* clang-format off */ /* Posix threads interface */ diff --git a/third_party/python/Python/traceback.c b/third_party/python/Python/traceback.c index 633b727f1..403c25744 100644 --- a/third_party/python/Python/traceback.c +++ b/third_party/python/Python/traceback.c @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/calls/calls.h" #include "libc/calls/weirdtypes.h" #include "third_party/python/Include/abstract.h" diff --git a/third_party/python/Python/wordcode_helpers.inc b/third_party/python/Python/wordcode_helpers.inc index cfa3eb36e..49252be05 100644 --- a/third_party/python/Python/wordcode_helpers.inc +++ b/third_party/python/Python/wordcode_helpers.inc @@ -1,3 +1,9 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Python 3 │ +│ https://docs.python.org/3/license.html │ +╚─────────────────────────────────────────────────────────────────────────────*/ #include "third_party/python/Include/code.h" /* clang-format off */