refabout.cpp 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. /*
  2. ** Command & Conquer Generals Zero Hour(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. /* RefPack - Backward Reference Codex */
  23. /* */
  24. /* by FrANK G. Barchard, EAC */
  25. /* */
  26. /*------------------------------------------------------------------*/
  27. /* */
  28. /* Version Date SE History: */
  29. /* ------- ---- -- -------- */
  30. /* 0.10 941010 FB First codex prototype module */
  31. /* 0.90 941019 FB #includable */
  32. /* 1.00 950108 FB frozen API at 1.00 */
  33. /* 1.01 010426 FB 32 size field */
  34. /* */
  35. /*------------------------------------------------------------------*/
  36. /* */
  37. /* Module Notes: */
  38. /* ------------- */
  39. /* used hash table and link table for speed */
  40. /* Reentrant */
  41. /* Files: refread.c refwrite.c refcodex.h (refmatch.asm pc) */
  42. /* */
  43. /*------------------------------------------------------------------*/
  44. /* */
  45. /* Format Notes: */
  46. /* ------------- */
  47. /* refpack is a sliding window (131k) lzss method, with byte */
  48. /* oriented coding. */
  49. /* */
  50. /* huff fb6 style header: */
  51. /* *10fb fb6 refpack 1.0 reference pack */
  52. /* *90fb fb6 refpack 1.01 32 bit reference pack */
  53. /* */
  54. /* */
  55. /* header: */
  56. /* [10fb] [totalunpacksize] [nextunpacksize] */
  57. /* 2 3 3 */
  58. /* [90fb] [totalunpacksize] [nextunpacksize] */
  59. /* 2 4 4 */
  60. /* */
  61. /* */
  62. /* */
  63. /* format is: */
  64. /* ---------- */
  65. /* 0ffnnndd_ffffffff short ref, f=0..1023,n=3..10,d=0..3 */
  66. /* 10nnnnnn_ddffffff_ffffffff int ref, f=0..16384,n=4..67,d=0..3 */
  67. /* 110fnndd_f.._f.._nnnnnnnn very int,f=0..131071,n=5..1028,d=0..3*/
  68. /* 111ddddd literal, d=4..112 */
  69. /* 111111dd eof, d=0..3 */
  70. /* */
  71. /*------------------------------------------------------------------*/
  72. /* END ABSTRACT */
  73. #include <string.h>
  74. #include "codex.h"
  75. #include "refcodex.h"
  76. /****************************************************************/
  77. /* Information Functions */
  78. /****************************************************************/
  79. CODEXABOUT *GCALL REF_about(void)
  80. {
  81. CODEXABOUT *info;
  82. info = (CODEXABOUT *) galloc(sizeof(CODEXABOUT));
  83. if (info)
  84. {
  85. memset(info, 0, sizeof(CODEXABOUT));
  86. info->signature = QMAKEID(0,'R','E','F');
  87. info->size = sizeof(CODEXABOUT);
  88. info->version = 200; /* codex version number (200) */
  89. info->decode = 1; /* supports decoding */
  90. info->encode = 1; /* supports encoding */
  91. info->size32 = 1; /* supports 32 bit size field */
  92. strcpy(info->versionstr, "1.01"); /* version # */
  93. strcpy(info->shorttypestr, "ref"); /* type */
  94. strcpy(info->longtypestr, "Refpack"); /* longtype */
  95. }
  96. return(info);
  97. }