Richard Boegli's CnC_Generals_Zero_Hour Fork WIP
This is documentation of Richard Boegil's Zero Hour Fork
 
Loading...
Searching...
No Matches
btreeabout.cpp
Go to the documentation of this file.
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
19// Copyright (C) Electronic Arts Canada Inc. 1995-2002. All rights reserved.
20
21/* ABSTRACT */
22/*------------------------------------------------------------------*/
23/* */
24/* BTree - Binary Tree Codex */
25/* */
26/* by FrANK G. Barchard, EAC */
27/* */
28/*------------------------------------------------------------------*/
29/* */
30/* Version Date SE History: */
31/* ------- ---- -- -------- */
32/* 1.00 950108 FB BTree codex based on hufftree and ref codex */
33/* 1.01 970117 FB encode check index before going off array */
34/* 1.02 020716 FB allocate percentage more buffer for large files*/
35/* */
36/*------------------------------------------------------------------*/
37/* */
38/* Module Notes: */
39/* ------------- */
40/* Reentrant */
41/* Files: btrread.c btrwrite.c btrcodex.h */
42/* */
43/*------------------------------------------------------------------*/
44/* */
45/* Format Notes: */
46/* ------------- */
47/* BTree is an EA proprietary compression scheme by Frank Barchard. */
48/* Each byte is either a raw byte (leaf) or node that points to */
49/* 2 other nodes. Each node is either a simple byte or 2 nodes. */
50/* The stream is simple bytes and uses bytes for nodes that werent */
51/* used in the original file. */
52/* */
53/* BTREE (fb6) header format: */
54/* -------------------------- */
55/* */
56/* offset bytes notes */
57/* id 0 2 id is 46fb */
58/* ulen 2 3 total unpacked len */
59/* ilen* 2/5 3 unpacked len for this file */
60/* clue 5/8 1 */
61/* nodes 6/9 1 number of nodes */
62/* { */
63/* node 7/10+3n 1 */
64/* left 8/11+3n 1 */
65/* right 9/12+3n 1 */
66/* } */
67/* */
68/* [packed data] */
69/* [explicitely packed last byte] */
70/* */
71/* * present if composite packed */
72/* */
73/*------------------------------------------------------------------*/
74/* END ABSTRACT */
75
76#include <string.h>
77#include "codex.h"
78#include "btreecodex.h"
79
80/****************************************************************/
81/* Information Functions */
82/****************************************************************/
83
85{
86 CODEXABOUT* info;
87
88 info = (CODEXABOUT*) galloc(sizeof(CODEXABOUT));
89 if (info)
90 {
91 memset(info, 0, sizeof(CODEXABOUT));
92
93 info->signature = QMAKEID('B','T','R','E');
94 info->size = sizeof(CODEXABOUT);
95 info->version = 200; /* codex version number (200) */
96 info->decode = 1; /* supports decoding */
97 info->encode = 1; /* supports encoding */
98 info->size32 = 0; /* supports 32 bit size field */
99 strcpy(info->versionstr, "1.02"); /* version # */
100 strcpy(info->shorttypestr, "btr"); /* type */
101 strcpy(info->longtypestr, "BTree"); /* longtype */
102 }
103 return(info);
104}
105
#define galloc
Definition gimex.h:356
CODEXABOUT *GCALL BTREE_about(void)
#define GCALL
Definition codex.h:81
#define QMAKEID(a, b, c, d)
Definition codex.h:75
unsigned int size32
Definition codex.h:67
unsigned int encode
Definition codex.h:66
int signature
Definition codex.h:61
char shorttypestr[8]
Definition codex.h:71
int size
Definition codex.h:62
unsigned int decode
Definition codex.h:65
char longtypestr[16]
Definition codex.h:72
int version
Definition codex.h:63
char versionstr[8]
Definition codex.h:70