You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

715 lines
20 KiB

  1. // Copyright (c) 2006, ComponentAce
  2. // http://www.componentace.com
  3. // All rights reserved.
  4. // Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
  5. // Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  6. // Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  7. // Neither the name of ComponentAce nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
  8. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  9. /*
  10. Copyright (c) 2000,2001,2002,2003 ymnk, JCraft,Inc. All rights reserved.
  11. Redistribution and use in source and binary forms, with or without
  12. modification, are permitted provided that the following conditions are met:
  13. 1. Redistributions of source code must retain the above copyright notice,
  14. this list of conditions and the following disclaimer.
  15. 2. Redistributions in binary form must reproduce the above copyright
  16. notice, this list of conditions and the following disclaimer in
  17. the documentation and/or other materials provided with the distribution.
  18. 3. The names of the authors may not be used to endorse or promote products
  19. derived from this software without specific prior written permission.
  20. THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
  21. INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  22. FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
  23. INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
  24. INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  25. LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
  26. OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  27. LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  28. NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
  29. EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  30. */
  31. /*
  32. * This program is based on zlib-1.1.3, so all credit should go authors
  33. * Jean-loup Gailly(jloup@gzip.org) and Mark Adler(madler@alumni.caltech.edu)
  34. * and contributors of zlib.
  35. */
  36. using System;
  37. namespace zlib
  38. {
  39. sealed class InfCodes
  40. {
  41. private static readonly int[] inflate_mask = new int[]{0x00000000, 0x00000001, 0x00000003, 0x00000007, 0x0000000f, 0x0000001f, 0x0000003f, 0x0000007f, 0x000000ff, 0x000001ff, 0x000003ff, 0x000007ff, 0x00000fff, 0x00001fff, 0x00003fff, 0x00007fff, 0x0000ffff};
  42. private const int Z_OK = 0;
  43. private const int Z_STREAM_END = 1;
  44. private const int Z_NEED_DICT = 2;
  45. private const int Z_ERRNO = - 1;
  46. private const int Z_STREAM_ERROR = - 2;
  47. private const int Z_DATA_ERROR = - 3;
  48. private const int Z_MEM_ERROR = - 4;
  49. private const int Z_BUF_ERROR = - 5;
  50. private const int Z_VERSION_ERROR = - 6;
  51. // waiting for "i:"=input,
  52. // "o:"=output,
  53. // "x:"=nothing
  54. private const int START = 0; // x: set up for LEN
  55. private const int LEN = 1; // i: get length/literal/eob next
  56. private const int LENEXT = 2; // i: getting length extra (have base)
  57. private const int DIST = 3; // i: get distance next
  58. private const int DISTEXT = 4; // i: getting distance extra
  59. private const int COPY = 5; // o: copying bytes in window, waiting for space
  60. private const int LIT = 6; // o: got literal, waiting for output space
  61. private const int WASH = 7; // o: got eob, possibly still output waiting
  62. private const int END = 8; // x: got eob and all data flushed
  63. private const int BADCODE = 9; // x: got error
  64. internal int mode; // current inflate_codes mode
  65. // mode dependent information
  66. internal int len;
  67. internal int[] tree; // pointer into tree
  68. internal int tree_index = 0;
  69. internal int need; // bits needed
  70. internal int lit;
  71. // if EXT or COPY, where and how much
  72. internal int get_Renamed; // bits to get for extra
  73. internal int dist; // distance back to copy from
  74. internal byte lbits; // ltree bits decoded per branch
  75. internal byte dbits; // dtree bits decoder per branch
  76. internal int[] ltree; // literal/length/eob tree
  77. internal int ltree_index; // literal/length/eob tree
  78. internal int[] dtree; // distance tree
  79. internal int dtree_index; // distance tree
  80. internal InfCodes(int bl, int bd, int[] tl, int tl_index, int[] td, int td_index, ZStream z)
  81. {
  82. mode = START;
  83. lbits = (byte) bl;
  84. dbits = (byte) bd;
  85. ltree = tl;
  86. ltree_index = tl_index;
  87. dtree = td;
  88. dtree_index = td_index;
  89. }
  90. internal InfCodes(int bl, int bd, int[] tl, int[] td, ZStream z)
  91. {
  92. mode = START;
  93. lbits = (byte) bl;
  94. dbits = (byte) bd;
  95. ltree = tl;
  96. ltree_index = 0;
  97. dtree = td;
  98. dtree_index = 0;
  99. }
  100. internal int proc(InfBlocks s, ZStream z, int r)
  101. {
  102. int j; // temporary storage
  103. //int[] t; // temporary pointer
  104. int tindex; // temporary pointer
  105. int e; // extra bits or operation
  106. int b = 0; // bit buffer
  107. int k = 0; // bits in bit buffer
  108. int p = 0; // input data pointer
  109. int n; // bytes available there
  110. int q; // output window write pointer
  111. int m; // bytes to end of window or read pointer
  112. int f; // pointer to copy strings from
  113. // copy input/output information to locals (UPDATE macro restores)
  114. p = z.next_in_index; n = z.avail_in; b = s.bitb; k = s.bitk;
  115. q = s.write; m = q < s.read?s.read - q - 1:s.end - q;
  116. // process input and output based on current state
  117. while (true)
  118. {
  119. switch (mode)
  120. {
  121. // waiting for "i:"=input, "o:"=output, "x:"=nothing
  122. case START: // x: set up for LEN
  123. if (m >= 258 && n >= 10)
  124. {
  125. s.bitb = b; s.bitk = k;
  126. z.avail_in = n; z.total_in += p - z.next_in_index; z.next_in_index = p;
  127. s.write = q;
  128. r = inflate_fast(lbits, dbits, ltree, ltree_index, dtree, dtree_index, s, z);
  129. p = z.next_in_index; n = z.avail_in; b = s.bitb; k = s.bitk;
  130. q = s.write; m = q < s.read?s.read - q - 1:s.end - q;
  131. if (r != Z_OK)
  132. {
  133. mode = r == Z_STREAM_END?WASH:BADCODE;
  134. break;
  135. }
  136. }
  137. need = lbits;
  138. tree = ltree;
  139. tree_index = ltree_index;
  140. mode = LEN;
  141. goto case LEN;
  142. case LEN: // i: get length/literal/eob next
  143. j = need;
  144. while (k < (j))
  145. {
  146. if (n != 0)
  147. r = Z_OK;
  148. else
  149. {
  150. s.bitb = b; s.bitk = k;
  151. z.avail_in = n; z.total_in += p - z.next_in_index; z.next_in_index = p;
  152. s.write = q;
  153. return s.inflate_flush(z, r);
  154. }
  155. n--;
  156. b |= (z.next_in[p++] & 0xff) << k;
  157. k += 8;
  158. }
  159. tindex = (tree_index + (b & inflate_mask[j])) * 3;
  160. b = SupportClass.URShift(b, (tree[tindex + 1]));
  161. k -= (tree[tindex + 1]);
  162. e = tree[tindex];
  163. if (e == 0)
  164. {
  165. // literal
  166. lit = tree[tindex + 2];
  167. mode = LIT;
  168. break;
  169. }
  170. if ((e & 16) != 0)
  171. {
  172. // length
  173. get_Renamed = e & 15;
  174. len = tree[tindex + 2];
  175. mode = LENEXT;
  176. break;
  177. }
  178. if ((e & 64) == 0)
  179. {
  180. // next table
  181. need = e;
  182. tree_index = tindex / 3 + tree[tindex + 2];
  183. break;
  184. }
  185. if ((e & 32) != 0)
  186. {
  187. // end of block
  188. mode = WASH;
  189. break;
  190. }
  191. mode = BADCODE; // invalid code
  192. z.msg = "invalid literal/length code";
  193. r = Z_DATA_ERROR;
  194. s.bitb = b; s.bitk = k;
  195. z.avail_in = n; z.total_in += p - z.next_in_index; z.next_in_index = p;
  196. s.write = q;
  197. return s.inflate_flush(z, r);
  198. case LENEXT: // i: getting length extra (have base)
  199. j = get_Renamed;
  200. while (k < (j))
  201. {
  202. if (n != 0)
  203. r = Z_OK;
  204. else
  205. {
  206. s.bitb = b; s.bitk = k;
  207. z.avail_in = n; z.total_in += p - z.next_in_index; z.next_in_index = p;
  208. s.write = q;
  209. return s.inflate_flush(z, r);
  210. }
  211. n--; b |= (z.next_in[p++] & 0xff) << k;
  212. k += 8;
  213. }
  214. len += (b & inflate_mask[j]);
  215. b >>= j;
  216. k -= j;
  217. need = dbits;
  218. tree = dtree;
  219. tree_index = dtree_index;
  220. mode = DIST;
  221. goto case DIST;
  222. case DIST: // i: get distance next
  223. j = need;
  224. while (k < (j))
  225. {
  226. if (n != 0)
  227. r = Z_OK;
  228. else
  229. {
  230. s.bitb = b; s.bitk = k;
  231. z.avail_in = n; z.total_in += p - z.next_in_index; z.next_in_index = p;
  232. s.write = q;
  233. return s.inflate_flush(z, r);
  234. }
  235. n--; b |= (z.next_in[p++] & 0xff) << k;
  236. k += 8;
  237. }
  238. tindex = (tree_index + (b & inflate_mask[j])) * 3;
  239. b >>= tree[tindex + 1];
  240. k -= tree[tindex + 1];
  241. e = (tree[tindex]);
  242. if ((e & 16) != 0)
  243. {
  244. // distance
  245. get_Renamed = e & 15;
  246. dist = tree[tindex + 2];
  247. mode = DISTEXT;
  248. break;
  249. }
  250. if ((e & 64) == 0)
  251. {
  252. // next table
  253. need = e;
  254. tree_index = tindex / 3 + tree[tindex + 2];
  255. break;
  256. }
  257. mode = BADCODE; // invalid code
  258. z.msg = "invalid distance code";
  259. r = Z_DATA_ERROR;
  260. s.bitb = b; s.bitk = k;
  261. z.avail_in = n; z.total_in += p - z.next_in_index; z.next_in_index = p;
  262. s.write = q;
  263. return s.inflate_flush(z, r);
  264. case DISTEXT: // i: getting distance extra
  265. j = get_Renamed;
  266. while (k < (j))
  267. {
  268. if (n != 0)
  269. r = Z_OK;
  270. else
  271. {
  272. s.bitb = b; s.bitk = k;
  273. z.avail_in = n; z.total_in += p - z.next_in_index; z.next_in_index = p;
  274. s.write = q;
  275. return s.inflate_flush(z, r);
  276. }
  277. n--; b |= (z.next_in[p++] & 0xff) << k;
  278. k += 8;
  279. }
  280. dist += (b & inflate_mask[j]);
  281. b >>= j;
  282. k -= j;
  283. mode = COPY;
  284. goto case COPY;
  285. case COPY: // o: copying bytes in window, waiting for space
  286. f = q - dist;
  287. while (f < 0)
  288. {
  289. // modulo window size-"while" instead
  290. f += s.end; // of "if" handles invalid distances
  291. }
  292. while (len != 0)
  293. {
  294. if (m == 0)
  295. {
  296. if (q == s.end && s.read != 0)
  297. {
  298. q = 0; m = q < s.read?s.read - q - 1:s.end - q;
  299. }
  300. if (m == 0)
  301. {
  302. s.write = q; r = s.inflate_flush(z, r);
  303. q = s.write; m = q < s.read?s.read - q - 1:s.end - q;
  304. if (q == s.end && s.read != 0)
  305. {
  306. q = 0; m = q < s.read?s.read - q - 1:s.end - q;
  307. }
  308. if (m == 0)
  309. {
  310. s.bitb = b; s.bitk = k;
  311. z.avail_in = n; z.total_in += p - z.next_in_index; z.next_in_index = p;
  312. s.write = q;
  313. return s.inflate_flush(z, r);
  314. }
  315. }
  316. }
  317. s.window[q++] = s.window[f++]; m--;
  318. if (f == s.end)
  319. f = 0;
  320. len--;
  321. }
  322. mode = START;
  323. break;
  324. case LIT: // o: got literal, waiting for output space
  325. if (m == 0)
  326. {
  327. if (q == s.end && s.read != 0)
  328. {
  329. q = 0; m = q < s.read?s.read - q - 1:s.end - q;
  330. }
  331. if (m == 0)
  332. {
  333. s.write = q; r = s.inflate_flush(z, r);
  334. q = s.write; m = q < s.read?s.read - q - 1:s.end - q;
  335. if (q == s.end && s.read != 0)
  336. {
  337. q = 0; m = q < s.read?s.read - q - 1:s.end - q;
  338. }
  339. if (m == 0)
  340. {
  341. s.bitb = b; s.bitk = k;
  342. z.avail_in = n; z.total_in += p - z.next_in_index; z.next_in_index = p;
  343. s.write = q;
  344. return s.inflate_flush(z, r);
  345. }
  346. }
  347. }
  348. r = Z_OK;
  349. s.window[q++] = (byte) lit; m--;
  350. mode = START;
  351. break;
  352. case WASH: // o: got eob, possibly more output
  353. if (k > 7)
  354. {
  355. // return unused byte, if any
  356. k -= 8;
  357. n++;
  358. p--; // can always return one
  359. }
  360. s.write = q; r = s.inflate_flush(z, r);
  361. q = s.write; m = q < s.read?s.read - q - 1:s.end - q;
  362. if (s.read != s.write)
  363. {
  364. s.bitb = b; s.bitk = k;
  365. z.avail_in = n; z.total_in += p - z.next_in_index; z.next_in_index = p;
  366. s.write = q;
  367. return s.inflate_flush(z, r);
  368. }
  369. mode = END;
  370. goto case END;
  371. case END:
  372. r = Z_STREAM_END;
  373. s.bitb = b; s.bitk = k;
  374. z.avail_in = n; z.total_in += p - z.next_in_index; z.next_in_index = p;
  375. s.write = q;
  376. return s.inflate_flush(z, r);
  377. case BADCODE: // x: got error
  378. r = Z_DATA_ERROR;
  379. s.bitb = b; s.bitk = k;
  380. z.avail_in = n; z.total_in += p - z.next_in_index; z.next_in_index = p;
  381. s.write = q;
  382. return s.inflate_flush(z, r);
  383. default:
  384. r = Z_STREAM_ERROR;
  385. s.bitb = b; s.bitk = k;
  386. z.avail_in = n; z.total_in += p - z.next_in_index; z.next_in_index = p;
  387. s.write = q;
  388. return s.inflate_flush(z, r);
  389. }
  390. }
  391. }
  392. internal void free(ZStream z)
  393. {
  394. // ZFREE(z, c);
  395. }
  396. // Called with number of bytes left to write in window at least 258
  397. // (the maximum string length) and number of input bytes available
  398. // at least ten. The ten bytes are six bytes for the longest length/
  399. // distance pair plus four bytes for overloading the bit buffer.
  400. internal int inflate_fast(int bl, int bd, int[] tl, int tl_index, int[] td, int td_index, InfBlocks s, ZStream z)
  401. {
  402. int t; // temporary pointer
  403. int[] tp; // temporary pointer
  404. int tp_index; // temporary pointer
  405. int e; // extra bits or operation
  406. int b; // bit buffer
  407. int k; // bits in bit buffer
  408. int p; // input data pointer
  409. int n; // bytes available there
  410. int q; // output window write pointer
  411. int m; // bytes to end of window or read pointer
  412. int ml; // mask for literal/length tree
  413. int md; // mask for distance tree
  414. int c; // bytes to copy
  415. int d; // distance back to copy from
  416. int r; // copy source pointer
  417. // load input, output, bit values
  418. p = z.next_in_index; n = z.avail_in; b = s.bitb; k = s.bitk;
  419. q = s.write; m = q < s.read?s.read - q - 1:s.end - q;
  420. // initialize masks
  421. ml = inflate_mask[bl];
  422. md = inflate_mask[bd];
  423. // do until not enough input or output space for fast loop
  424. do
  425. {
  426. // assume called with m >= 258 && n >= 10
  427. // get literal/length code
  428. while (k < (20))
  429. {
  430. // max bits for literal/length code
  431. n--;
  432. b |= (z.next_in[p++] & 0xff) << k; k += 8;
  433. }
  434. t = b & ml;
  435. tp = tl;
  436. tp_index = tl_index;
  437. if ((e = tp[(tp_index + t) * 3]) == 0)
  438. {
  439. b >>= (tp[(tp_index + t) * 3 + 1]); k -= (tp[(tp_index + t) * 3 + 1]);
  440. s.window[q++] = (byte) tp[(tp_index + t) * 3 + 2];
  441. m--;
  442. continue;
  443. }
  444. do
  445. {
  446. b >>= (tp[(tp_index + t) * 3 + 1]); k -= (tp[(tp_index + t) * 3 + 1]);
  447. if ((e & 16) != 0)
  448. {
  449. e &= 15;
  450. c = tp[(tp_index + t) * 3 + 2] + ((int) b & inflate_mask[e]);
  451. b >>= e; k -= e;
  452. // decode distance base of block to copy
  453. while (k < (15))
  454. {
  455. // max bits for distance code
  456. n--;
  457. b |= (z.next_in[p++] & 0xff) << k; k += 8;
  458. }
  459. t = b & md;
  460. tp = td;
  461. tp_index = td_index;
  462. e = tp[(tp_index + t) * 3];
  463. do
  464. {
  465. b >>= (tp[(tp_index + t) * 3 + 1]); k -= (tp[(tp_index + t) * 3 + 1]);
  466. if ((e & 16) != 0)
  467. {
  468. // get extra bits to add to distance base
  469. e &= 15;
  470. while (k < (e))
  471. {
  472. // get extra bits (up to 13)
  473. n--;
  474. b |= (z.next_in[p++] & 0xff) << k; k += 8;
  475. }
  476. d = tp[(tp_index + t) * 3 + 2] + (b & inflate_mask[e]);
  477. b >>= (e); k -= (e);
  478. // do the copy
  479. m -= c;
  480. if (q >= d)
  481. {
  482. // offset before dest
  483. // just copy
  484. r = q - d;
  485. if (q - r > 0 && 2 > (q - r))
  486. {
  487. s.window[q++] = s.window[r++]; c--; // minimum count is three,
  488. s.window[q++] = s.window[r++]; c--; // so unroll loop a little
  489. }
  490. else
  491. {
  492. Array.Copy(s.window, r, s.window, q, 2);
  493. q += 2; r += 2; c -= 2;
  494. }
  495. }
  496. else
  497. {
  498. // else offset after destination
  499. r = q - d;
  500. do
  501. {
  502. r += s.end; // force pointer in window
  503. }
  504. while (r < 0); // covers invalid distances
  505. e = s.end - r;
  506. if (c > e)
  507. {
  508. // if source crosses,
  509. c -= e; // wrapped copy
  510. if (q - r > 0 && e > (q - r))
  511. {
  512. do
  513. {
  514. s.window[q++] = s.window[r++];
  515. }
  516. while (--e != 0);
  517. }
  518. else
  519. {
  520. Array.Copy(s.window, r, s.window, q, e);
  521. q += e; r += e; e = 0;
  522. }
  523. r = 0; // copy rest from start of window
  524. }
  525. }
  526. // copy all or what's left
  527. if (q - r > 0 && c > (q - r))
  528. {
  529. do
  530. {
  531. s.window[q++] = s.window[r++];
  532. }
  533. while (--c != 0);
  534. }
  535. else
  536. {
  537. Array.Copy(s.window, r, s.window, q, c);
  538. q += c; r += c; c = 0;
  539. }
  540. break;
  541. }
  542. else if ((e & 64) == 0)
  543. {
  544. t += tp[(tp_index + t) * 3 + 2];
  545. t += (b & inflate_mask[e]);
  546. e = tp[(tp_index + t) * 3];
  547. }
  548. else
  549. {
  550. z.msg = "invalid distance code";
  551. c = z.avail_in - n; c = (k >> 3) < c?k >> 3:c; n += c; p -= c; k -= (c << 3);
  552. s.bitb = b; s.bitk = k;
  553. z.avail_in = n; z.total_in += p - z.next_in_index; z.next_in_index = p;
  554. s.write = q;
  555. return Z_DATA_ERROR;
  556. }
  557. }
  558. while (true);
  559. break;
  560. }
  561. if ((e & 64) == 0)
  562. {
  563. t += tp[(tp_index + t) * 3 + 2];
  564. t += (b & inflate_mask[e]);
  565. if ((e = tp[(tp_index + t) * 3]) == 0)
  566. {
  567. b >>= (tp[(tp_index + t) * 3 + 1]); k -= (tp[(tp_index + t) * 3 + 1]);
  568. s.window[q++] = (byte) tp[(tp_index + t) * 3 + 2];
  569. m--;
  570. break;
  571. }
  572. }
  573. else if ((e & 32) != 0)
  574. {
  575. c = z.avail_in - n; c = (k >> 3) < c?k >> 3:c; n += c; p -= c; k -= (c << 3);
  576. s.bitb = b; s.bitk = k;
  577. z.avail_in = n; z.total_in += p - z.next_in_index; z.next_in_index = p;
  578. s.write = q;
  579. return Z_STREAM_END;
  580. }
  581. else
  582. {
  583. z.msg = "invalid literal/length code";
  584. c = z.avail_in - n; c = (k >> 3) < c?k >> 3:c; n += c; p -= c; k -= (c << 3);
  585. s.bitb = b; s.bitk = k;
  586. z.avail_in = n; z.total_in += p - z.next_in_index; z.next_in_index = p;
  587. s.write = q;
  588. return Z_DATA_ERROR;
  589. }
  590. }
  591. while (true);
  592. }
  593. while (m >= 258 && n >= 10);
  594. // not enough input or output--restore pointers and return
  595. c = z.avail_in - n; c = (k >> 3) < c?k >> 3:c; n += c; p -= c; k -= (c << 3);
  596. s.bitb = b; s.bitk = k;
  597. z.avail_in = n; z.total_in += p - z.next_in_index; z.next_in_index = p;
  598. s.write = q;
  599. return Z_OK;
  600. }
  601. }
  602. }