source: trunk/essentials/dev-lang/python/Include/setobject.h@ 3408

Last change on this file since 3408 was 3225, checked in by bird, 19 years ago

Python 2.5

File size: 2.6 KB
Line 
1/* Set object interface */
2
3#ifndef Py_SETOBJECT_H
4#define Py_SETOBJECT_H
5#ifdef __cplusplus
6extern "C" {
7#endif
8
9
10/*
11There are three kinds of slots in the table:
12
131. Unused: key == NULL
142. Active: key != NULL and key != dummy
153. Dummy: key == dummy
16
17Note: .pop() abuses the hash field of an Unused or Dummy slot to
18hold a search finger. The hash field of Unused or Dummy slots has
19no meaning otherwise.
20*/
21
22#define PySet_MINSIZE 8
23
24typedef struct {
25 long hash; /* cached hash code for the entry key */
26 PyObject *key;
27} setentry;
28
29
30/*
31This data structure is shared by set and frozenset objects.
32*/
33
34typedef struct _setobject PySetObject;
35struct _setobject {
36 PyObject_HEAD
37
38 Py_ssize_t fill; /* # Active + # Dummy */
39 Py_ssize_t used; /* # Active */