mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-23 22:02:27 +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
31
third_party/python/Include/setobject.h
vendored
31
third_party/python/Include/setobject.h
vendored
|
@ -1,5 +1,6 @@
|
|||
#ifndef Py_SETOBJECT_H
|
||||
#define Py_SETOBJECT_H
|
||||
#include "third_party/python/Include/object.h"
|
||||
COSMOPOLITAN_C_START_
|
||||
/* clang-format off */
|
||||
|
||||
|
@ -63,27 +64,27 @@ typedef struct {
|
|||
|
||||
#define PySet_GET_SIZE(so) (((PySetObject *)(so))->used)
|
||||
|
||||
PyAPI_DATA(PyObject *) _PySet_Dummy;
|
||||
extern PyObject * _PySet_Dummy;
|
||||
|
||||
PyAPI_FUNC(int) _PySet_NextEntry(PyObject *set, Py_ssize_t *pos, PyObject **key, Py_hash_t *hash);
|
||||
PyAPI_FUNC(int) _PySet_Update(PyObject *set, PyObject *iterable);
|
||||
PyAPI_FUNC(int) PySet_ClearFreeList(void);
|
||||
int _PySet_NextEntry(PyObject *set, Py_ssize_t *pos, PyObject **key, Py_hash_t *hash);
|
||||
int _PySet_Update(PyObject *set, PyObject *iterable);
|
||||
int PySet_ClearFreeList(void);
|
||||
|
||||
#endif /* Section excluded by Py_LIMITED_API */
|
||||
|
||||
PyAPI_DATA(PyTypeObject) PySet_Type;
|
||||
PyAPI_DATA(PyTypeObject) PyFrozenSet_Type;
|
||||
PyAPI_DATA(PyTypeObject) PySetIter_Type;
|
||||
extern PyTypeObject PySet_Type;
|
||||
extern PyTypeObject PyFrozenSet_Type;
|
||||
extern PyTypeObject PySetIter_Type;
|
||||
|
||||
PyAPI_FUNC(PyObject *) PySet_New(PyObject *);
|
||||
PyAPI_FUNC(PyObject *) PyFrozenSet_New(PyObject *);
|
||||
PyObject * PySet_New(PyObject *);
|
||||
PyObject * PyFrozenSet_New(PyObject *);
|
||||
|
||||
PyAPI_FUNC(int) PySet_Add(PyObject *set, PyObject *key);
|
||||
PyAPI_FUNC(int) PySet_Clear(PyObject *set);
|
||||
PyAPI_FUNC(int) PySet_Contains(PyObject *anyset, PyObject *key);
|
||||
PyAPI_FUNC(int) PySet_Discard(PyObject *set, PyObject *key);
|
||||
PyAPI_FUNC(PyObject *) PySet_Pop(PyObject *set);
|
||||
PyAPI_FUNC(Py_ssize_t) PySet_Size(PyObject *anyset);
|
||||
int PySet_Add(PyObject *set, PyObject *key);
|
||||
int PySet_Clear(PyObject *set);
|
||||
int PySet_Contains(PyObject *anyset, PyObject *key);
|
||||
int PySet_Discard(PyObject *set, PyObject *key);
|
||||
PyObject * PySet_Pop(PyObject *set);
|
||||
Py_ssize_t PySet_Size(PyObject *anyset);
|
||||
|
||||
#define PyFrozenSet_CheckExact(ob) (Py_TYPE(ob) == &PyFrozenSet_Type)
|
||||
#define PyAnySet_CheckExact(ob) \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue