Fix module lines in several luadoc files
[project/luci.git] / doc / modules / nixio.bit.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html>
4 <head>
5     <title>Reference</title>
6     <link rel="stylesheet" href="../luadoc.css" type="text/css" />
7         <!--meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/-->
8 </head>
9
10 <body>
11 <div id="container">
12
13 <div id="product">
14         <div id="product_logo"></div>
15         <div id="product_name"><big><b></b></big></div>
16         <div id="product_description"></div>
17 </div> <!-- id="product" -->
18
19 <div id="main">
20
21 <div id="navigation">
22
23
24 <h1>LuaDoc</h1>
25 <ul>
26         
27         <li><a href="../index.html">Index</a></li>
28         
29 </ul>
30
31
32 <!-- Module list -->
33
34 <h1>Modules</h1>
35 <ul>
36
37         <li>
38                 <a href="../modules/luci.dispatcher.html">luci.dispatcher</a>
39         </li>
40
41         <li>
42                 <a href="../modules/luci.http.protocol.html">luci.http.protocol</a>
43         </li>
44
45         <li>
46                 <a href="../modules/luci.http.protocol.conditionals.html">luci.http.protocol.conditionals</a>
47         </li>
48
49         <li>
50                 <a href="../modules/luci.http.protocol.date.html">luci.http.protocol.date</a>
51         </li>
52
53         <li>
54                 <a href="../modules/luci.http.protocol.mime.html">luci.http.protocol.mime</a>
55         </li>
56
57         <li>
58                 <a href="../modules/luci.i18n.html">luci.i18n</a>
59         </li>
60
61         <li>
62                 <a href="../modules/luci.ip.html">luci.ip</a>
63         </li>
64
65         <li>
66                 <a href="../modules/luci.ip.cidr.html">luci.ip.cidr</a>
67         </li>
68
69         <li>
70                 <a href="../modules/luci.jsonc.html">luci.jsonc</a>
71         </li>
72
73         <li>
74                 <a href="../modules/luci.jsonc.parser.html">luci.jsonc.parser</a>
75         </li>
76
77         <li>
78                 <a href="../modules/luci.sys.init.html">luci.sys.init</a>
79         </li>
80
81         <li>
82                 <a href="../modules/luci.sys.iptparser.html">luci.sys.iptparser</a>
83         </li>
84
85         <li>
86                 <a href="../modules/luci.sys.net.html">luci.sys.net</a>
87         </li>
88
89         <li>
90                 <a href="../modules/luci.sys.process.html">luci.sys.process</a>
91         </li>
92
93         <li>
94                 <a href="../modules/luci.sys.user.html">luci.sys.user</a>
95         </li>
96
97         <li>
98                 <a href="../modules/luci.sys.wifi.html">luci.sys.wifi</a>
99         </li>
100
101         <li>
102                 <a href="../modules/nixio.html">nixio</a>
103         </li>
104
105         <li>
106                 <a href="../modules/nixio.CHANGELOG.html">nixio.CHANGELOG</a>
107         </li>
108
109         <li>
110                 <a href="../modules/nixio.CryptoHash.html">nixio.CryptoHash</a>
111         </li>
112
113         <li>
114                 <a href="../modules/nixio.File.html">nixio.File</a>
115         </li>
116
117         <li>
118                 <a href="../modules/nixio.README.html">nixio.README</a>
119         </li>
120
121         <li>
122                 <a href="../modules/nixio.Socket.html">nixio.Socket</a>
123         </li>
124
125         <li>
126                 <a href="../modules/nixio.TLSContext.html">nixio.TLSContext</a>
127         </li>
128
129         <li>
130                 <a href="../modules/nixio.TLSSocket.html">nixio.TLSSocket</a>
131         </li>
132
133         <li>
134                 <a href="../modules/nixio.UnifiedIO.html">nixio.UnifiedIO</a>
135         </li>
136
137         <li>
138                 <a href="../modules/nixio.bin.html">nixio.bin</a>
139         </li>
140
141         <li><strong>nixio.bit</strong></li>
142         
143         <li>
144                 <a href="../modules/nixio.crypto.html">nixio.crypto</a>
145         </li>
146
147         <li>
148                 <a href="../modules/nixio.fs.html">nixio.fs</a>
149         </li>
150
151 </ul>
152
153
154
155 <!-- File list -->
156
157
158
159
160
161
162
163 </div><!-- id="navigation" -->
164
165 <div id="content">
166
167 <h1>Class <code>nixio.bit</code></h1>
168
169 <p>
170  Bitfield operators and mainpulation functions. 
171  Can be used as a drop-in replacement for bitlib.</p>
172
173
174
175
176
177
178
179 <h2>Functions</h2>
180 <table class="function_list">
181
182         <tr>
183         <td class="name" nowrap><a href="#arshift">arshift</a>&nbsp;(oper, shift)</td>
184         <td class="summary">
185  Arithmetically right shift a number.</td>
186         </tr>
187
188         <tr>
189         <td class="name" nowrap><a href="#band">band</a>&nbsp;(oper1, oper2, ...)</td>
190         <td class="summary">
191  Bitwise AND several numbers.</td>
192         </tr>
193
194         <tr>
195         <td class="name" nowrap><a href="#bnot">bnot</a>&nbsp;(oper)</td>
196         <td class="summary">
197  Invert given number.</td>
198         </tr>
199
200         <tr>
201         <td class="name" nowrap><a href="#bor">bor</a>&nbsp;(oper1, oper2, ...)</td>
202         <td class="summary">
203  Bitwise OR several numbers.</td>
204         </tr>
205
206         <tr>
207         <td class="name" nowrap><a href="#bxor">bxor</a>&nbsp;(oper1, oper2, ...)</td>
208         <td class="summary">
209  Bitwise XOR several numbers.</td>
210         </tr>
211
212         <tr>
213         <td class="name" nowrap><a href="#cast">cast</a>&nbsp;(oper)</td>
214         <td class="summary">
215  Cast a number to the bit-operating range.</td>
216         </tr>
217
218         <tr>
219         <td class="name" nowrap><a href="#check">check</a>&nbsp;(bitfield, flag1, ...)</td>
220         <td class="summary">
221  Checks whether given flags are set in a bitfield.</td>
222         </tr>
223
224         <tr>
225         <td class="name" nowrap><a href="#div">div</a>&nbsp;(oper1, oper2, ...)</td>
226         <td class="summary">
227  Integer division of 2 or more numbers.</td>
228         </tr>
229
230         <tr>
231         <td class="name" nowrap><a href="#lshift">lshift</a>&nbsp;(oper, shift)</td>
232         <td class="summary">
233  Left shift a number.</td>
234         </tr>
235
236         <tr>
237         <td class="name" nowrap><a href="#rshift">rshift</a>&nbsp;(oper, shift)</td>
238         <td class="summary">
239  Right shift a number.</td>
240         </tr>
241
242         <tr>
243         <td class="name" nowrap><a href="#set">set</a>&nbsp;(bitfield, flag1, ...)</td>
244         <td class="summary">
245  Sets one or more flags of a bitfield.</td>
246         </tr>
247
248         <tr>
249         <td class="name" nowrap><a href="#unset">unset</a>&nbsp;(bitfield, flag1, ...)</td>
250         <td class="summary">
251  Unsets one or more flags of a bitfield.</td>
252         </tr>
253
254 </table>
255
256
257
258
259
260
261 <br/>
262 <br/>
263
264
265 <h2><a name="functions"></a>Functions</h2>
266 <dl class="function">
267
268
269
270 <dt><a name="arshift"></a><strong>arshift</strong>&nbsp;(oper, shift)</dt>
271 <dd>
272
273  Arithmetically right shift a number.
274
275
276 <h3>Parameters</h3>
277 <ul>
278         
279         <li>
280           oper: number
281         </li>
282         
283         <li>
284           shift: bits to shift 
285         </li>
286         
287 </ul>
288
289
290
291
292
293
294 <h3>Return value:</h3>
295 number
296
297
298
299 </dd>
300
301
302
303
304 <dt><a name="band"></a><strong>band</strong>&nbsp;(oper1, oper2, ...)</dt>
305 <dd>
306
307  Bitwise AND several numbers.
308
309
310 <h3>Parameters</h3>
311 <ul>
312         
313         <li>
314           oper1: First Operand
315         </li>
316         
317         <li>
318           oper2: Second Operand
319         </li>
320         
321         <li>
322           ...: More Operands
323         </li>
324         
325 </ul>
326
327
328
329
330
331
332 <h3>Return value:</h3>
333 number
334
335
336
337 </dd>
338
339
340
341
342 <dt><a name="bnot"></a><strong>bnot</strong>&nbsp;(oper)</dt>
343 <dd>
344
345  Invert given number.
346
347
348 <h3>Parameters</h3>
349 <ul>
350         
351         <li>
352           oper: Operand
353         </li>
354         
355 </ul>
356
357
358
359
360
361
362 <h3>Return value:</h3>
363 number
364
365
366
367 </dd>
368
369
370
371
372 <dt><a name="bor"></a><strong>bor</strong>&nbsp;(oper1, oper2, ...)</dt>
373 <dd>
374
375  Bitwise OR several numbers.
376
377
378 <h3>Parameters</h3>
379 <ul>
380         
381         <li>
382           oper1: First Operand
383         </li>
384         
385         <li>
386           oper2: Second Operand
387         </li>
388         
389         <li>
390           ...: More Operands
391         </li>
392         
393 </ul>
394
395
396
397
398
399
400 <h3>Return value:</h3>
401 number
402
403
404
405 </dd>
406
407
408
409
410 <dt><a name="bxor"></a><strong>bxor</strong>&nbsp;(oper1, oper2, ...)</dt>
411 <dd>
412
413  Bitwise XOR several numbers.
414
415
416 <h3>Parameters</h3>
417 <ul>
418         
419         <li>
420           oper1: First Operand
421         </li>
422         
423         <li>
424           oper2: Second Operand
425         </li>
426         
427         <li>
428           ...: More Operands
429         </li>
430         
431 </ul>
432
433
434
435
436
437
438 <h3>Return value:</h3>
439 number
440
441
442
443 </dd>
444
445
446
447
448 <dt><a name="cast"></a><strong>cast</strong>&nbsp;(oper)</dt>
449 <dd>
450
451  Cast a number to the bit-operating range.
452
453
454 <h3>Parameters</h3>
455 <ul>
456         
457         <li>
458           oper: number
459         </li>
460         
461 </ul>
462
463
464
465
466
467
468 <h3>Return value:</h3>
469 number
470
471
472
473 </dd>
474
475
476
477
478 <dt><a name="check"></a><strong>check</strong>&nbsp;(bitfield, flag1, ...)</dt>
479 <dd>
480
481  Checks whether given flags are set in a bitfield.
482
483
484 <h3>Parameters</h3>
485 <ul>
486         
487         <li>
488           bitfield: Bitfield
489         </li>
490         
491         <li>
492           flag1: First Flag
493         </li>
494         
495         <li>
496           ...: More Flags
497         </li>
498         
499 </ul>
500
501
502
503
504
505
506 <h3>Return value:</h3>
507 true when all flags are set, otherwise false
508
509
510
511 </dd>
512
513
514
515
516 <dt><a name="div"></a><strong>div</strong>&nbsp;(oper1, oper2, ...)</dt>
517 <dd>
518
519  Integer division of 2 or more numbers.
520
521
522 <h3>Parameters</h3>
523 <ul>
524         
525         <li>
526           oper1: Operand 1
527         </li>
528         
529         <li>
530           oper2: Operand 2
531         </li>
532         
533         <li>
534           ...: More Operands
535         </li>
536         
537 </ul>
538
539
540
541
542
543
544 <h3>Return value:</h3>
545 number
546
547
548
549 </dd>
550
551
552
553
554 <dt><a name="lshift"></a><strong>lshift</strong>&nbsp;(oper, shift)</dt>
555 <dd>
556
557  Left shift a number.
558
559
560 <h3>Parameters</h3>
561 <ul>
562         
563         <li>
564           oper: number
565         </li>
566         
567         <li>
568           shift: bits to shift 
569         </li>
570         
571 </ul>
572
573
574
575
576
577
578 <h3>Return value:</h3>
579 number
580
581
582
583 </dd>
584
585
586
587
588 <dt><a name="rshift"></a><strong>rshift</strong>&nbsp;(oper, shift)</dt>
589 <dd>
590
591  Right shift a number.
592
593
594 <h3>Parameters</h3>
595 <ul>
596         
597         <li>
598           oper: number
599         </li>
600         
601         <li>
602           shift: bits to shift 
603         </li>
604         
605 </ul>
606
607
608
609
610
611
612 <h3>Return value:</h3>
613 number
614
615
616
617 </dd>
618
619
620
621
622 <dt><a name="set"></a><strong>set</strong>&nbsp;(bitfield, flag1, ...)</dt>
623 <dd>
624
625  Sets one or more flags of a bitfield.
626
627
628 <h3>Parameters</h3>
629 <ul>
630         
631         <li>
632           bitfield: Bitfield
633         </li>
634         
635         <li>
636           flag1: First Flag
637         </li>
638         
639         <li>
640           ...: More Flags
641         </li>
642         
643 </ul>
644
645
646
647
648
649
650 <h3>Return value:</h3>
651 altered bitfield
652
653
654
655 </dd>
656
657
658
659
660 <dt><a name="unset"></a><strong>unset</strong>&nbsp;(bitfield, flag1, ...)</dt>
661 <dd>
662
663  Unsets one or more flags of a bitfield.
664
665
666 <h3>Parameters</h3>
667 <ul>
668         
669         <li>
670           bitfield: Bitfield
671         </li>
672         
673         <li>
674           flag1: First Flag
675         </li>
676         
677         <li>
678           ...: More Flags
679         </li>
680         
681 </ul>
682
683
684
685
686
687
688 <h3>Return value:</h3>
689 altered bitfield
690
691
692
693 </dd>
694
695
696 </dl>
697
698
699
700
701
702 </div> <!-- id="content" -->
703
704 </div> <!-- id="main" -->
705
706 <div id="about">
707         <p><a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0!" height="31" width="88" /></a></p>
708 </div> <!-- id="about" -->
709
710 </div> <!-- id="container" -->
711 </body>
712 </html>