-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbit.h
More file actions
45 lines (29 loc) · 963 Bytes
/
bit.h
File metadata and controls
45 lines (29 loc) · 963 Bytes
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
33
34
35
36
37
38
39
40
41
42
43
44
45
#ifndef twf_bit_h
#define twf_bit_h
const char *on_off ( const int*, int );
const char *true_false ( const int*, int );
const char *yes_no ( const int*, int );
/*
* BIT VECTOR FUNCTIONS
*/
bool is_set( int vector, int bit );
void switch_bit( int& vector, int bit );
void set_bit( int& vector, int bit );
void remove_bit( int& vector, int bit );
void assign_bit( int& vector, int bit, bool value );
/*
* BIT ARRAY FUNCTIONS
*/
bool is_set( const int *array, int bit );
void switch_bit( int *array, int bit );
void set_bit( int *array, int bit );
void remove_bit( int *array, int bit );
void assign_bit( int *array, int bit, bool value );
/*
* LEVEL FUNCTIONS
*/
void set_level( int* array, int bit, int level );
int level_setting( const int* array, int bit );
void set_level( int& vector, int bit, int level );
int level_setting( int vector, int bit );
#endif // twf_bit_h