Mercurial > cpython-lru_cache-weakref
annotate Include/bitset.h @ 80661:94de77bd0b4b 2.7
Issue #16194: document imp.load_dynamic problems
when read several extension modules from the same binary object file.
| author | Andrew Svetlov <andrew.svetlov@gmail.com> |
|---|---|
| date | Thu, 29 Nov 2012 19:51:28 +0200 |
| parents | 6f6f965c5e2d |
| children |
| rev | line source |
|---|---|
| 145 | 1 |
|
13443
7e58c060d534
ANSI-fication and Py_PROTO extermination.
Fred Drake <fdrake@acm.org>
parents:
13256
diff
changeset
|
2 #ifndef Py_BITSET_H |
|
7e58c060d534
ANSI-fication and Py_PROTO extermination.
Fred Drake <fdrake@acm.org>
parents:
13256
diff
changeset
|
3 #define Py_BITSET_H |
|
7e58c060d534
ANSI-fication and Py_PROTO extermination.
Fred Drake <fdrake@acm.org>
parents:
13256
diff
changeset
|
4 #ifdef __cplusplus |
|
7e58c060d534
ANSI-fication and Py_PROTO extermination.
Fred Drake <fdrake@acm.org>
parents:
13256
diff
changeset
|
5 extern "C" { |
|
7e58c060d534
ANSI-fication and Py_PROTO extermination.
Fred Drake <fdrake@acm.org>
parents:
13256
diff
changeset
|
6 #endif |
|
7e58c060d534
ANSI-fication and Py_PROTO extermination.
Fred Drake <fdrake@acm.org>
parents:
13256
diff
changeset
|
7 |
| 6 | 8 /* Bitset interface */ |
| 9 | |
| 10 #define BYTE char | |
| 11 | |
| 12 typedef BYTE *bitset; | |
| 13 | |
|
13443
7e58c060d534
ANSI-fication and Py_PROTO extermination.
Fred Drake <fdrake@acm.org>
parents:
13256
diff
changeset
|
14 bitset newbitset(int nbits); |
|
7e58c060d534
ANSI-fication and Py_PROTO extermination.
Fred Drake <fdrake@acm.org>
parents:
13256
diff
changeset
|
15 void delbitset(bitset bs); |
|
2043
4ebee904924e
Lots of small things, see ChangeLog
Guido van Rossum <guido@python.org>
parents:
1746
diff
changeset
|
16 #define testbit(ss, ibit) (((ss)[BIT2BYTE(ibit)] & BIT2MASK(ibit)) != 0) |
|
13443
7e58c060d534
ANSI-fication and Py_PROTO extermination.
Fred Drake <fdrake@acm.org>
parents:
13256
diff
changeset
|
17 int addbit(bitset bs, int ibit); /* Returns 0 if already set */ |
|
7e58c060d534
ANSI-fication and Py_PROTO extermination.
Fred Drake <fdrake@acm.org>
parents:
13256
diff
changeset
|
18 int samebitset(bitset bs1, bitset bs2, int nbits); |
|
7e58c060d534
ANSI-fication and Py_PROTO extermination.
Fred Drake <fdrake@acm.org>
parents:
13256
diff
changeset
|
19 void mergebitset(bitset bs1, bitset bs2, int nbits); |
| 6 | 20 |
| 21 #define BITSPERBYTE (8*sizeof(BYTE)) | |
| 22 #define NBYTES(nbits) (((nbits) + BITSPERBYTE - 1) / BITSPERBYTE) | |
| 23 | |
| 24 #define BIT2BYTE(ibit) ((ibit) / BITSPERBYTE) | |
| 25 #define BIT2SHIFT(ibit) ((ibit) % BITSPERBYTE) | |
| 26 #define BIT2MASK(ibit) (1 << BIT2SHIFT(ibit)) | |
| 27 #define BYTE2BIT(ibyte) ((ibyte) * BITSPERBYTE) | |
| 28 | |
|
1329
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
29 #ifdef __cplusplus |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
30 } |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
31 #endif |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
32 #endif /* !Py_BITSET_H */ |
