huffabout.cpp 4.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /*
  2. ** Command & Conquer Generals(tm)
  3. ** Copyright 2025 Electronic Arts Inc.
  4. **
  5. ** This program is free software: you can redistribute it and/or modify
  6. ** it under the terms of the GNU General Public License as published by
  7. ** the Free Software Foundation, either version 3 of the License, or
  8. ** (at your option) any later version.
  9. **
  10. ** This program is distributed in the hope that it will be useful,
  11. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ** GNU General Public License for more details.
  14. **
  15. ** You should have received a copy of the GNU General Public License
  16. ** along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. // Copyright (C) Electronic Arts Canada Inc. 1995-2002. All rights reserved.
  19. /* ABSTRACT */
  20. /*------------------------------------------------------------------*/
  21. /* */
  22. /* Huffman - Huffman with Runlength Codex */
  23. /* */
  24. /* by FrANK G. Barchard, EAC */
  25. /* */
  26. /*------------------------------------------------------------------*/
  27. /* */
  28. /* Version Date SE History: */
  29. /* ------- ---- -- -------- */
  30. /* 1.00 950108 FB based on huff and ref codex */
  31. /* 1.01 950316 FB delta huff and delta delta huff */
  32. /* 1.02 950317 FB quick table version (used in wing3) */
  33. /* 1.03 950626 FB allocate context instead of on stack */
  34. /* 1.04 010608 ID forgot to undelta big size buffer fix */
  35. /* */
  36. /*------------------------------------------------------------------*/
  37. /* */
  38. /* Module Notes: */
  39. /* ------------- */
  40. /* Reentrant */
  41. /* Files: hufread.c hufwrite.c hufcodex.h */
  42. /* */
  43. /*------------------------------------------------------------------*/
  44. /* */
  45. /* Format Notes: */
  46. /* ------------- */
  47. /* *30fb fb6 huff 6.1 EOF only huff */
  48. /* *31fb fb6 huff 6.1 ' ' ' composite */
  49. /* *32fb fb6 huff 6.1 EOF only speed */
  50. /* *33fb fb6 huff 6.1 ' ' ' composite */
  51. /* *34fb fb6 huff 6.1 EOF only acceleration */
  52. /* *35fb fb6 huff 6.1 ' ' ' composite */
  53. /* */
  54. /*------------------------------------------------------------------*/
  55. /* END ABSTRACT */
  56. #include <string.h>
  57. #include "codex.h"
  58. #include "huffcodex.h"
  59. /****************************************************************/
  60. /* Information Functions */
  61. /****************************************************************/
  62. CODEXABOUT *GCALL HUFF_about(void)
  63. {
  64. CODEXABOUT *info;
  65. info = (CODEXABOUT *) galloc(sizeof(CODEXABOUT));
  66. if (info)
  67. {
  68. memset(info, 0, sizeof(CODEXABOUT));
  69. info->signature = QMAKEID('H','U','F','F');
  70. info->size = sizeof(CODEXABOUT);
  71. info->version = 200; /* codex version number (200) */
  72. info->decode = 1; /* supports decoding */
  73. info->encode = 1; /* supports encoding */
  74. info->size32 = 0; /* supports 32 bit size field */
  75. strcpy(info->versionstr, "1.04"); /* version # */
  76. strcpy(info->shorttypestr, "huff"); /* type */
  77. strcpy(info->longtypestr, "Huffman"); /* longtype */
  78. }
  79. return(info);
  80. }