nixio.bit.html 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744
  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. <body>
  10. <div id="container">
  11. <div id="product">
  12. <div id="product_logo"></div>
  13. <div id="product_name"><big><b></b></big></div>
  14. <div id="product_description"></div>
  15. </div> <!-- id="product" -->
  16. <div id="main">
  17. <div id="navigation">
  18. <h1>LuaDoc</h1>
  19. <ul>
  20. <li><a href="../index.html">Index</a></li>
  21. </ul>
  22. <!-- Module list -->
  23. <h1>Modules</h1>
  24. <ul>
  25. <li>
  26. <a href="../modules/luci.dispatcher.html">luci.dispatcher</a>
  27. </li>
  28. <li>
  29. <a href="../modules/luci.http.html">luci.http</a>
  30. </li>
  31. <li>
  32. <a href="../modules/luci.http.conditionals.html">luci.http.conditionals</a>
  33. </li>
  34. <li>
  35. <a href="../modules/luci.http.date.html">luci.http.date</a>
  36. </li>
  37. <li>
  38. <a href="../modules/luci.http.mime.html">luci.http.mime</a>
  39. </li>
  40. <li>
  41. <a href="../modules/luci.i18n.html">luci.i18n</a>
  42. </li>
  43. <li>
  44. <a href="../modules/luci.ip.html">luci.ip</a>
  45. </li>
  46. <li>
  47. <a href="../modules/luci.ip.cidr.html">luci.ip.cidr</a>
  48. </li>
  49. <li>
  50. <a href="../modules/luci.json.html">luci.json</a>
  51. </li>
  52. <li>
  53. <a href="../modules/luci.jsonc.html">luci.jsonc</a>
  54. </li>
  55. <li>
  56. <a href="../modules/luci.jsonc.parser.html">luci.jsonc.parser</a>
  57. </li>
  58. <li>
  59. <a href="../modules/luci.model.ipkg.html">luci.model.ipkg</a>
  60. </li>
  61. <li>
  62. <a href="../modules/luci.model.uci.html">luci.model.uci</a>
  63. </li>
  64. <li>
  65. <a href="../modules/luci.rpcc.html">luci.rpcc</a>
  66. </li>
  67. <li>
  68. <a href="../modules/luci.rpcc.ruci.html">luci.rpcc.ruci</a>
  69. </li>
  70. <li>
  71. <a href="../modules/luci.sys.html">luci.sys</a>
  72. </li>
  73. <li>
  74. <a href="../modules/luci.sys.init.html">luci.sys.init</a>
  75. </li>
  76. <li>
  77. <a href="../modules/luci.sys.iptparser.html">luci.sys.iptparser</a>
  78. </li>
  79. <li>
  80. <a href="../modules/luci.sys.net.html">luci.sys.net</a>
  81. </li>
  82. <li>
  83. <a href="../modules/luci.sys.process.html">luci.sys.process</a>
  84. </li>
  85. <li>
  86. <a href="../modules/luci.sys.user.html">luci.sys.user</a>
  87. </li>
  88. <li>
  89. <a href="../modules/luci.sys.wifi.html">luci.sys.wifi</a>
  90. </li>
  91. <li>
  92. <a href="../modules/luci.util.html">luci.util</a>
  93. </li>
  94. <li>
  95. <a href="../modules/luci.xml.html">luci.xml</a>
  96. </li>
  97. <li>
  98. <a href="../modules/nixio.html">nixio</a>
  99. </li>
  100. <li>
  101. <a href="../modules/nixio.CHANGELOG.html">nixio.CHANGELOG</a>
  102. </li>
  103. <li>
  104. <a href="../modules/nixio.CryptoHash.html">nixio.CryptoHash</a>
  105. </li>
  106. <li>
  107. <a href="../modules/nixio.File.html">nixio.File</a>
  108. </li>
  109. <li>
  110. <a href="../modules/nixio.README.html">nixio.README</a>
  111. </li>
  112. <li>
  113. <a href="../modules/nixio.Socket.html">nixio.Socket</a>
  114. </li>
  115. <li>
  116. <a href="../modules/nixio.TLSContext.html">nixio.TLSContext</a>
  117. </li>
  118. <li>
  119. <a href="../modules/nixio.TLSSocket.html">nixio.TLSSocket</a>
  120. </li>
  121. <li>
  122. <a href="../modules/nixio.UnifiedIO.html">nixio.UnifiedIO</a>
  123. </li>
  124. <li>
  125. <a href="../modules/nixio.bin.html">nixio.bin</a>
  126. </li>
  127. <li><strong>nixio.bit</strong></li>
  128. <li>
  129. <a href="../modules/nixio.crypto.html">nixio.crypto</a>
  130. </li>
  131. <li>
  132. <a href="../modules/nixio.fs.html">nixio.fs</a>
  133. </li>
  134. </ul>
  135. <!-- File list -->
  136. </div><!-- id="navigation" -->
  137. <div id="content">
  138. <h1>Class <code>nixio.bit</code></h1>
  139. <p>
  140. Bitfield operators and mainpulation functions.
  141. Can be used as a drop-in replacement for bitlib.</p>
  142. <h2>Functions</h2>
  143. <table class="function_list">
  144. <tr>
  145. <td class="name" nowrap><a href="#arshift">arshift</a>&nbsp;(oper, shift)</td>
  146. <td class="summary">
  147. Arithmetically right shift a number.</td>
  148. </tr>
  149. <tr>
  150. <td class="name" nowrap><a href="#band">band</a>&nbsp;(oper1, oper2, ...)</td>
  151. <td class="summary">
  152. Bitwise AND several numbers.</td>
  153. </tr>
  154. <tr>
  155. <td class="name" nowrap><a href="#bnot">bnot</a>&nbsp;(oper)</td>
  156. <td class="summary">
  157. Invert given number.</td>
  158. </tr>
  159. <tr>
  160. <td class="name" nowrap><a href="#bor">bor</a>&nbsp;(oper1, oper2, ...)</td>
  161. <td class="summary">
  162. Bitwise OR several numbers.</td>
  163. </tr>
  164. <tr>
  165. <td class="name" nowrap><a href="#bxor">bxor</a>&nbsp;(oper1, oper2, ...)</td>
  166. <td class="summary">
  167. Bitwise XOR several numbers.</td>
  168. </tr>
  169. <tr>
  170. <td class="name" nowrap><a href="#cast">cast</a>&nbsp;(oper)</td>
  171. <td class="summary">
  172. Cast a number to the bit-operating range.</td>
  173. </tr>
  174. <tr>
  175. <td class="name" nowrap><a href="#check">check</a>&nbsp;(bitfield, flag1, ...)</td>
  176. <td class="summary">
  177. Checks whether given flags are set in a bitfield.</td>
  178. </tr>
  179. <tr>
  180. <td class="name" nowrap><a href="#div">div</a>&nbsp;(oper1, oper2, ...)</td>
  181. <td class="summary">
  182. Integer division of 2 or more numbers.</td>
  183. </tr>
  184. <tr>
  185. <td class="name" nowrap><a href="#lshift">lshift</a>&nbsp;(oper, shift)</td>
  186. <td class="summary">
  187. Left shift a number.</td>
  188. </tr>
  189. <tr>
  190. <td class="name" nowrap><a href="#rshift">rshift</a>&nbsp;(oper, shift)</td>
  191. <td class="summary">
  192. Right shift a number.</td>
  193. </tr>
  194. <tr>
  195. <td class="name" nowrap><a href="#set">set</a>&nbsp;(bitfield, flag1, ...)</td>
  196. <td class="summary">
  197. Sets one or more flags of a bitfield.</td>
  198. </tr>
  199. <tr>
  200. <td class="name" nowrap><a href="#unset">unset</a>&nbsp;(bitfield, flag1, ...)</td>
  201. <td class="summary">
  202. Unsets one or more flags of a bitfield.</td>
  203. </tr>
  204. </table>
  205. <br/>
  206. <br/>
  207. <h2><a name="functions"></a>Functions</h2>
  208. <dl class="function">
  209. <dt><a name="arshift"></a><strong>arshift</strong>&nbsp;(oper, shift)</dt>
  210. <dd>
  211. Arithmetically right shift a number.
  212. <h3>Parameters</h3>
  213. <ul>
  214. <li>
  215. oper: number
  216. </li>
  217. <li>
  218. shift: bits to shift
  219. </li>
  220. </ul>
  221. <h3>Return value:</h3>
  222. number
  223. </dd>
  224. <dt><a name="band"></a><strong>band</strong>&nbsp;(oper1, oper2, ...)</dt>
  225. <dd>
  226. Bitwise AND several numbers.
  227. <h3>Parameters</h3>
  228. <ul>
  229. <li>
  230. oper1: First Operand
  231. </li>
  232. <li>
  233. oper2: Second Operand
  234. </li>
  235. <li>
  236. ...: More Operands
  237. </li>
  238. </ul>
  239. <h3>Return value:</h3>
  240. number
  241. </dd>
  242. <dt><a name="bnot"></a><strong>bnot</strong>&nbsp;(oper)</dt>
  243. <dd>
  244. Invert given number.
  245. <h3>Parameters</h3>
  246. <ul>
  247. <li>
  248. oper: Operand
  249. </li>
  250. </ul>
  251. <h3>Return value:</h3>
  252. number
  253. </dd>
  254. <dt><a name="bor"></a><strong>bor</strong>&nbsp;(oper1, oper2, ...)</dt>
  255. <dd>
  256. Bitwise OR several numbers.
  257. <h3>Parameters</h3>
  258. <ul>
  259. <li>
  260. oper1: First Operand
  261. </li>
  262. <li>
  263. oper2: Second Operand
  264. </li>
  265. <li>
  266. ...: More Operands
  267. </li>
  268. </ul>
  269. <h3>Return value:</h3>
  270. number
  271. </dd>
  272. <dt><a name="bxor"></a><strong>bxor</strong>&nbsp;(oper1, oper2, ...)</dt>
  273. <dd>
  274. Bitwise XOR several numbers.
  275. <h3>Parameters</h3>
  276. <ul>
  277. <li>
  278. oper1: First Operand
  279. </li>
  280. <li>
  281. oper2: Second Operand
  282. </li>
  283. <li>
  284. ...: More Operands
  285. </li>
  286. </ul>
  287. <h3>Return value:</h3>
  288. number
  289. </dd>
  290. <dt><a name="cast"></a><strong>cast</strong>&nbsp;(oper)</dt>
  291. <dd>
  292. Cast a number to the bit-operating range.
  293. <h3>Parameters</h3>
  294. <ul>
  295. <li>
  296. oper: number
  297. </li>
  298. </ul>
  299. <h3>Return value:</h3>
  300. number
  301. </dd>
  302. <dt><a name="check"></a><strong>check</strong>&nbsp;(bitfield, flag1, ...)</dt>
  303. <dd>
  304. Checks whether given flags are set in a bitfield.
  305. <h3>Parameters</h3>
  306. <ul>
  307. <li>
  308. bitfield: Bitfield
  309. </li>
  310. <li>
  311. flag1: First Flag
  312. </li>
  313. <li>
  314. ...: More Flags
  315. </li>
  316. </ul>
  317. <h3>Return value:</h3>
  318. true when all flags are set, otherwise false
  319. </dd>
  320. <dt><a name="div"></a><strong>div</strong>&nbsp;(oper1, oper2, ...)</dt>
  321. <dd>
  322. Integer division of 2 or more numbers.
  323. <h3>Parameters</h3>
  324. <ul>
  325. <li>
  326. oper1: Operand 1
  327. </li>
  328. <li>
  329. oper2: Operand 2
  330. </li>
  331. <li>
  332. ...: More Operands
  333. </li>
  334. </ul>
  335. <h3>Return value:</h3>
  336. number
  337. </dd>
  338. <dt><a name="lshift"></a><strong>lshift</strong>&nbsp;(oper, shift)</dt>
  339. <dd>
  340. Left shift a number.
  341. <h3>Parameters</h3>
  342. <ul>
  343. <li>
  344. oper: number
  345. </li>
  346. <li>
  347. shift: bits to shift
  348. </li>
  349. </ul>
  350. <h3>Return value:</h3>
  351. number
  352. </dd>
  353. <dt><a name="rshift"></a><strong>rshift</strong>&nbsp;(oper, shift)</dt>
  354. <dd>
  355. Right shift a number.
  356. <h3>Parameters</h3>
  357. <ul>
  358. <li>
  359. oper: number
  360. </li>
  361. <li>
  362. shift: bits to shift
  363. </li>
  364. </ul>
  365. <h3>Return value:</h3>
  366. number
  367. </dd>
  368. <dt><a name="set"></a><strong>set</strong>&nbsp;(bitfield, flag1, ...)</dt>
  369. <dd>
  370. Sets one or more flags of a bitfield.
  371. <h3>Parameters</h3>
  372. <ul>
  373. <li>
  374. bitfield: Bitfield
  375. </li>
  376. <li>
  377. flag1: First Flag
  378. </li>
  379. <li>
  380. ...: More Flags
  381. </li>
  382. </ul>
  383. <h3>Return value:</h3>
  384. altered bitfield
  385. </dd>
  386. <dt><a name="unset"></a><strong>unset</strong>&nbsp;(bitfield, flag1, ...)</dt>
  387. <dd>
  388. Unsets one or more flags of a bitfield.
  389. <h3>Parameters</h3>
  390. <ul>
  391. <li>
  392. bitfield: Bitfield
  393. </li>
  394. <li>
  395. flag1: First Flag
  396. </li>
  397. <li>
  398. ...: More Flags
  399. </li>
  400. </ul>
  401. <h3>Return value:</h3>
  402. altered bitfield
  403. </dd>
  404. </dl>
  405. </div> <!-- id="content" -->
  406. </div> <!-- id="main" -->
  407. <div id="about">
  408. <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>
  409. </div> <!-- id="about" -->
  410. </div> <!-- id="container" -->
  411. </body>
  412. </html>