FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
python/Include/bitset.h at master · charleson/python · GitHub
charleson
/
python
Public
forked from
glix/python
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
python
/
Include
/
bitset.h
Copy path
More file actions
More file actions
Latest commit
History
History
History
32 lines (24 loc) · 792 Bytes
Breadcrumbs
python
/
Include
/
bitset.h
Copy path
File metadata and controls
32 lines (24 loc) · 792 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#ifndef
Py_BITSET_H
#define
Py_BITSET_H
#ifdef
__cplusplus
extern
"C"
{
#endif
/* Bitset interface */
#define
BYTE
char
typedef
BYTE
*
bitset
;
bitset
newbitset
(
int
nbits
);
void
delbitset
(
bitset
bs
);
#define
testbit
(
ss
,
ibit
) (((ss)[BIT2BYTE(ibit)] & BIT2MASK(ibit)) != 0)
int
addbit
(
bitset
bs
,
int
ibit
);
/* Returns 0 if already set */
int
samebitset
(
bitset
bs1
,
bitset
bs2
,
int
nbits
);
void
mergebitset
(
bitset
bs1
,
bitset
bs2
,
int
nbits
);
#define
BITSPERBYTE
(8*sizeof(BYTE))
#define
NBYTES
(
nbits
) (((nbits) + BITSPERBYTE - 1) / BITSPERBYTE)
#define
BIT2BYTE
(
ibit
) ((ibit) / BITSPERBYTE)
#define
BIT2SHIFT
(
ibit
) ((ibit) % BITSPERBYTE)
#define
BIT2MASK
(
ibit
) (1 << BIT2SHIFT(ibit))
#define
BYTE2BIT
(
ibyte
) ((ibyte) * BITSPERBYTE)
#ifdef
__cplusplus
}
#endif
#endif
/* !Py_BITSET_H */
Back
|
FazBrowse Home
|
New Git URL