Leaked source code of windows server 2003
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.

70 lines
1.6 KiB

  1. /*
  2. * defctxt.h
  3. *
  4. * Deflate context
  5. */
  6. typedef unsigned short t_search_node;
  7. typedef unsigned int t_match_pos;
  8. typedef enum
  9. {
  10. STATE_NORMAL,
  11. STATE_OUTPUTTING_TREE_STRUCTURE,
  12. STATE_OUTPUTTING_BLOCK
  13. } t_encoder_state;
  14. struct fast_encoder;
  15. struct optimal_encoder;
  16. struct std_encoder;
  17. //
  18. // Context info common to all encoders
  19. //
  20. typedef struct
  21. {
  22. t_encoder_state state;
  23. unsigned long outputting_block_bitbuf;
  24. int outputting_block_bitcount;
  25. byte * outputting_block_bufptr;
  26. unsigned int outputting_block_current_literal;
  27. unsigned int outputting_block_num_literals;
  28. long bufpos;
  29. long bufpos_end;
  30. // output buffer
  31. BYTE * output_curpos;
  32. BYTE * output_endpos;
  33. BYTE * output_near_end_threshold;
  34. // bit buffer variables for outputting data
  35. unsigned long bitbuf;
  36. int bitcount;
  37. // varies; std/optimal encoders use the normal 32K window, while the fast
  38. // encoder uses a smaller window
  39. long window_size;
  40. struct std_encoder * std_encoder;
  41. struct optimal_encoder *optimal_encoder;
  42. struct fast_encoder * fast_encoder;
  43. BOOL no_more_input;
  44. // have we output "bfinal=1"?
  45. BOOL marked_final_block;
  46. // do we need to call ResetCompression() before we start compressing?
  47. BOOL fNeedToResetCompression;
  48. // if GZIP, have we output the GZIP header?
  49. BOOL using_gzip;
  50. BOOL gzip_fOutputGzipHeader;
  51. ULONG gzip_crc32;
  52. ULONG gzip_input_stream_size;
  53. } t_encoder_context;