Hex Artifact Content

Not logged in

Artifact 90529b3df0e042c216c457d094c1a632d97e88fc:


0000: 2f 2a 20 69 6e 66 75 74 69 6c 2e 68 20 2d 2d 20  /* infutil.h -- 
0010: 74 79 70 65 73 20 61 6e 64 20 6d 61 63 72 6f 73  types and macros
0020: 20 63 6f 6d 6d 6f 6e 20 74 6f 20 62 6c 6f 63 6b   common to block
0030: 73 20 61 6e 64 20 63 6f 64 65 73 0a 20 2a 20 43  s and codes. * C
0040: 6f 70 79 72 69 67 68 74 20 28 43 29 20 31 39 39  opyright (C) 199
0050: 35 2d 31 39 39 38 20 4d 61 72 6b 20 41 64 6c 65  5-1998 Mark Adle
0060: 72 0a 20 2a 20 46 6f 72 20 63 6f 6e 64 69 74 69  r. * For conditi
0070: 6f 6e 73 20 6f 66 20 64 69 73 74 72 69 62 75 74  ons of distribut
0080: 69 6f 6e 20 61 6e 64 20 75 73 65 2c 20 73 65 65  ion and use, see
0090: 20 63 6f 70 79 72 69 67 68 74 20 6e 6f 74 69 63   copyright notic
00a0: 65 20 69 6e 20 7a 6c 69 62 2e 68 20 0a 20 2a 2f  e in zlib.h . */
00b0: 0a 0a 2f 2a 20 57 41 52 4e 49 4e 47 3a 20 74 68  ../* WARNING: th
00c0: 69 73 20 66 69 6c 65 20 73 68 6f 75 6c 64 20 2a  is file should *
00d0: 6e 6f 74 2a 20 62 65 20 75 73 65 64 20 62 79 20  not* be used by 
00e0: 61 70 70 6c 69 63 61 74 69 6f 6e 73 2e 20 49 74  applications. It
00f0: 20 69 73 0a 20 20 20 70 61 72 74 20 6f 66 20 74   is.   part of t
0100: 68 65 20 69 6d 70 6c 65 6d 65 6e 74 61 74 69 6f  he implementatio
0110: 6e 20 6f 66 20 74 68 65 20 63 6f 6d 70 72 65 73  n of the compres
0120: 73 69 6f 6e 20 6c 69 62 72 61 72 79 20 61 6e 64  sion library and
0130: 20 69 73 0a 20 20 20 73 75 62 6a 65 63 74 20 74   is.   subject t
0140: 6f 20 63 68 61 6e 67 65 2e 20 41 70 70 6c 69 63  o change. Applic
0150: 61 74 69 6f 6e 73 20 73 68 6f 75 6c 64 20 6f 6e  ations should on
0160: 6c 79 20 75 73 65 20 7a 6c 69 62 2e 68 2e 0a 20  ly use zlib.h.. 
0170: 2a 2f 0a 0a 23 69 66 6e 64 65 66 20 5f 49 4e 46  */..#ifndef _INF
0180: 55 54 49 4c 5f 48 0a 23 64 65 66 69 6e 65 20 5f  UTIL_H.#define _
0190: 49 4e 46 55 54 49 4c 5f 48 0a 0a 74 79 70 65 64  INFUTIL_H..typed
01a0: 65 66 20 65 6e 75 6d 20 7b 0a 20 20 20 20 20 20  ef enum {.      
01b0: 54 59 50 45 2c 20 20 20 20 20 2f 2a 20 67 65 74  TYPE,     /* get
01c0: 20 74 79 70 65 20 62 69 74 73 20 28 33 2c 20 69   type bits (3, i
01d0: 6e 63 6c 75 64 69 6e 67 20 65 6e 64 20 62 69 74  ncluding end bit
01e0: 29 20 2a 2f 0a 20 20 20 20 20 20 4c 45 4e 53 2c  ) */.      LENS,
01f0: 20 20 20 20 20 2f 2a 20 67 65 74 20 6c 65 6e 67       /* get leng
0200: 74 68 73 20 66 6f 72 20 73 74 6f 72 65 64 20 2a  ths for stored *
0210: 2f 0a 20 20 20 20 20 20 53 54 4f 52 45 44 2c 20  /.      STORED, 
0220: 20 20 2f 2a 20 70 72 6f 63 65 73 73 69 6e 67 20    /* processing 
0230: 73 74 6f 72 65 64 20 62 6c 6f 63 6b 20 2a 2f 0a  stored block */.
0240: 20 20 20 20 20 20 54 41 42 4c 45 2c 20 20 20 20        TABLE,    
0250: 2f 2a 20 67 65 74 20 74 61 62 6c 65 20 6c 65 6e  /* get table len
0260: 67 74 68 73 20 2a 2f 0a 20 20 20 20 20 20 42 54  gths */.      BT
0270: 52 45 45 2c 20 20 20 20 2f 2a 20 67 65 74 20 62  REE,    /* get b
0280: 69 74 20 6c 65 6e 67 74 68 73 20 74 72 65 65 20  it lengths tree 
0290: 66 6f 72 20 61 20 64 79 6e 61 6d 69 63 20 62 6c  for a dynamic bl
02a0: 6f 63 6b 20 2a 2f 0a 20 20 20 20 20 20 44 54 52  ock */.      DTR
02b0: 45 45 2c 20 20 20 20 2f 2a 20 67 65 74 20 6c 65  EE,    /* get le
02c0: 6e 67 74 68 2c 20 64 69 73 74 61 6e 63 65 20 74  ngth, distance t
02d0: 72 65 65 73 20 66 6f 72 20 61 20 64 79 6e 61 6d  rees for a dynam
02e0: 69 63 20 62 6c 6f 63 6b 20 2a 2f 0a 20 20 20 20  ic block */.    
02f0: 20 20 43 4f 44 45 53 2c 20 20 20 20 2f 2a 20 70    CODES,    /* p
0300: 72 6f 63 65 73 73 69 6e 67 20 66 69 78 65 64 20  rocessing fixed 
0310: 6f 72 20 64 79 6e 61 6d 69 63 20 62 6c 6f 63 6b  or dynamic block
0320: 20 2a 2f 0a 20 20 20 20 20 20 44 52 59 2c 20 20   */.      DRY,  
0330: 20 20 20 20 2f 2a 20 6f 75 74 70 75 74 20 72 65      /* output re
0340: 6d 61 69 6e 69 6e 67 20 77 69 6e 64 6f 77 20 62  maining window b
0350: 79 74 65 73 20 2a 2f 0a 20 20 20 20 20 20 44 4f  ytes */.      DO
0360: 4e 45 2c 20 20 20 20 20 2f 2a 20 66 69 6e 69 73  NE,     /* finis
0370: 68 65 64 20 6c 61 73 74 20 62 6c 6f 63 6b 2c 20  hed last block, 
0380: 64 6f 6e 65 20 2a 2f 0a 20 20 20 20 20 20 42 41  done */.      BA
0390: 44 7d 20 20 20 20 20 20 2f 2a 20 67 6f 74 20 61  D}      /* got a
03a0: 20 64 61 74 61 20 65 72 72 6f 72 2d 2d 73 74 75   data error--stu
03b0: 63 6b 20 68 65 72 65 20 2a 2f 0a 69 6e 66 6c 61  ck here */.infla
03c0: 74 65 5f 62 6c 6f 63 6b 5f 6d 6f 64 65 3b 0a 0a  te_block_mode;..
03d0: 2f 2a 20 69 6e 66 6c 61 74 65 20 62 6c 6f 63 6b  /* inflate block
03e0: 73 20 73 65 6d 69 2d 70 72 69 76 61 74 65 20 73  s semi-private s
03f0: 74 61 74 65 20 2a 2f 0a 73 74 72 75 63 74 20 69  tate */.struct i
0400: 6e 66 6c 61 74 65 5f 62 6c 6f 63 6b 73 5f 73 74  nflate_blocks_st
0410: 61 74 65 20 7b 0a 0a 20 20 2f 2a 20 6d 6f 64 65  ate {..  /* mode
0420: 20 2a 2f 0a 20 20 69 6e 66 6c 61 74 65 5f 62 6c   */.  inflate_bl
0430: 6f 63 6b 5f 6d 6f 64 65 20 20 6d 6f 64 65 3b 20  ock_mode  mode; 
0440: 20 20 20 20 2f 2a 20 63 75 72 72 65 6e 74 20 69      /* current i
0450: 6e 66 6c 61 74 65 5f 62 6c 6f 63 6b 20 6d 6f 64  nflate_block mod
0460: 65 20 2a 2f 0a 0a 20 20 2f 2a 20 6d 6f 64 65 20  e */..  /* mode 
0470: 64 65 70 65 6e 64 65 6e 74 20 69 6e 66 6f 72 6d  dependent inform
0480: 61 74 69 6f 6e 20 2a 2f 0a 20 20 75 6e 69 6f 6e  ation */.  union
0490: 20 7b 0a 20 20 20 20 75 49 6e 74 20 6c 65 66 74   {.    uInt left
04a0: 3b 20 20 20 20 20 20 20 20 20 20 2f 2a 20 69 66  ;          /* if
04b0: 20 53 54 4f 52 45 44 2c 20 62 79 74 65 73 20 6c   STORED, bytes l
04c0: 65 66 74 20 74 6f 20 63 6f 70 79 20 2a 2f 0a 20  eft to copy */. 
04d0: 20 20 20 73 74 72 75 63 74 20 7b 0a 20 20 20 20     struct {.    
04e0: 20 20 75 49 6e 74 20 74 61 62 6c 65 3b 20 20 20    uInt table;   
04f0: 20 20 20 20 20 20 20 20 20 20 20 20 2f 2a 20 74              /* t
0500: 61 62 6c 65 20 6c 65 6e 67 74 68 73 20 28 31 34  able lengths (14
0510: 20 62 69 74 73 29 20 2a 2f 0a 20 20 20 20 20 20   bits) */.      
0520: 75 49 6e 74 20 69 6e 64 65 78 3b 20 20 20 20 20  uInt index;     
0530: 20 20 20 20 20 20 20 20 20 20 2f 2a 20 69 6e 64            /* ind
0540: 65 78 20 69 6e 74 6f 20 62 6c 65 6e 73 20 28 6f  ex into blens (o
0550: 72 20 62 6f 72 64 65 72 29 20 2a 2f 0a 20 20 20  r border) */.   
0560: 20 20 20 75 49 6e 74 66 20 2a 62 6c 65 6e 73 3b     uIntf *blens;
0570: 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2a 20               /* 
0580: 62 69 74 20 6c 65 6e 67 74 68 73 20 6f 66 20 63  bit lengths of c
0590: 6f 64 65 73 20 2a 2f 0a 20 20 20 20 20 20 75 49  odes */.      uI
05a0: 6e 74 20 62 62 3b 20 20 20 20 20 20 20 20 20 20  nt bb;          
05b0: 20 20 20 20 20 20 20 20 2f 2a 20 62 69 74 20 6c          /* bit l
05c0: 65 6e 67 74 68 20 74 72 65 65 20 64 65 70 74 68  ength tree depth
05d0: 20 2a 2f 0a 20 20 20 20 20 20 69 6e 66 6c 61 74   */.      inflat
05e0: 65 5f 68 75 66 74 20 2a 74 62 3b 20 20 20 20 20  e_huft *tb;     
05f0: 20 20 20 20 2f 2a 20 62 69 74 20 6c 65 6e 67 74      /* bit lengt
0600: 68 20 64 65 63 6f 64 69 6e 67 20 74 72 65 65 20  h decoding tree 
0610: 2a 2f 0a 20 20 20 20 7d 20 74 72 65 65 73 3b 20  */.    } trees; 
0620: 20 20 20 20 20 20 20 20 20 20 20 2f 2a 20 69 66             /* if
0630: 20 44 54 52 45 45 2c 20 64 65 63 6f 64 69 6e 67   DTREE, decoding
0640: 20 69 6e 66 6f 20 66 6f 72 20 74 72 65 65 73 20   info for trees 
0650: 2a 2f 0a 20 20 20 20 73 74 72 75 63 74 20 7b 0a  */.    struct {.
0660: 20 20 20 20 20 20 69 6e 66 6c 61 74 65 5f 63 6f        inflate_co
0670: 64 65 73 5f 73 74 61 74 65 66 20 0a 20 20 20 20  des_statef .    
0680: 20 20 20 20 20 2a 63 6f 64 65 73 3b 0a 20 20 20       *codes;.   
0690: 20 7d 20 64 65 63 6f 64 65 3b 20 20 20 20 20 20   } decode;      
06a0: 20 20 20 20 20 2f 2a 20 69 66 20 43 4f 44 45 53       /* if CODES
06b0: 2c 20 63 75 72 72 65 6e 74 20 73 74 61 74 65 20  , current state 
06c0: 2a 2f 0a 20 20 7d 20 73 75 62 3b 20 20 20 20 20  */.  } sub;     
06d0: 20 20 20 20 20 20 20 20 20 20 20 2f 2a 20 73 75             /* su
06e0: 62 6d 6f 64 65 20 2a 2f 0a 20 20 75 49 6e 74 20  bmode */.  uInt 
06f0: 6c 61 73 74 3b 20 20 20 20 20 20 20 20 20 20 20  last;           
0700: 20 2f 2a 20 74 72 75 65 20 69 66 20 74 68 69 73   /* true if this
0710: 20 62 6c 6f 63 6b 20 69 73 20 74 68 65 20 6c 61   block is the la
0720: 73 74 20 62 6c 6f 63 6b 20 2a 2f 0a 0a 20 20 2f  st block */..  /
0730: 2a 20 6d 6f 64 65 20 69 6e 64 65 70 65 6e 64 65  * mode independe
0740: 6e 74 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 20 2a  nt information *
0750: 2f 0a 20 20 75 49 6e 74 20 62 69 74 6b 3b 20 20  /.  uInt bitk;  
0760: 20 20 20 20 20 20 20 20 20 20 2f 2a 20 62 69 74            /* bit
0770: 73 20 69 6e 20 62 69 74 20 62 75 66 66 65 72 20  s in bit buffer 
0780: 2a 2f 0a 20 20 75 4c 6f 6e 67 20 62 69 74 62 3b  */.  uLong bitb;
0790: 20 20 20 20 20 20 20 20 20 20 20 2f 2a 20 62 69             /* bi
07a0: 74 20 62 75 66 66 65 72 20 2a 2f 0a 20 20 69 6e  t buffer */.  in
07b0: 66 6c 61 74 65 5f 68 75 66 74 20 2a 68 75 66 74  flate_huft *huft
07c0: 73 3b 20 20 2f 2a 20 73 69 6e 67 6c 65 20 6d 61  s;  /* single ma
07d0: 6c 6c 6f 63 20 66 6f 72 20 74 72 65 65 20 73 70  lloc for tree sp
07e0: 61 63 65 20 2a 2f 0a 20 20 42 79 74 65 66 20 2a  ace */.  Bytef *
07f0: 77 69 6e 64 6f 77 3b 20 20 20 20 20 20 20 20 2f  window;        /
0800: 2a 20 73 6c 69 64 69 6e 67 20 77 69 6e 64 6f 77  * sliding window
0810: 20 2a 2f 0a 20 20 42 79 74 65 66 20 2a 65 6e 64   */.  Bytef *end
0820: 3b 20 20 20 20 20 20 20 20 20 20 20 2f 2a 20 6f  ;           /* o
0830: 6e 65 20 62 79 74 65 20 61 66 74 65 72 20 73 6c  ne byte after sl
0840: 69 64 69 6e 67 20 77 69 6e 64 6f 77 20 2a 2f 0a  iding window */.
0850: 20 20 42 79 74 65 66 20 2a 72 65 61 64 3b 20 20    Bytef *read;  
0860: 20 20 20 20 20 20 20 20 2f 2a 20 77 69 6e 64 6f          /* windo
0870: 77 20 72 65 61 64 20 70 6f 69 6e 74 65 72 20 2a  w read pointer *
0880: 2f 0a 20 20 42 79 74 65 66 20 2a 77 72 69 74 65  /.  Bytef *write
0890: 3b 20 20 20 20 20 20 20 20 20 2f 2a 20 77 69 6e  ;         /* win
08a0: 64 6f 77 20 77 72 69 74 65 20 70 6f 69 6e 74 65  dow write pointe
08b0: 72 20 2a 2f 0a 20 20 63 68 65 63 6b 5f 66 75 6e  r */.  check_fun
08c0: 63 20 63 68 65 63 6b 66 6e 3b 20 20 20 2f 2a 20  c checkfn;   /* 
08d0: 63 68 65 63 6b 20 66 75 6e 63 74 69 6f 6e 20 2a  check function *
08e0: 2f 0a 20 20 75 4c 6f 6e 67 20 63 68 65 63 6b 3b  /.  uLong check;
08f0: 20 20 20 20 20 20 20 20 20 20 2f 2a 20 63 68 65            /* che
0900: 63 6b 20 6f 6e 20 6f 75 74 70 75 74 20 2a 2f 0a  ck on output */.
0910: 0a 7d 3b 0a 0a 0a 2f 2a 20 64 65 66 69 6e 65 73  .};.../* defines
0920: 20 66 6f 72 20 69 6e 66 6c 61 74 65 20 69 6e 70   for inflate inp
0930: 75 74 2f 6f 75 74 70 75 74 20 2a 2f 0a 2f 2a 20  ut/output */./* 
0940: 20 20 75 70 64 61 74 65 20 70 6f 69 6e 74 65 72    update pointer
0950: 73 20 61 6e 64 20 72 65 74 75 72 6e 20 2a 2f 0a  s and return */.
0960: 23 64 65 66 69 6e 65 20 55 50 44 42 49 54 53 20  #define UPDBITS 
0970: 7b 73 2d 3e 62 69 74 62 3d 62 3b 73 2d 3e 62 69  {s->bitb=b;s->bi
0980: 74 6b 3d 6b 3b 7d 0a 23 64 65 66 69 6e 65 20 55  tk=k;}.#define U
0990: 50 44 49 4e 20 7b 7a 2d 3e 61 76 61 69 6c 5f 69  PDIN {z->avail_i
09a0: 6e 3d 6e 3b 7a 2d 3e 74 6f 74 61 6c 5f 69 6e 2b  n=n;z->total_in+
09b0: 3d 70 2d 7a 2d 3e 6e 65 78 74 5f 69 6e 3b 7a 2d  =p-z->next_in;z-
09c0: 3e 6e 65 78 74 5f 69 6e 3d 70 3b 7d 0a 23 64 65  >next_in=p;}.#de
09d0: 66 69 6e 65 20 55 50 44 4f 55 54 20 7b 73 2d 3e  fine UPDOUT {s->
09e0: 77 72 69 74 65 3d 71 3b 7d 0a 23 64 65 66 69 6e  write=q;}.#defin
09f0: 65 20 55 50 44 41 54 45 20 7b 55 50 44 42 49 54  e UPDATE {UPDBIT
0a00: 53 20 55 50 44 49 4e 20 55 50 44 4f 55 54 7d 0a  S UPDIN UPDOUT}.
0a10: 23 64 65 66 69 6e 65 20 4c 45 41 56 45 20 7b 55  #define LEAVE {U
0a20: 50 44 41 54 45 20 72 65 74 75 72 6e 20 69 6e 66  PDATE return inf
0a30: 6c 61 74 65 5f 66 6c 75 73 68 28 73 2c 7a 2c 72  late_flush(s,z,r
0a40: 29 3b 7d 0a 2f 2a 20 20 20 67 65 74 20 62 79 74  );}./*   get byt
0a50: 65 73 20 61 6e 64 20 62 69 74 73 20 2a 2f 0a 23  es and bits */.#
0a60: 64 65 66 69 6e 65 20 4c 4f 41 44 49 4e 20 7b 70  define LOADIN {p
0a70: 3d 7a 2d 3e 6e 65 78 74 5f 69 6e 3b 6e 3d 7a 2d  =z->next_in;n=z-
0a80: 3e 61 76 61 69 6c 5f 69 6e 3b 62 3d 73 2d 3e 62  >avail_in;b=s->b
0a90: 69 74 62 3b 6b 3d 73 2d 3e 62 69 74 6b 3b 7d 0a  itb;k=s->bitk;}.
0aa0: 23 64 65 66 69 6e 65 20 4e 45 45 44 42 59 54 45  #define NEEDBYTE
0ab0: 20 7b 69 66 28 6e 29 72 3d 5a 5f 4f 4b 3b 65 6c   {if(n)r=Z_OK;el
0ac0: 73 65 20 4c 45 41 56 45 7d 0a 23 64 65 66 69 6e  se LEAVE}.#defin
0ad0: 65 20 4e 45 58 54 42 59 54 45 20 28 6e 2d 2d 2c  e NEXTBYTE (n--,
0ae0: 2a 70 2b 2b 29 0a 23 64 65 66 69 6e 65 20 4e 45  *p++).#define NE
0af0: 45 44 42 49 54 53 28 6a 29 20 7b 77 68 69 6c 65  EDBITS(j) {while
0b00: 28 6b 3c 28 6a 29 29 7b 4e 45 45 44 42 59 54 45  (k<(j)){NEEDBYTE
0b10: 3b 62 7c 3d 28 28 75 4c 6f 6e 67 29 4e 45 58 54  ;b|=((uLong)NEXT
0b20: 42 59 54 45 29 3c 3c 6b 3b 6b 2b 3d 38 3b 7d 7d  BYTE)<<k;k+=8;}}
0b30: 0a 23 64 65 66 69 6e 65 20 44 55 4d 50 42 49 54  .#define DUMPBIT
0b40: 53 28 6a 29 20 7b 62 3e 3e 3d 28 6a 29 3b 6b 2d  S(j) {b>>=(j);k-
0b50: 3d 28 6a 29 3b 7d 0a 2f 2a 20 20 20 6f 75 74 70  =(j);}./*   outp
0b60: 75 74 20 62 79 74 65 73 20 2a 2f 0a 23 64 65 66  ut bytes */.#def
0b70: 69 6e 65 20 57 41 56 41 49 4c 20 28 75 49 6e 74  ine WAVAIL (uInt
0b80: 29 28 71 3c 73 2d 3e 72 65 61 64 3f 73 2d 3e 72  )(q<s->read?s->r
0b90: 65 61 64 2d 71 2d 31 3a 73 2d 3e 65 6e 64 2d 71  ead-q-1:s->end-q
0ba0: 29 0a 23 64 65 66 69 6e 65 20 4c 4f 41 44 4f 55  ).#define LOADOU
0bb0: 54 20 7b 71 3d 73 2d 3e 77 72 69 74 65 3b 6d 3d  T {q=s->write;m=
0bc0: 28 75 49 6e 74 29 57 41 56 41 49 4c 3b 7d 0a 23  (uInt)WAVAIL;}.#
0bd0: 64 65 66 69 6e 65 20 57 52 41 50 20 7b 69 66 28  define WRAP {if(
0be0: 71 3d 3d 73 2d 3e 65 6e 64 26 26 73 2d 3e 72 65  q==s->end&&s->re
0bf0: 61 64 21 3d 73 2d 3e 77 69 6e 64 6f 77 29 7b 71  ad!=s->window){q
0c00: 3d 73 2d 3e 77 69 6e 64 6f 77 3b 6d 3d 28 75 49  =s->window;m=(uI
0c10: 6e 74 29 57 41 56 41 49 4c 3b 7d 7d 0a 23 64 65  nt)WAVAIL;}}.#de
0c20: 66 69 6e 65 20 46 4c 55 53 48 20 7b 55 50 44 4f  fine FLUSH {UPDO
0c30: 55 54 20 72 3d 69 6e 66 6c 61 74 65 5f 66 6c 75  UT r=inflate_flu
0c40: 73 68 28 73 2c 7a 2c 72 29 3b 20 4c 4f 41 44 4f  sh(s,z,r); LOADO
0c50: 55 54 7d 0a 23 64 65 66 69 6e 65 20 4e 45 45 44  UT}.#define NEED
0c60: 4f 55 54 20 7b 69 66 28 6d 3d 3d 30 29 7b 57 52  OUT {if(m==0){WR
0c70: 41 50 20 69 66 28 6d 3d 3d 30 29 7b 46 4c 55 53  AP if(m==0){FLUS
0c80: 48 20 57 52 41 50 20 69 66 28 6d 3d 3d 30 29 20  H WRAP if(m==0) 
0c90: 4c 45 41 56 45 7d 7d 72 3d 5a 5f 4f 4b 3b 7d 0a  LEAVE}}r=Z_OK;}.
0ca0: 23 64 65 66 69 6e 65 20 4f 55 54 42 59 54 45 28  #define OUTBYTE(
0cb0: 61 29 20 7b 2a 71 2b 2b 3d 28 42 79 74 65 29 28  a) {*q++=(Byte)(
0cc0: 61 29 3b 6d 2d 2d 3b 7d 0a 2f 2a 20 20 20 6c 6f  a);m--;}./*   lo
0cd0: 61 64 20 6c 6f 63 61 6c 20 70 6f 69 6e 74 65 72  ad local pointer
0ce0: 73 20 2a 2f 0a 23 64 65 66 69 6e 65 20 4c 4f 41  s */.#define LOA
0cf0: 44 20 7b 4c 4f 41 44 49 4e 20 4c 4f 41 44 4f 55  D {LOADIN LOADOU
0d00: 54 7d 0a 0a 2f 2a 20 6d 61 73 6b 73 20 66 6f 72  T}../* masks for
0d10: 20 6c 6f 77 65 72 20 62 69 74 73 20 28 73 69 7a   lower bits (siz
0d20: 65 20 67 69 76 65 6e 20 74 6f 20 61 76 6f 69 64  e given to avoid
0d30: 20 73 69 6c 6c 79 20 77 61 72 6e 69 6e 67 73 20   silly warnings 
0d40: 77 69 74 68 20 56 69 73 75 61 6c 20 43 2b 2b 29  with Visual C++)
0d50: 20 2a 2f 0a 65 78 74 65 72 6e 20 75 49 6e 74 20   */.extern uInt 
0d60: 69 6e 66 6c 61 74 65 5f 6d 61 73 6b 5b 31 37 5d  inflate_mask[17]
0d70: 3b 0a 0a 2f 2a 20 63 6f 70 79 20 61 73 20 6d 75  ;../* copy as mu
0d80: 63 68 20 61 73 20 70 6f 73 73 69 62 6c 65 20 66  ch as possible f
0d90: 72 6f 6d 20 74 68 65 20 73 6c 69 64 69 6e 67 20  rom the sliding 
0da0: 77 69 6e 64 6f 77 20 74 6f 20 74 68 65 20 6f 75  window to the ou
0db0: 74 70 75 74 20 61 72 65 61 20 2a 2f 0a 65 78 74  tput area */.ext
0dc0: 65 72 6e 20 69 6e 74 20 69 6e 66 6c 61 74 65 5f  ern int inflate_
0dd0: 66 6c 75 73 68 20 4f 46 28 28 0a 20 20 20 20 69  flush OF((.    i
0de0: 6e 66 6c 61 74 65 5f 62 6c 6f 63 6b 73 5f 73 74  nflate_blocks_st
0df0: 61 74 65 66 20 2a 2c 0a 20 20 20 20 7a 5f 73 74  atef *,.    z_st
0e00: 72 65 61 6d 70 20 2c 0a 20 20 20 20 69 6e 74 29  reamp ,.    int)
0e10: 29 3b 0a 0a 73 74 72 75 63 74 20 69 6e 74 65 72  );..struct inter
0e20: 6e 61 6c 5f 73 74 61 74 65 20 20 20 20 20 20 7b  nal_state      {
0e30: 69 6e 74 20 64 75 6d 6d 79 3b 7d 3b 20 2f 2a 20  int dummy;}; /* 
0e40: 66 6f 72 20 62 75 67 67 79 20 63 6f 6d 70 69 6c  for buggy compil
0e50: 65 72 73 20 2a 2f 0a 0a 23 65 6e 64 69 66 0a     ers */..#endif.