Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/ExeBy/smexe_ro.../usr/include/python3....
File: setobject.h
/* Set object interface */
[0] Fix | Delete
[1] Fix | Delete
#ifndef Py_SETOBJECT_H
[2] Fix | Delete
#define Py_SETOBJECT_H
[3] Fix | Delete
#ifdef __cplusplus
[4] Fix | Delete
extern "C" {
[5] Fix | Delete
#endif
[6] Fix | Delete
[7] Fix | Delete
#ifndef Py_LIMITED_API
[8] Fix | Delete
[9] Fix | Delete
/* There are three kinds of entries in the table:
[10] Fix | Delete
[11] Fix | Delete
1. Unused: key == NULL and hash == 0
[12] Fix | Delete
2. Dummy: key == dummy and hash == -1
[13] Fix | Delete
3. Active: key != NULL and key != dummy and hash != -1
[14] Fix | Delete
[15] Fix | Delete
The hash field of Unused slots is always zero.
[16] Fix | Delete
[17] Fix | Delete
The hash field of Dummy slots are set to -1
[18] Fix | Delete
meaning that dummy entries can be detected by
[19] Fix | Delete
either entry->key==dummy or by entry->hash==-1.
[20] Fix | Delete
*/
[21] Fix | Delete
[22] Fix | Delete
#define PySet_MINSIZE 8
[23] Fix | Delete
[24] Fix | Delete
typedef struct {
[25] Fix | Delete
PyObject *key;
[26] Fix | Delete
Py_hash_t hash; /* Cached hash code of the key */
[27] Fix | Delete
} setentry;
[28] Fix | Delete
[29] Fix | Delete
/* The SetObject data structure is shared by set and frozenset objects.
[30] Fix | Delete
[31] Fix | Delete
Invariant for sets:
[32] Fix | Delete
- hash is -1
[33] Fix | Delete
[34] Fix | Delete
Invariants for frozensets:
[35] Fix | Delete
- data is immutable.
[36] Fix | Delete
- hash is the hash of the frozenset or -1 if not computed yet.
[37] Fix | Delete
[38] Fix | Delete
*/
[39] Fix | Delete
[40] Fix | Delete
typedef struct {
[41] Fix | Delete
PyObject_HEAD
[42] Fix | Delete
[43] Fix | Delete
Py_ssize_t fill; /* Number active and dummy entries*/
[44] Fix | Delete
Py_ssize_t used; /* Number active entries */
[45] Fix | Delete
[46] Fix | Delete
/* The table contains mask + 1 slots, and that's a power of 2.
[47] Fix | Delete
* We store the mask instead of the size because the mask is more
[48] Fix | Delete
* frequently needed.
[49] Fix | Delete
*/
[50] Fix | Delete
Py_ssize_t mask;
[51] Fix | Delete
[52] Fix | Delete
/* The table points to a fixed-size smalltable for small tables
[53] Fix | Delete
* or to additional malloc'ed memory for bigger tables.
[54] Fix | Delete
* The table pointer is never NULL which saves us from repeated
[55] Fix | Delete
* runtime null-tests.
[56] Fix | Delete
*/
[57] Fix | Delete
setentry *table;
[58] Fix | Delete
Py_hash_t hash; /* Only used by frozenset objects */
[59] Fix | Delete
Py_ssize_t finger; /* Search finger for pop() */
[60] Fix | Delete
[61] Fix | Delete
setentry smalltable[PySet_MINSIZE];
[62] Fix | Delete
PyObject *weakreflist; /* List of weak references */
[63] Fix | Delete
} PySetObject;
[64] Fix | Delete
[65] Fix | Delete
#define PySet_GET_SIZE(so) (((PySetObject *)(so))->used)
[66] Fix | Delete
[67] Fix | Delete
PyAPI_DATA(PyObject *) _PySet_Dummy;
[68] Fix | Delete
[69] Fix | Delete
PyAPI_FUNC(int) _PySet_NextEntry(PyObject *set, Py_ssize_t *pos, PyObject **key, Py_hash_t *hash);
[70] Fix | Delete
PyAPI_FUNC(int) _PySet_Update(PyObject *set, PyObject *iterable);
[71] Fix | Delete
PyAPI_FUNC(int) PySet_ClearFreeList(void);
[72] Fix | Delete
[73] Fix | Delete
#endif /* Section excluded by Py_LIMITED_API */
[74] Fix | Delete
[75] Fix | Delete
PyAPI_DATA(PyTypeObject) PySet_Type;
[76] Fix | Delete
PyAPI_DATA(PyTypeObject) PyFrozenSet_Type;
[77] Fix | Delete
PyAPI_DATA(PyTypeObject) PySetIter_Type;
[78] Fix | Delete
[79] Fix | Delete
PyAPI_FUNC(PyObject *) PySet_New(PyObject *);
[80] Fix | Delete
PyAPI_FUNC(PyObject *) PyFrozenSet_New(PyObject *);
[81] Fix | Delete
[82] Fix | Delete
PyAPI_FUNC(int) PySet_Add(PyObject *set, PyObject *key);
[83] Fix | Delete
PyAPI_FUNC(int) PySet_Clear(PyObject *set);
[84] Fix | Delete
PyAPI_FUNC(int) PySet_Contains(PyObject *anyset, PyObject *key);
[85] Fix | Delete
PyAPI_FUNC(int) PySet_Discard(PyObject *set, PyObject *key);
[86] Fix | Delete
PyAPI_FUNC(PyObject *) PySet_Pop(PyObject *set);
[87] Fix | Delete
PyAPI_FUNC(Py_ssize_t) PySet_Size(PyObject *anyset);
[88] Fix | Delete
[89] Fix | Delete
#define PyFrozenSet_CheckExact(ob) (Py_TYPE(ob) == &PyFrozenSet_Type)
[90] Fix | Delete
#define PyAnySet_CheckExact(ob) \
[91] Fix | Delete
(Py_TYPE(ob) == &PySet_Type || Py_TYPE(ob) == &PyFrozenSet_Type)
[92] Fix | Delete
#define PyAnySet_Check(ob) \
[93] Fix | Delete
(Py_TYPE(ob) == &PySet_Type || Py_TYPE(ob) == &PyFrozenSet_Type || \
[94] Fix | Delete
PyType_IsSubtype(Py_TYPE(ob), &PySet_Type) || \
[95] Fix | Delete
PyType_IsSubtype(Py_TYPE(ob), &PyFrozenSet_Type))
[96] Fix | Delete
#define PySet_Check(ob) \
[97] Fix | Delete
(Py_TYPE(ob) == &PySet_Type || \
[98] Fix | Delete
PyType_IsSubtype(Py_TYPE(ob), &PySet_Type))
[99] Fix | Delete
#define PyFrozenSet_Check(ob) \
[100] Fix | Delete
(Py_TYPE(ob) == &PyFrozenSet_Type || \
[101] Fix | Delete
PyType_IsSubtype(Py_TYPE(ob), &PyFrozenSet_Type))
[102] Fix | Delete
[103] Fix | Delete
#ifdef __cplusplus
[104] Fix | Delete
}
[105] Fix | Delete
#endif
[106] Fix | Delete
#endif /* !Py_SETOBJECT_H */
[107] Fix | Delete
[108] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function