func: char *file_gets(char *buf,int len,FILE_T file) unsigned int left ; unsigned int n ; unsigned char * eol ; if ( buf == ( ( void * ) 0 ) || len < 1 )  if ( file -> err )  if ( file -> seek )  file -> seek = 0; if ( gz_skip ( file , file -> skip ) == - 1 )  left = ( ( unsigned int ) len ) - 1; if ( left )  if ( file -> have == 0 )  if ( file -> err )  if ( fill_out_buffer ( file ) == - 1 )  if ( file -> have == 0 )  n = ( file -> have > left ? left : file -> have ); eol = ( ( unsigned char * ) ( memchr ( ( file -> next ) , 10 , n ) ) ); if ( eol != ( ( void * ) 0 ) )  n = ( ( unsigned int ) ( eol - file -> next ) ) + 1; file -> have -= n; file -> next += n; file -> pos += n; left -= n; while ( left && eol == ( ( void * ) 0 ) )  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 ; if ( state -> avail_in == 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 ; if ( state -> avail_in && state -> next_in [ 0 ] == 139 )  state -> out [ 0 ] = 31; state -> have = 1; state -> raw = state -> pos; state -> next = state -> out; if ( state -> avail_in )  memcpy ( ( state -> next + state -> have ) , ( state -> next_in ) , ( state -> avail_in ) ); state -> have += state -> avail_in; state -> avail_in = 0; state -> compression = 1; 