mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-27 23:08:31 +00:00
Undiamond Python headers
This change gets the Python codebase into a state where it conforms to the conventions of this codebase. It's now possible to include headers from Python, without worrying about ordering. Python has traditionally solved that problem by "diamonding" everything in Python.h, but that's problematic since it means any change to any Python header invalidates all the build artifacts. Lastly it makes tooling not work. Since it is hard to explain to Emacs when I press C-c C-h to add an import line it shouldn't add the header that actually defines the symbol, and instead do follow the nonstandard Python convention. Progress has been made on letting Python load source code from the zip executable structure via the standard C library APIs. System calss now recognizes zip!FILENAME alternative URIs as equivalent to zip:FILENAME since Python uses colon as its delimiter. Some progress has been made on embedding the notice license terms into the Python object code. This is easier said than done since Python has an extremely complicated ownership story. - Some termios APIs have been added - Implement rewinddir() dirstream API - GetCpuCount() API added to Cosmopolitan Libc - More bugs in Cosmopolitan Libc have been fixed - zipobj.com now has flags for mangling the path - Fixed bug a priori with sendfile() on certain BSDs - Polyfill F_DUPFD and F_DUPFD_CLOEXEC across platforms - FIOCLEX / FIONCLEX now polyfilled for fast O_CLOEXEC changes - APE now supports a hybrid solution to no-self-modify for builds - Many BSD-only magnums added, e.g. O_SEARCH, O_SHLOCK, SF_NODISKIO
This commit is contained in:
parent
20bb8db9f8
commit
b420ed8248
762 changed files with 18410 additions and 53772 deletions
|
@ -1,3 +1,4 @@
|
|||
/* clang-format off */
|
||||
/*[clinic input]
|
||||
preserve
|
||||
[clinic start generated code]*/
|
||||
|
@ -129,11 +130,6 @@ PyDoc_STRVAR(_io_open__doc__,
|
|||
#define _IO_OPEN_METHODDEF \
|
||||
{"open", (PyCFunction)_io_open, METH_FASTCALL, _io_open__doc__},
|
||||
|
||||
static PyObject *
|
||||
_io_open_impl(PyObject *module, PyObject *file, const char *mode,
|
||||
int buffering, const char *encoding, const char *errors,
|
||||
const char *newline, int closefd, PyObject *opener);
|
||||
|
||||
static PyObject *
|
||||
_io_open(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* clang-format off */
|
||||
/*[clinic input]
|
||||
preserve
|
||||
[clinic start generated code]*/
|
||||
|
@ -10,8 +11,6 @@ PyDoc_STRVAR(_io__BufferedIOBase_readinto__doc__,
|
|||
#define _IO__BUFFEREDIOBASE_READINTO_METHODDEF \
|
||||
{"readinto", (PyCFunction)_io__BufferedIOBase_readinto, METH_O, _io__BufferedIOBase_readinto__doc__},
|
||||
|
||||
static PyObject *
|
||||
_io__BufferedIOBase_readinto_impl(PyObject *self, Py_buffer *buffer);
|
||||
|
||||
static PyObject *
|
||||
_io__BufferedIOBase_readinto(PyObject *self, PyObject *arg)
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* clang-format off */
|
||||
/*[clinic input]
|
||||
preserve
|
||||
[clinic start generated code]*/
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* clang-format off */
|
||||
/*[clinic input]
|
||||
preserve
|
||||
[clinic start generated code]*/
|
||||
|
@ -14,9 +15,6 @@ PyDoc_STRVAR(_io_FileIO_close__doc__,
|
|||
#define _IO_FILEIO_CLOSE_METHODDEF \
|
||||
{"close", (PyCFunction)_io_FileIO_close, METH_NOARGS, _io_FileIO_close__doc__},
|
||||
|
||||
static PyObject *
|
||||
_io_FileIO_close_impl(fileio *self);
|
||||
|
||||
static PyObject *
|
||||
_io_FileIO_close(fileio *self, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
|
@ -41,10 +39,6 @@ PyDoc_STRVAR(_io_FileIO___init____doc__,
|
|||
"*opener* must return an open file descriptor (passing os.open as *opener*\n"
|
||||
"results in functionality similar to passing None).");
|
||||
|
||||
static int
|
||||
_io_FileIO___init___impl(fileio *self, PyObject *nameobj, const char *mode,
|
||||
int closefd, PyObject *opener);
|
||||
|
||||
static int
|
||||
_io_FileIO___init__(PyObject *self, PyObject *args, PyObject *kwargs)
|
||||
{
|
||||
|
|
31
third_party/python/Modules/_io/clinic/iobase.inc
vendored
31
third_party/python/Modules/_io/clinic/iobase.inc
vendored
|
@ -1,3 +1,4 @@
|
|||
/* clang-format off */
|
||||
/*[clinic input]
|
||||
preserve
|
||||
[clinic start generated code]*/
|
||||
|
@ -11,9 +12,6 @@ PyDoc_STRVAR(_io__IOBase_tell__doc__,
|
|||
#define _IO__IOBASE_TELL_METHODDEF \
|
||||
{"tell", (PyCFunction)_io__IOBase_tell, METH_NOARGS, _io__IOBase_tell__doc__},
|
||||
|
||||
static PyObject *
|
||||
_io__IOBase_tell_impl(PyObject *self);
|
||||
|
||||
static PyObject *
|
||||
_io__IOBase_tell(PyObject *self, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
|
@ -31,9 +29,6 @@ PyDoc_STRVAR(_io__IOBase_flush__doc__,
|
|||
#define _IO__IOBASE_FLUSH_METHODDEF \
|
||||
{"flush", (PyCFunction)_io__IOBase_flush, METH_NOARGS, _io__IOBase_flush__doc__},
|
||||
|
||||
static PyObject *
|
||||
_io__IOBase_flush_impl(PyObject *self);
|
||||
|
||||
static PyObject *
|
||||
_io__IOBase_flush(PyObject *self, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
|
@ -51,9 +46,6 @@ PyDoc_STRVAR(_io__IOBase_close__doc__,
|
|||
#define _IO__IOBASE_CLOSE_METHODDEF \
|
||||
{"close", (PyCFunction)_io__IOBase_close, METH_NOARGS, _io__IOBase_close__doc__},
|
||||
|
||||
static PyObject *
|
||||
_io__IOBase_close_impl(PyObject *self);
|
||||
|
||||
static PyObject *
|
||||
_io__IOBase_close(PyObject *self, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
|
@ -72,9 +64,6 @@ PyDoc_STRVAR(_io__IOBase_seekable__doc__,
|
|||
#define _IO__IOBASE_SEEKABLE_METHODDEF \
|
||||
{"seekable", (PyCFunction)_io__IOBase_seekable, METH_NOARGS, _io__IOBase_seekable__doc__},
|
||||
|
||||
static PyObject *
|
||||
_io__IOBase_seekable_impl(PyObject *self);
|
||||
|
||||
static PyObject *
|
||||
_io__IOBase_seekable(PyObject *self, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
|
@ -92,9 +81,6 @@ PyDoc_STRVAR(_io__IOBase_readable__doc__,
|
|||
#define _IO__IOBASE_READABLE_METHODDEF \
|
||||
{"readable", (PyCFunction)_io__IOBase_readable, METH_NOARGS, _io__IOBase_readable__doc__},
|
||||
|
||||
static PyObject *
|
||||
_io__IOBase_readable_impl(PyObject *self);
|
||||
|
||||
static PyObject *
|
||||
_io__IOBase_readable(PyObject *self, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
|
@ -112,9 +98,6 @@ PyDoc_STRVAR(_io__IOBase_writable__doc__,
|
|||
#define _IO__IOBASE_WRITABLE_METHODDEF \
|
||||
{"writable", (PyCFunction)_io__IOBase_writable, METH_NOARGS, _io__IOBase_writable__doc__},
|
||||
|
||||
static PyObject *
|
||||
_io__IOBase_writable_impl(PyObject *self);
|
||||
|
||||
static PyObject *
|
||||
_io__IOBase_writable(PyObject *self, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
|
@ -132,9 +115,6 @@ PyDoc_STRVAR(_io__IOBase_fileno__doc__,
|
|||
#define _IO__IOBASE_FILENO_METHODDEF \
|
||||
{"fileno", (PyCFunction)_io__IOBase_fileno, METH_NOARGS, _io__IOBase_fileno__doc__},
|
||||
|
||||
static PyObject *
|
||||
_io__IOBase_fileno_impl(PyObject *self);
|
||||
|
||||
static PyObject *
|
||||
_io__IOBase_fileno(PyObject *self, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
|
@ -152,9 +132,6 @@ PyDoc_STRVAR(_io__IOBase_isatty__doc__,
|
|||
#define _IO__IOBASE_ISATTY_METHODDEF \
|
||||
{"isatty", (PyCFunction)_io__IOBase_isatty, METH_NOARGS, _io__IOBase_isatty__doc__},
|
||||
|
||||
static PyObject *
|
||||
_io__IOBase_isatty_impl(PyObject *self);
|
||||
|
||||
static PyObject *
|
||||
_io__IOBase_isatty(PyObject *self, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
|
@ -176,9 +153,6 @@ PyDoc_STRVAR(_io__IOBase_readline__doc__,
|
|||
#define _IO__IOBASE_READLINE_METHODDEF \
|
||||
{"readline", (PyCFunction)_io__IOBase_readline, METH_VARARGS, _io__IOBase_readline__doc__},
|
||||
|
||||
static PyObject *
|
||||
_io__IOBase_readline_impl(PyObject *self, Py_ssize_t limit);
|
||||
|
||||
static PyObject *
|
||||
_io__IOBase_readline(PyObject *self, PyObject *args)
|
||||
{
|
||||
|
@ -208,9 +182,6 @@ PyDoc_STRVAR(_io__IOBase_readlines__doc__,
|
|||
#define _IO__IOBASE_READLINES_METHODDEF \
|
||||
{"readlines", (PyCFunction)_io__IOBase_readlines, METH_VARARGS, _io__IOBase_readlines__doc__},
|
||||
|
||||
static PyObject *
|
||||
_io__IOBase_readlines_impl(PyObject *self, Py_ssize_t hint);
|
||||
|
||||
static PyObject *
|
||||
_io__IOBase_readlines(PyObject *self, PyObject *args)
|
||||
{
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* clang-format off */
|
||||
/*[clinic input]
|
||||
preserve
|
||||
[clinic start generated code]*/
|
||||
|
@ -11,9 +12,6 @@ PyDoc_STRVAR(_io_StringIO_getvalue__doc__,
|
|||
#define _IO_STRINGIO_GETVALUE_METHODDEF \
|
||||
{"getvalue", (PyCFunction)_io_StringIO_getvalue, METH_NOARGS, _io_StringIO_getvalue__doc__},
|
||||
|
||||
static PyObject *
|
||||
_io_StringIO_getvalue_impl(stringio *self);
|
||||
|
||||
static PyObject *
|
||||
_io_StringIO_getvalue(stringio *self, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
|
|
|
@ -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=2 sts=2 sw=2 fenc=utf-8 :vi│
|
||||
╞══════════════════════════════════════════════════════════════════════════════╡
|
||||
│ Python 3 │
|
||||
│ https://docs.python.org/3/license.html │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
/* clang-format off */
|
||||
/*[clinic input]
|
||||
preserve
|
||||
[clinic start generated code]*/
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* clang-format off */
|
||||
/*[clinic input]
|
||||
preserve
|
||||
[clinic start generated code]*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue