home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 March / CMCD0304.ISO / Software / Freeware / Programare / nullsoft / nsis20.exe / Source / bzip2 / bzlib.c < prev    next >
C/C++ Source or Header  |  2003-07-12  |  18KB  |  610 lines

  1. #include "bzlib.h"
  2.  
  3. #if (defined(NSIS_COMPRESS_USE_BZIP2) && defined(NSIS_CONFIG_COMPRESSION_SUPPORT)) || !defined(EXEHEAD)
  4. /*-------------------------------------------------------------*/
  5. /*--- Library top-level functions.                          ---*/
  6. /*---                                               bzlib.c ---*/
  7. /*-------------------------------------------------------------*/
  8.  
  9. /*--
  10.   This file is a part of bzip2 and/or libbzip2, a program and
  11.   library for lossless, block-sorting data compression.
  12.  
  13.   Copyright (C) 1996-2000 Julian R Seward.  All rights reserved.
  14.  
  15.   Redistribution and use in source and binary forms, with or without
  16.   modification, are permitted provided that the following conditions
  17.   are met:
  18.  
  19.   1. Redistributions of source code must retain the above copyright
  20.      notice, this list of conditions and the following disclaimer.
  21.  
  22.   2. The origin of this software must not be misrepresented; you must
  23.      not claim that you wrote the original software.  If you use this
  24.      software in a product, an acknowledgment in the product
  25.      documentation would be appreciated but is not required.
  26.  
  27.   3. Altered source versions must be plainly marked as such, and must
  28.      not be misrepresented as being the original software.
  29.  
  30.   4. The name of the author may not be used to endorse or promote
  31.      products derived from this software without specific prior written
  32.      permission.
  33.  
  34.   THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
  35.   OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  36.   WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  37.   ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
  38.   DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  39.   DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
  40.   GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  41.   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  42.   WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  43.   NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  44.   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  45.  
  46.   Julian Seward, Cambridge, UK.
  47.   jseward@acm.org
  48.   bzip2/libbzip2 version 1.0 of 21 March 2000
  49.  
  50.   This program is based on (at least) the work of:
  51.      Mike Burrows
  52.      David Wheeler
  53.      Peter Fenwick
  54.      Alistair Moffat
  55.      Radford Neal
  56.      Ian H. Witten
  57.      Robert Sedgewick
  58.      Jon L. Bentley
  59.  
  60.   For more information on these sources, see the manual.
  61. --*/
  62.  
  63. /*--
  64.    CHANGES
  65.    ~~~~~~~
  66.    0.9.0 -- original version.
  67.  
  68.    0.9.0a/b -- no changes in this file.
  69.  
  70.    0.9.0c
  71.       * made zero-length BZ_FLUSH work correctly in bzCompress().
  72.       * fixed bzWrite/bzRead to ignore zero-length requests.
  73.       * fixed bzread to correctly handle read requests after EOF.
  74.       * wrong parameter order in call to bzDecompressInit in
  75.         bzBuffToBuffDecompress.  Fixed.
  76. --*/
  77. #include "bzlib.h"
  78.  
  79.  
  80. /*---------------------------------------------------*/
  81. /*--- Compression stuff                           ---*/
  82. /*---------------------------------------------------*/
  83.  
  84.  
  85. #ifndef EXEHEAD
  86.  
  87. /*---------------------------------------------------*/
  88. static
  89. void prepare_new_block ( EState* s )
  90. {
  91.    Int32 i;
  92.    s->nblock = 0;
  93.    s->numZ = 0;
  94.    s->state_out_pos = 0;
  95.    for (i = 0; i < 256; i++) s->inUse[i] = False;
  96.    s->blockNo++;
  97. }
  98.  
  99.  
  100. /*---------------------------------------------------*/
  101. static
  102. void init_RL ( EState* s )
  103. {
  104.    s->state_in_ch  = 256;
  105.    s->state_in_len = 0;
  106. }
  107.  
  108.  
  109. static
  110. Bool isempty_RL ( EState* s )
  111. {
  112.    if (s->state_in_ch < 256 && s->state_in_len > 0)
  113.       return False; else
  114.       return True;
  115. }
  116.  
  117. /*---------------------------------------------------*/
  118. int BZ2_bzCompressInit( bz_stream* strm,
  119.                      int        blockSize100k,
  120.                      int        verbosity,
  121.                      int        workFactor )
  122. {
  123.    Int32   n;
  124.    EState* s;
  125.  
  126.    if (strm == NULL ||
  127.        workFactor < 0 || workFactor > 250)
  128.      return BZ_PARAM_ERROR;
  129.  
  130.    if (workFactor == 0) workFactor = 30;
  131.  
  132.    s = BZALLOC( sizeof(EState) );
  133.    if (s == NULL) return BZ_MEM_ERROR;
  134.    s->strm = strm;
  135.  
  136.    s->arr1 = NULL;
  137.    s->arr2 = NULL;
  138.    s->ftab = NULL;
  139.  
  140.    n       = NSIS_COMPRESS_BZIP2_LEVEL*100000;
  141.    s->arr1 = BZALLOC( n                  * sizeof(UInt32) );
  142.    s->arr2 = BZALLOC( (n+BZ_N_OVERSHOOT) * sizeof(UInt32) );
  143.    s->ftab = BZALLOC( 65537              * sizeof(UInt32) );
  144.  
  145.    if (s->arr1 == NULL || s->arr2 == NULL || s->ftab == NULL) {
  146.       BZFREE(s->arr1);
  147.       BZFREE(s->arr2);
  148.       BZFREE(s->ftab);
  149.       BZFREE(s);
  150.       return BZ_MEM_ERROR;
  151.    }
  152.  
  153.    s->blockNo           = 0;
  154.    s->state             = BZ_S_INPUT;
  155.    s->mode              = BZ_M_RUNNING;
  156.    s->nblockMAX         = 100000 * NSIS_COMPRESS_BZIP2_LEVEL - 19;
  157.    s->workFactor        = workFactor;
  158.  
  159.    s->block             = (UChar*)s->arr2;
  160.    s->mtfv              = (UInt16*)s->arr1;
  161.    s->zbits             = NULL;
  162.    s->ptr               = (UInt32*)s->arr1;
  163.  
  164.    strm->state          = s;
  165.    init_RL ( s );
  166.    prepare_new_block ( s );
  167.    return BZ_OK;
  168. }
  169.  
  170.  
  171. /*---------------------------------------------------*/
  172. static
  173. void add_pair_to_block ( EState* s )
  174. {
  175.    UChar ch = (UChar)(s->state_in_ch);
  176.    s->inUse[s->state_in_ch] = True;
  177.    switch (s->state_in_len) {
  178.       case 1:
  179.          s->block[s->nblock] = (UChar)ch; s->nblock++;
  180.          break;
  181.       case 2:
  182.          s->block[s->nblock] = (UChar)ch; s->nblock++;
  183.          s->block[s->nblock] = (UChar)ch; s->nblock++;
  184.          break;
  185.       case 3:
  186.          s->block[s->nblock] = (UChar)ch; s->nblock++;
  187.          s->block[s->nblock] = (UChar)ch; s->nblock++;
  188.          s->block[s->nblock] = (UChar)ch; s->nblock++;
  189.          break;
  190.       default:
  191.          s->inUse[s->state_in_len-4] = True;
  192.          s->block[s->nblock] = (UChar)ch; s->nblock++;
  193.          s->block[s->nblock] = (UChar)ch; s->nblock++;
  194.          s->block[s->nblock] = (UChar)ch; s->nblock++;
  195.          s->block[s->nblock] = (UChar)ch; s->nblock++;
  196.          s->block[s->nblock] = ((UChar)(s->state_in_len-4));
  197.          s->nblock++;
  198.          break;
  199.    }
  200. }
  201.  
  202.  
  203. /*---------------------------------------------------*/
  204. static
  205. void flush_RL ( EState* s )
  206. {
  207.    if (s->state_in_ch < 256) add_pair_to_block ( s );
  208.    init_RL ( s );
  209. }
  210.  
  211.  
  212. /*---------------------------------------------------*/
  213. #define ADD_CHAR_TO_BLOCK(zs,zchh0)               \
  214. {                                                 \
  215.    UInt32 zchh = (UInt32)(zchh0);                 \
  216.    /*-- fast track the common case --*/           \
  217.    if (zchh != zs->state_in_ch &&                 \
  218.        zs->state_in_len == 1) {                   \
  219.       UChar ch = (UChar)(zs->state_in_ch);        \
  220.       zs->inUse[zs->state_in_ch] = True;          \
  221.       zs->block[zs->nblock] = (UChar)ch;          \
  222.       zs->nblock++;                               \
  223.       zs->state_in_ch = zchh;                     \
  224.    }                                              \
  225.    else                                           \
  226.    /*-- general, uncommon cases --*/              \
  227.    if (zchh != zs->state_in_ch ||                 \
  228.       zs->state_in_len == 255) {                  \
  229.       if (zs->state_in_ch < 256)                  \
  230.          add_pair_to_block ( zs );                \
  231.       zs->state_in_ch = zchh;                     \
  232.       zs->state_in_len = 1;                       \
  233.    } else {                                       \
  234.       zs->state_in_len++;                         \
  235.    }                                              \
  236. }
  237.  
  238.  
  239. /*---------------------------------------------------*/
  240. static
  241. Bool copy_input_until_stop ( EState* s )
  242. {
  243.    Bool progress_in = False;
  244.  
  245.    if (s->mode == BZ_M_RUNNING) {
  246.  
  247.       /*-- fast track the common case --*/
  248.       while (True) {
  249.          /*-- block full? --*/
  250.          if (s->nblock >= s->nblockMAX) break;
  251.          /*-- no input? --*/
  252.          if (s->strm->avail_in == 0) break;
  253.          progress_in = True;
  254.          ADD_CHAR_TO_BLOCK ( s, (UInt32)(*((UChar*)(s->strm->next_in))) );
  255.          s->strm->next_in++;
  256.          s->strm->avail_in--;
  257.   //       s->strm->total_in_lo32++;
  258. //         if (s->strm->total_in_lo32 == 0) s->strm->total_in_hi32++;
  259.       }
  260.  
  261.    } else {
  262.  
  263.       /*-- general, uncommon case --*/
  264.       while (True) {
  265.          /*-- block full? --*/
  266.          if (s->nblock >= s->nblockMAX) break;
  267.          /*-- no input? --*/
  268.          if (s->strm->avail_in == 0) break;
  269.          /*-- flush/finish end? --*/
  270.          if (s->avail_in_expect == 0) break;
  271.          progress_in = True;
  272.          ADD_CHAR_TO_BLOCK ( s, (UInt32)(*((UChar*)(s->strm->next_in))) );
  273.          s->strm->next_in++;
  274.          s->strm->avail_in--;
  275.   //       s->strm->total_in_lo32++;
  276. //         if (s->strm->total_in_lo32 == 0) s->strm->total_in_hi32++;
  277.          s->avail_in_expect--;
  278.       }
  279.    }
  280.    return progress_in;
  281. }
  282.  
  283.  
  284. /*---------------------------------------------------*/
  285. static
  286. Bool copy_output_until_stop ( EState* s )
  287. {
  288.    Bool progress_out = False;
  289.  
  290.    while (True) {
  291.  
  292.       /*-- no output space? --*/
  293.       if (s->strm->avail_out == 0) break;
  294.  
  295.       /*-- block done? --*/
  296.       if (s->state_out_pos >= s->numZ) break;
  297.  
  298.       progress_out = True;
  299.       *(s->strm->next_out) = s->zbits[s->state_out_pos];
  300.       s->state_out_pos++;
  301.       s->strm->avail_out--;
  302.       s->strm->next_out++;
  303. //      s->strm->total_out_lo32++;
  304.   //    if (s->strm->total_out_lo32 == 0) s->strm->total_out_hi32++;
  305.    }
  306.  
  307.    return progress_out;
  308. }
  309.  
  310.  
  311. /*---------------------------------------------------*/
  312. static
  313. Bool handle_compress ( bz_stream* strm )
  314. {
  315.    Bool progress_in  = False;
  316.    Bool progress_out = False;
  317.    EState* s = strm->state;
  318.  
  319.    while (True) {
  320.  
  321.       if (s->state == BZ_S_OUTPUT) {
  322.          progress_out |= copy_output_until_stop ( s );
  323.          if (s->state_out_pos < s->numZ) break;
  324.          if (s->mode == BZ_M_FINISHING &&
  325.              s->avail_in_expect == 0 &&
  326.              isempty_RL(s)) break;
  327.          prepare_new_block ( s );
  328.          s->state = BZ_S_INPUT;
  329.          if (s->mode == BZ_M_FLUSHING &&
  330.              s->avail_in_expect == 0 &&
  331.              isempty_RL(s)) break;
  332.       }
  333.  
  334.       if (s->state == BZ_S_INPUT) {
  335.          progress_in |= copy_input_until_stop ( s );
  336.          if (s->mode != BZ_M_RUNNING && s->avail_in_expect == 0) {
  337.             flush_RL ( s );
  338.             BZ2_compressBlock ( s, (Bool)(s->mode == BZ_M_FINISHING) );
  339.             s->state = BZ_S_OUTPUT;
  340.          }
  341.          else
  342.          if (s->nblock >= s->nblockMAX) {
  343.             BZ2_compressBlock ( s, False );
  344.             s->state = BZ_S_OUTPUT;
  345.          }
  346.          else
  347.          if (s->strm->avail_in == 0) {
  348.             break;
  349.          }
  350.       }
  351.  
  352.    }
  353.  
  354.    return progress_in || progress_out;
  355. }
  356.  
  357.  
  358. /*---------------------------------------------------*/
  359. int BZ2_bzCompress( bz_stream *strm, int action )
  360. {
  361.    Bool progress;
  362.    EState* s;
  363.    if (strm == NULL) return BZ_PARAM_ERROR;
  364.    s = strm->state;
  365.    if (s == NULL) return BZ_PARAM_ERROR;
  366.    if (s->strm != strm) return BZ_PARAM_ERROR;
  367.  
  368.    preswitch:
  369.    switch (s->mode) {
  370.  
  371.       case BZ_M_IDLE:
  372.          return BZ_SEQUENCE_ERROR;
  373.  
  374.       case BZ_M_RUNNING:
  375.          if (action == BZ_RUN) {
  376.             progress = handle_compress ( strm );
  377.             return progress ? BZ_RUN_OK : BZ_PARAM_ERROR;
  378.          }
  379.          else
  380.          if (action == BZ_FLUSH) {
  381.             s->avail_in_expect = strm->avail_in;
  382.             s->mode = BZ_M_FLUSHING;
  383.             goto preswitch;
  384.          }
  385.          else
  386.          if (action == BZ_FINISH) {
  387.             s->avail_in_expect = strm->avail_in;
  388.             s->mode = BZ_M_FINISHING;
  389.             goto preswitch;
  390.          }
  391.          else
  392.             return BZ_PARAM_ERROR;
  393.  
  394.       case BZ_M_FLUSHING:
  395.          if (action != BZ_FLUSH) return BZ_SEQUENCE_ERROR;
  396.          if (s->avail_in_expect != s->strm->avail_in)
  397.             return BZ_SEQUENCE_ERROR;
  398.          progress = handle_compress ( strm );
  399.          if (s->avail_in_expect > 0 || !isempty_RL(s) ||
  400.              s->state_out_pos < s->numZ) return BZ_FLUSH_OK;
  401.          s->mode = BZ_M_RUNNING;
  402.          return BZ_RUN_OK;
  403.  
  404.       case BZ_M_FINISHING:
  405.          if (action != BZ_FINISH) return BZ_SEQUENCE_ERROR;
  406.          if (s->avail_in_expect != s->strm->avail_in)
  407.             return BZ_SEQUENCE_ERROR;
  408.          progress = handle_compress ( strm );
  409.          if (!progress) return BZ_SEQUENCE_ERROR;
  410.          if (s->avail_in_expect > 0 || !isempty_RL(s) ||
  411.              s->state_out_pos < s->numZ) return BZ_FINISH_OK;
  412.          s->mode = BZ_M_IDLE;
  413.          return BZ_STREAM_END;
  414.    }
  415.    return BZ_OK; /*--not reached--*/
  416. }
  417.  
  418.  
  419. /*---------------------------------------------------*/
  420. int BZ2_bzCompressEnd( bz_stream *strm )
  421. {
  422.    EState* s;
  423.    if (strm == NULL) return BZ_PARAM_ERROR;
  424.    s = strm->state;
  425.    if (s == NULL) return BZ_PARAM_ERROR;
  426.    if (s->strm != strm) return BZ_PARAM_ERROR;
  427.  
  428.    BZFREE(s->arr1);
  429.    BZFREE(s->arr2);
  430.    BZFREE(s->ftab);
  431.    BZFREE(strm->state);
  432.  
  433.    strm->state = NULL;
  434.  
  435.    return BZ_OK;
  436. }
  437. #else // EXEHEAD
  438.  
  439. #ifdef NSIS_COMPRESS_BZIP2_SMALLMODE
  440. /*---------------------------------------------------*/
  441.  
  442. Int32 BZ2_indexIntoF ( Int32 indx, Int32 *cftab )   
  443. {      
  444.   Int32 nb, na, mid;
  445.   nb = 0;
  446.   na = 256;
  447.   do {
  448.     mid = (nb + na) >> 1;
  449.     if (indx >= cftab[mid]) nb = mid; 
  450.     else na = mid;
  451.   } while (na - nb != 1);
  452.   return nb;
  453. }
  454.  
  455.  
  456. static
  457. void unRLE_obuf_to_output_SMALL ( DState* s )
  458. {
  459.    UChar k1;
  460.   while (True) {
  461.      /* try to finish existing run */
  462.      while (True) {
  463.         if (s->avail_out == 0) return;
  464.         if (s->state_out_len == 0) break;
  465.         *( (UChar*)(s->next_out) ) = s->state_out_ch;
  466.         s->state_out_len--;
  467.         s->next_out++;
  468.         s->avail_out--;
  469.      }
  470.  
  471.      /* can a new run be started? */
  472.      if (s->nblock_used == s->save.nblock+1) return;
  473.  
  474.      s->state_out_len = 1;
  475.      s->state_out_ch = s->k0;
  476.      BZ_GET_SMALL(k1); s->nblock_used++;
  477.      if (s->nblock_used == s->save.nblock+1) continue;
  478.      if (k1 != s->k0) { s->k0 = k1; continue; };
  479.  
  480.      s->state_out_len = 2;
  481.      BZ_GET_SMALL(k1); s->nblock_used++;
  482.      if (s->nblock_used == s->save.nblock+1) continue;
  483.      if (k1 != s->k0) { s->k0 = k1; continue; };
  484.  
  485.      s->state_out_len = 3;
  486.      BZ_GET_SMALL(k1); s->nblock_used++;
  487.      if (s->nblock_used == s->save.nblock+1) continue;
  488.      if (k1 != s->k0) { s->k0 = k1; continue; };
  489.  
  490.      BZ_GET_SMALL(k1); s->nblock_used++;
  491.      s->state_out_len = ((Int32)k1) + 4;
  492.      BZ_GET_SMALL(s->k0); s->nblock_used++;
  493.   }
  494. }
  495. #else//!small, fast
  496. static void unRLE_obuf_to_output_FAST ( DState* s )
  497. {
  498.    UChar k1;
  499.  
  500.       /* restore */
  501.       UChar         c_state_out_ch       = s->state_out_ch;
  502.       Int32         c_state_out_len      = s->state_out_len;
  503.       Int32         c_nblock_used        = s->nblock_used;
  504.       Int32         c_k0                 = s->k0;
  505.       UInt32        c_tPos               = s->tPos;
  506.  
  507.       char*         cs_next_out          = s->next_out;
  508.       unsigned int  cs_avail_out         = s->avail_out;
  509.       /* end restore */
  510.  
  511.       UInt32*       c_tt                 = s->tt;
  512.       Int32        s_save_nblockPP = s->save.nblock+1;
  513. //      unsigned int total_out_lo32_old;
  514.  
  515.       while (True) {
  516.  
  517.          /* try to finish existing run */
  518.          if (c_state_out_len > 0) {
  519.             while (True) {
  520.                if (cs_avail_out == 0) goto return_notr;
  521.                if (c_state_out_len == 1) break;
  522.                *( (UChar*)(cs_next_out) ) = c_state_out_ch;
  523.                c_state_out_len--;
  524.                cs_next_out++;
  525.                cs_avail_out--;
  526.             }
  527.             s_state_out_len_eq_one:
  528.             {
  529.                if (cs_avail_out == 0) {
  530.                   c_state_out_len = 1; goto return_notr;
  531.                };
  532.                *( (UChar*)(cs_next_out) ) = c_state_out_ch;
  533.                cs_next_out++;
  534.                cs_avail_out--;
  535.             }
  536.          }
  537.          /* can a new run be started? */
  538.          if (c_nblock_used == s_save_nblockPP) {
  539.             c_state_out_len = 0; goto return_notr;
  540.          };
  541.          c_state_out_ch = c_k0;
  542.          BZ_GET_FAST_C(k1); c_nblock_used++;
  543.          if (k1 != c_k0) {
  544.             c_k0 = k1; goto s_state_out_len_eq_one;
  545.          };
  546.          if (c_nblock_used == s_save_nblockPP)
  547.             goto s_state_out_len_eq_one;
  548.  
  549.          c_state_out_len = 2;
  550.          BZ_GET_FAST_C(k1); c_nblock_used++;
  551.          if (c_nblock_used == s_save_nblockPP) continue;
  552.          if (k1 != c_k0) { c_k0 = k1; continue; };
  553.  
  554.          c_state_out_len = 3;
  555.          BZ_GET_FAST_C(k1); c_nblock_used++;
  556.          if (c_nblock_used == s_save_nblockPP) continue;
  557.          if (k1 != c_k0) { c_k0 = k1; continue; };
  558.  
  559.          BZ_GET_FAST_C(k1); c_nblock_used++;
  560.          c_state_out_len = ((Int32)k1) + 4;
  561.          BZ_GET_FAST_C(c_k0); c_nblock_used++;
  562.       }
  563.  
  564.       return_notr:
  565.       s->state_out_ch       = c_state_out_ch;
  566.       s->state_out_len      = c_state_out_len;
  567.       s->nblock_used        = c_nblock_used;
  568.       s->k0                 = c_k0;
  569.       s->tPos               = c_tPos;
  570.       s->next_out     = cs_next_out;
  571.       s->avail_out    = cs_avail_out;
  572.       /* end save */
  573. }
  574.  
  575. #endif
  576.  
  577.  
  578. /*---------------------------------------------------*/
  579. int NSISCALL BZ2_bzDecompress( DState *s )
  580. {
  581.    while (True) {
  582.       if (s->state == BZ_X_IDLE) return BZ_SEQUENCE_ERROR;
  583.       if (s->state == BZ_X_OUTPUT) {
  584. #ifdef NSIS_COMPRESS_BZIP2_SMALLMODE
  585.         unRLE_obuf_to_output_SMALL ( s );
  586. #else
  587.         unRLE_obuf_to_output_FAST ( s );
  588. #endif
  589.          if (s->nblock_used == s->save.nblock+1 && s->state_out_len == 0) {
  590.             s->state = BZ_X_BLKHDR_1;
  591.          } else {
  592.             return BZ_OK;
  593.          }
  594.       }
  595.       if (s->state >= BZ_X_BLKHDR_1) {
  596.          Int32 r = BZ2_decompress ( s );
  597.          if (r == BZ_STREAM_END) {
  598.             return r;
  599.          }
  600.          if (s->state != BZ_X_OUTPUT) return r;
  601.       }
  602.    }
  603. }
  604.  
  605.  
  606.  
  607. #endif
  608.  
  609. #endif
  610.