Source code of Windows XP (NT5)
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.

81 lines
2.2 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 2000.
  5. //
  6. // File: Cab.h
  7. //
  8. // Contents: Header file for function proto types for cab.cpp.
  9. //
  10. // Objects:
  11. //
  12. // Coupling:
  13. //
  14. // Notes:
  15. //
  16. // History: 9/21/00 SHeffner Copied from Originaly Millennium code
  17. //
  18. //----------------------------------------------------------------------------
  19. #include <fci.h>
  20. #include <fcntl.h>
  21. #ifndef _CAB_FILE_
  22. #define _CAB_FILE_
  23. /////////////////////////////
  24. // CABBING API DEFINITIONS //
  25. ////////////////////////////
  26. /*
  27. * When a CAB file reaches this size, a new CAB will be created
  28. * automatically. This is useful for fitting CAB files onto disks.
  29. *
  30. * If you want to create just one huge CAB file with everything in
  31. * it, change this to a very very large number.
  32. */
  33. #define MEDIA_SIZE 30000000
  34. /*
  35. * When a folder has this much compressed data inside it,
  36. * automatically flush the folder.
  37. *
  38. * helps random access significantly.
  39. * Flushing the folder hurts compression a little bit, but
  40. */
  41. #define FOLDER_THRESHOLD 900000
  42. /*
  43. * Compression type to use
  44. */
  45. #define COMPRESSION_TYPE tcompTYPE_MSZIP
  46. /*
  47. * Our internal state
  48. * The FCI APIs allow us to pass back a state pointer of our own
  49. */
  50. typedef struct
  51. {
  52. long total_compressed_size; /* total compressed size so far */
  53. long total_uncompressed_size; /* total uncompressed size so far */
  54. } client_state;
  55. //////////////////////////////////////////////////////////////////////////////
  56. //+---------------------------------------------------------------------------
  57. //
  58. // Function proto typing
  59. //
  60. //----------------------------------------------------------------------------
  61. void set_cab_parameters(PCCAB cab_parms);
  62. HFCI create_cab();
  63. bool test_fci(HFCI hfci, int num_files, char *file_list[], char *currdir);
  64. BOOL flush_cab(HFCI hfci);
  65. int get_percentage(unsigned long a, unsigned long b);
  66. DWORD strGenerateCabFileName(char *lpBuffer, DWORD dSize);
  67. char *return_fci_error_string(FCIERROR err);
  68. void strip_path(char *filename, char *stripped_name);
  69. // void FNFCIGETOPENINFO(get_open_info);
  70. #endif //End of _CAB_FILE_ define