func: int file_getc(FILE_T file) unsigned char buf [ 1 ] ; int ret ; if ( file -> err )  if ( file -> have )  file -> have --; file -> pos ++; return ( * ( file -> next ++ ) ) ; ret = file_read ( buf , 1 , file ); int file_read(void *buf,unsigned int len,FILE_T file) unsigned int n ; if ( len == 0 )  if ( file -> seek )  file -> seek = 0; if ( gz_skip ( file , file -> skip ) == - 1 )  static int gz_skip(FILE_T state,gint64 len) unsigned int n ; while ( len )  if ( state -> have )  n = ( ( ( gint64 ) ( state -> have ) ) > len ? ( ( unsigned int ) len ) : state -> have ); state -> have -= n; state -> next += n; state -> pos += n; len -= n; if ( state -> err )  return - 1 ; if ( state -> eof && state -> avail_in == 0 )  if ( fill_out_buffer ( state ) == - 1 )  static int fill_out_buffer(FILE_T state) if ( state -> compression == 0 )  if ( gz_head ( state ) == - 1 )  static int gz_head(FILE_T state) if ( state -> avail_in == 0 )  if ( fill_in_buffer ( state ) == - 1 )  static int fill_in_buffer(FILE_T state) if ( state -> err )  return - 1 ; if ( state -> eof == 0 )  if ( raw_read ( state , state -> in , state -> size , ( ( unsigned int * ) ( & state -> avail_in ) ) ) == - 1 )  static int raw_read(FILE_T state,unsigned char *buf,unsigned int count,unsigned int *have) int ret ; * have = 0; ret = ( read ( state -> fd , ( buf + * have ) , ( count - * have ) ) ); if ( ret <= 0 )  * have += ret; state -> raw_pos += ret; while ( * have < count )  if ( ret < 0 )  return - 1 ; return 0 ; return - 1 ; return 0 ; return - 1 ; if ( state -> avail_in == 0 )  return 0 ; if ( state -> next_in [ 0 ] == 31 )  state -> avail_in --; state -> next_in ++; if ( state -> avail_in == 0 && fill_in_buffer ( state ) == - 1 )  static int fill_in_buffer(FILE_T state) if ( state -> err )  return - 1 ; if ( state -> eof == 0 )  if ( raw_read ( state , state -> in , state -> size , ( ( unsigned int * ) ( & state -> avail_in ) ) ) == - 1 )  return - 1 ; return 0 ; return - 1 ; if ( state -> avail_in && state -> next_in [ 0 ] == 139 )  guint8 cm ; guint8 flags ; guint16 len ; guint16 hcrc ; state -> avail_in --; state -> next_in ++; if ( gz_next1 ( state , & cm ) == - 1 )  static int gz_next1(FILE_T state,guint8 *ret) int ch ; ch = ( state -> avail_in == 0 && fill_in_buffer ( state ) == - 1 ? - 1 : ( ( state -> avail_in == 0 ? - 1 : ( ( state -> avail_in -- , * ( state -> next_in ++ ) ) ) ) ) ); static int fill_in_buffer(FILE_T state) if ( state -> err )  return - 1 ; if ( state -> eof == 0 )  if ( raw_read ( state , state -> in , state -> size , ( ( unsigned int * ) ( & state -> avail_in ) ) ) == - 1 )  return - 1 ; return 0 ; if ( ch == - 1 )  return - 1 ; return 0 ; return - 1 ; if ( cm != 8 )  state -> err = - 21; state -> err_info = "unknown compression method"; return - 1 ; if ( gz_next1 ( state , & flags ) == - 1 )  static int gz_next1(FILE_T state,guint8 *ret) int ch ; ch = ( state -> avail_in == 0 && fill_in_buffer ( state ) == - 1 ? - 1 : ( ( state -> avail_in == 0 ? - 1 : ( ( state -> avail_in -- , * ( state -> next_in ++ ) ) ) ) ) ); if ( ch == - 1 )  return - 1 ; return 0 ; return - 1 ; if ( flags & 0xe0 )  return - 1 ; if ( gz_skipn ( state , 4 ) == - 1 )  static int gz_skipn(FILE_T state,size_t n) while ( n != 0 )  if ( ( ( state -> avail_in == 0 && fill_in_buffer ( state ) == - 1 ? - 1 : ( ( state -> avail_in == 0 ? - 1 : ( ( state -> avail_in -- , * ( state -> next_in ++ ) ) ) ) ) ) ) == - 1 )  static int fill_in_buffer(FILE_T state) if ( state -> err )  return - 1 ; if ( state -> eof == 0 )  if ( raw_read ( state , state -> in , state -> size , ( ( unsigned int * ) ( & state -> avail_in ) ) ) == - 1 )  return - 1 ; return 0 ; return - 1 ; n --; return 0 ; return - 1 ; if ( gz_skipn ( state , 1 ) == - 1 )  static int gz_skipn(FILE_T state,size_t n) while ( n != 0 )  if ( ( ( state -> avail_in == 0 && fill_in_buffer ( state ) == - 1 ? - 1 : ( ( state -> avail_in == 0 ? - 1 : ( ( state -> avail_in -- , * ( state -> next_in ++ ) ) ) ) ) ) ) == - 1 )  return - 1 ; n --; return 0 ; return - 1 ; if ( gz_skipn ( state , 1 ) == - 1 )  static int gz_skipn(FILE_T state,size_t n) while ( n != 0 )  if ( ( ( state -> avail_in == 0 && fill_in_buffer ( state ) == - 1 ? - 1 : ( ( state -> avail_in == 0 ? - 1 : ( ( state -> avail_in -- , * ( state -> next_in ++ ) ) ) ) ) ) ) == - 1 )  return - 1 ; n --; return 0 ; return - 1 ; if ( flags & 4 )  if ( gz_next2 ( state , & len ) == - 1 )  static int gz_next2(FILE_T state,guint16 *ret) guint16 val ; int ch ; val = ( ( state -> avail_in == 0 && fill_in_buffer ( state ) == - 1 ? - 1 : ( ( state -> avail_in == 0 ? - 1 : ( ( state -> avail_in -- , * ( state -> next_in ++ ) ) ) ) ) ) ); static int fill_in_buffer(FILE_T state) if ( state -> err )  return - 1 ; if ( state -> eof == 0 )  if ( raw_read ( state , state -> in , state -> size , ( ( unsigned int * ) ( & state -> avail_in ) ) ) == - 1 )  return - 1 ; return 0 ; ch = ( state -> avail_in == 0 && fill_in_buffer ( state ) == - 1 ? - 1 : ( ( state -> avail_in == 0 ? - 1 : ( ( state -> avail_in -- , * ( state -> next_in ++ ) ) ) ) ) ); static int fill_in_buffer(FILE_T state) if ( state -> err )  return - 1 ; if ( state -> eof == 0 )  if ( raw_read ( state , state -> in , state -> size , ( ( unsigned int * ) ( & state -> avail_in ) ) ) == - 1 )  return - 1 ; return 0 ; if ( ch == - 1 )  return - 1 ; return 0 ; return - 1 ; if ( gz_skipn ( state , len ) == - 1 )  static int gz_skipn(FILE_T state,size_t n) while ( n != 0 )  if ( ( ( state -> avail_in == 0 && fill_in_buffer ( state ) == - 1 ? - 1 : ( ( state -> avail_in == 0 ? - 1 : ( ( state -> avail_in -- , * ( state -> next_in ++ ) ) ) ) ) ) ) == - 1 )  return - 1 ; n --; return 0 ; return - 1 ; if ( flags & 8 )  if ( gz_skipzstr ( state ) == - 1 )  static int gz_skipzstr(FILE_T state) int ch ; while ( ( ch = ( state -> avail_in == 0 && fill_in_buffer ( state ) == - 1 ? - 1 : ( ( state -> avail_in == 0 ? - 1 : ( ( state -> avail_in -- , * ( state -> next_in ++ ) ) ) ) ) ) ) > 0 )  static int fill_in_buffer(FILE_T state) if ( state -> err )  return - 1 ; if ( state -> eof == 0 )  if ( raw_read ( state , state -> in , state -> size , ( ( unsigned int * ) ( & state -> avail_in ) ) ) == - 1 )  return - 1 ; return 0 ; if ( ch == - 1 )  return - 1 ; return 0 ; return - 1 ; if ( flags & 16 )  if ( gz_skipzstr ( state ) == - 1 )  static int gz_skipzstr(FILE_T state) int ch ; while ( ( ch = ( state -> avail_in == 0 && fill_in_buffer ( state ) == - 1 ? - 1 : ( ( state -> avail_in == 0 ? - 1 : ( ( state -> avail_in -- , * ( state -> next_in ++ ) ) ) ) ) ) ) > 0 )  if ( ch == - 1 )  return - 1 ; return 0 ; return - 1 ; if ( flags & 2 )  if ( gz_next2 ( state , & hcrc ) == - 1 )  static int gz_next2(FILE_T state,guint16 *ret) guint16 val ; int ch ; val = ( ( state -> avail_in == 0 && fill_in_buffer ( state ) == - 1 ? - 1 : ( ( state -> avail_in == 0 ? - 1 : ( ( state -> avail_in -- , * ( state -> next_in ++ ) ) ) ) ) ) ); ch = ( state -> avail_in == 0 && fill_in_buffer ( state ) == - 1 ? - 1 : ( ( state -> avail_in == 0 ? - 1 : ( ( state -> avail_in -- , * ( state -> next_in ++ ) ) ) ) ) ); if ( ch == - 1 )  return - 1 ; return 0 ; return - 1 ; return 0 ; return 0 ; return - 1 ; if ( state -> have )  return 0 ; if ( state -> compression == 1 )  if ( raw_read ( state , state -> out , state -> size , & state -> have ) == - 1 )  static int raw_read(FILE_T state,unsigned char *buf,unsigned int count,unsigned int *have) int ret ; * have = 0; ret = ( read ( state -> fd , ( buf + * have ) , ( count - * have ) ) ); if ( ret <= 0 )  * have += ret; state -> raw_pos += ret; while ( * have < count )  if ( ret < 0 )  return - 1 ; return 0 ; return - 1 ; return 0 ; return - 1 ; return 0 ; if ( file -> have )  n = ( file -> have > len ? len : file -> have ); memcpy ( buf , ( file -> next ) , n ); file -> next += n; file -> have -= n; if ( file -> err )  if ( file -> eof && file -> avail_in == 0 )  if ( fill_out_buffer ( file ) == - 1 )  static int fill_out_buffer(FILE_T state) if ( state -> compression == 0 )  if ( gz_head ( state ) == - 1 )  if ( state -> have )  if ( state -> compression == 1 )  if ( raw_read ( state , state -> out , state -> size , & state -> have ) == - 1 )  state -> next = state -> out; if ( state -> compression == 2 )  zlib_read ( state , state -> out , state -> size << 1 ); static void zlib_read(FILE_T state,unsigned char *buf,unsigned int count) z_streamp strm = & state -> strm ; unsigned char * buf2 = buf ; unsigned int count2 = count ; strm -> avail_out = count; strm -> next_out = buf; if ( state -> avail_in == 0 && fill_in_buffer ( state ) == - 1 )  static int fill_in_buffer(FILE_T state) if ( state -> err )  if ( state -> eof == 0 )  if ( raw_read ( state , state -> in , state -> size , ( ( unsigned int * ) ( & state -> avail_in ) ) ) == - 1 )  state -> next_in = state -> in; if ( state -> avail_in == 0 )  state -> err = - 12; state -> err_info = ( ( void * ) 0 ); strm -> avail_in = state -> avail_in; strm -> next_in = state -> next_in; ret = inflate ( strm , 5 ); state -> avail_in = strm -> avail_in; state -> next_in = strm -> next_in; if ( ret == - 2 )  state -> err = - 21; state -> err_info = ( strm -> msg ); if ( ret == 2 )  state -> err = - 21; state -> err_info = "preset dictionary needed"; if ( ret == - 4 )  state -> err = 12; state -> err_info = ( ( void * ) 0 ); if ( ret == - 3 )  state -> err = - 21; state -> err_info = ( strm -> msg ); strm -> adler = crc32 ( strm -> adler , buf2 , count2 - strm -> avail_out ); if ( state -> fast_seek_cur )  struct zlib_cur_seek_point * cur = ( struct zlib_cur_seek_point * ) ( state -> fast_seek_cur ) ; unsigned int ready = count2 - strm -> avail_out ; if ( ready < 32768 )  unsigned int left = 32768 - cur -> pos ; if ( ready >= left )  memcpy ( ( cur -> window + cur -> pos ) , buf2 , left ); if ( ready != left )  memcpy ( ( cur -> window ) , ( buf2 + left ) , ( ready - left ) ); cur -> pos = ready - left; cur -> have += ready; memcpy ( ( cur -> window + cur -> pos ) , buf2 , ready ); cur -> pos += ready; cur -> have += ready; if ( cur -> have >= 32768 )  cur -> have = 32768; memcpy ( ( cur -> window ) , ( buf2 + ( ready - 32768 ) ) , 32768 ); cur -> pos = 0; cur -> have = 32768; if ( cur -> have >= 32768 && ret != 1 && strm -> data_type & 128 && ! ( strm -> data_type & 64 ) )  zlib_fast_seek_add ( state , cur , strm -> data_type & 7 , state -> raw_pos - ( strm -> avail_in ) , state -> pos + ( count - strm -> avail_out ) ); static void zlib_fast_seek_add(FILE_T file,struct zlib_cur_seek_point *point,int bits,gint64 in_pos,gint64 out_pos) struct fast_seek_point * item = ( struct fast_seek_point * ) file -> fast_seek -> pdata [ file -> fast_seek -> len - 1 ] ; if ( item -> out + 1048576L < out_pos )  val -> in = in_pos; val -> out = out_pos; val -> compression = 2; val -> data . zlib . bits = bits; if ( point -> pos != 0 )  unsigned int left = 32768 - point -> pos ; memcpy ( val -> data . zlib . window , ( point -> window + point -> pos ) , left ); memcpy ( ( val -> data . zlib . window + left ) , ( point -> window ) , ( point -> pos ) ); memcpy ( val -> data . zlib . window , ( point -> window ) , 32768 ); val -> data . zlib . adler = file -> strm . adler; val -> data . zlib . total_out = file -> strm . total_out; g_ptr_array_add ( file -> fast_seek , val ); buf2 = buf2 + count2 - strm -> avail_out; count2 = strm -> avail_out; while ( strm -> avail_out && ret != 1 )  state -> next = buf; state -> have = count - strm -> avail_out; if ( ret == 1 )  if ( gz_next4 ( state , & crc ) != - 1 && gz_next4 ( state , & len ) != - 1 )  static int gz_next4(FILE_T state,guint32 *ret) val = ( ( state -> avail_in == 0 && fill_in_buffer ( state ) == - 1 ? - 1 : ( ( state -> avail_in == 0 ? - 1 : ( ( state -> avail_in -- , * ( state -> next_in ++ ) ) ) ) ) ) ); val += ( ( unsigned int ) ( ( state -> avail_in == 0 && fill_in_buffer ( state ) == - 1 ? - 1 : ( ( state -> avail_in == 0 ? - 1 : ( ( state -> avail_in -- , * ( state -> next_in ++ ) ) ) ) ) ) ) ) << 8; val += ( ( guint32 ) ( ( state -> avail_in == 0 && fill_in_buffer ( state ) == - 1 ? - 1 : ( ( state -> avail_in == 0 ? - 1 : ( ( state -> avail_in -- , * ( state -> next_in ++ ) ) ) ) ) ) ) ) << 16; ch = ( state -> avail_in == 0 && fill_in_buffer ( state ) == - 1 ? - 1 : ( ( state -> avail_in == 0 ? - 1 : ( ( state -> avail_in -- , * ( state -> next_in ++ ) ) ) ) ) ); if ( ch == - 1 )  if ( state -> err == 0 )  state -> err = - 12; state -> err_info = ( ( void * ) 0 ); val += ( ( guint32 ) ch ) << 24; * ret = val; static int gz_next4(FILE_T state,guint32 *ret) val = ( ( state -> avail_in == 0 && fill_in_buffer ( state ) == - 1 ? - 1 : ( ( state -> avail_in == 0 ? - 1 : ( ( state -> avail_in -- , * ( state -> next_in ++ ) ) ) ) ) ) ); static int fill_in_buffer(FILE_T state) if ( state -> err )  if ( state -> eof == 0 )  if ( raw_read ( state , state -> in , state -> size , ( ( unsigned int * ) ( & state -> avail_in ) ) ) == - 1 )  state -> next_in = state -> in; val += ( ( unsigned int ) ( ( state -> avail_in == 0 && fill_in_buffer ( state ) == - 1 ? - 1 : ( ( state -> avail_in == 0 ? - 1 : ( ( state -> avail_in -- , * ( state -> next_in ++ ) ) ) ) ) ) ) ) << 8; static int fill_in_buffer(FILE_T state) if ( state -> err )  if ( state -> eof == 0 )  if ( raw_read ( state , state -> in , state -> size , ( ( unsigned int * ) ( & state -> avail_in ) ) ) == - 1 )  state -> next_in = state -> in; val += ( ( guint32 ) ( ( state -> avail_in == 0 && fill_in_buffer ( state ) == - 1 ? - 1 : ( ( state -> avail_in == 0 ? - 1 : ( ( state -> avail_in -- , * ( state -> next_in ++ ) ) ) ) ) ) ) ) << 16; static int fill_in_buffer(FILE_T state) if ( state -> err )  if ( state -> eof == 0 )  if ( raw_read ( state , state -> in , state -> size , ( ( unsigned int * ) ( & state -> avail_in ) ) ) == - 1 )  state -> next_in = state -> in; ch = ( state -> avail_in == 0 && fill_in_buffer ( state ) == - 1 ? - 1 : ( ( state -> avail_in == 0 ? - 1 : ( ( state -> avail_in -- , * ( state -> next_in ++ ) ) ) ) ) ); static int fill_in_buffer(FILE_T state) if ( state -> err )  if ( state -> eof == 0 )  if ( raw_read ( state , state -> in , state -> size , ( ( unsigned int * ) ( & state -> avail_in ) ) ) == - 1 )  state -> next_in = state -> in; if ( ch == - 1 )  if ( state -> err == 0 )  state -> err = - 12; state -> err_info = ( ( void * ) 0 ); val += ( ( guint32 ) ch ) << 24; * ret = val; if ( crc != strm -> adler && ! state -> dont_check_crc )  state -> err = - 21; state -> err_info = "bad CRC"; if ( len != ( strm -> total_out & 0xffffffffL ) )  state -> err = - 21; state -> err_info = "length field wrong"; state -> compression = 0; g_free ( state -> fast_seek_cur ); state -> fast_seek_cur = ( ( void * ) 0 ); len -= n; buf = ( ( ( char * ) buf ) + n ); file -> pos += n; while ( len )  