Merge nixio 0.2
[project/luci.git] / libs / nixio / docsrc / nixio.bit.lua
1 --- Bitfield operators and mainpulation functions.
2 -- Can be used as a drop-in replacement for bitlib.
3 module "nixio.bit"
4
5 --- Bitwise OR several numbers.
6 -- @class function
7 -- @name bor
8 -- @param oper1 First Operand
9 -- @param oper2 Second Operand
10 -- @param ...   More Operands
11 -- @return number
12
13 --- Bitwise AND several numbers.
14 -- @class function
15 -- @name band
16 -- @param oper1 First Operand
17 -- @param oper2 Second Operand
18 -- @param ...   More Operands
19 -- @return number
20
21 --- Bitwise XOR several numbers.
22 -- @class function
23 -- @name bxor
24 -- @param oper1 First Operand
25 -- @param oper2 Second Operand
26 -- @param ...   More Operands
27 -- @return number
28
29 --- Left shift a number.
30 -- @class function
31 -- @name shl
32 -- @param oper  number
33 -- @param shift bits to shift 
34 -- @return number
35
36 --- Right shift a number.
37 -- @class function
38 -- @name shr
39 -- @param oper  number
40 -- @param shift bits to shift 
41 -- @return number
42
43 --- Arithmetically right shift a number.
44 -- @class function
45 -- @name ashr
46 -- @param oper  number
47 -- @param shift bits to shift 
48 -- @return number
49
50 --- Integer division of 2 or more numbers.
51 -- @class function
52 -- @name div
53 -- @param oper1 Operand 1
54 -- @param oper2 Operand 2
55 -- @param ... More Operands
56 -- @return number
57
58 --- Cast a number to the bit-operating range.
59 -- @class function
60 -- @name cast
61 -- @param oper  number
62 -- @return number
63
64 --- Sets one or more flags of a bitfield.
65 -- @class function
66 -- @name set
67 -- @param bitfield      Bitfield
68 -- @param flag1 First Flag
69 -- @param ...   More Flags
70 -- @return altered bitfield
71
72 --- Unsets one or more flags of a bitfield.
73 -- @class function
74 -- @name unset
75 -- @param bitfield      Bitfield
76 -- @param flag1 First Flag
77 -- @param ...   More Flags
78 -- @return altered bitfield
79
80 --- Checks whether given flags are set in a bitfield.
81 -- @class function
82 -- @name check
83 -- @param bitfield      Bitfield
84 -- @param flag1 First Flag
85 -- @param ...   More Flags
86 -- @return true when all flags are set, otherwise false