2
* OpenTyrian: A modern cross-platform port of Tyrian
3
* Copyright (C) 2007-2009 The OpenTyrian Development Team
5
* This program is free software; you can redistribute it and/or
6
* modify it under the terms of the GNU General Public License
7
* as published by the Free Software Foundation; either version 2
8
* of the License, or (at your option) any later version.
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.
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
25
typedef struct sizebuf_s
28
unsigned int bufferLen;
29
unsigned int bufferPos;
33
void SZ_Init ( sizebuf_t *, Uint8 *, unsigned int ); /* C style constructor */
34
bool SZ_Error ( sizebuf_t * );
35
void SZ_Memset ( sizebuf_t *, int, size_t ); /* memset with a sizebuf */
36
void SZ_Memcpy ( sizebuf_t *, const Uint8 *, size_t ); /* memcpy with a normal buffer */
37
void SZ_Memcpy2 ( sizebuf_t *, sizebuf_t *, size_t ); /* memcpy with a sizebuf */
38
void SZ_Seek ( sizebuf_t *, long, int ); /* fseek with a sizebuf. */
40
const Uint8 * SZ_GetCurBufferPtr ( sizebuf_t * ); /* Mimic private member, const return */
42
void MSG_WriteByte ( sizebuf_t *, unsigned int );
43
void MSG_WriteWord ( sizebuf_t *, unsigned int );
44
void MSG_WriteDWord ( sizebuf_t *, unsigned int );
46
unsigned int MSG_ReadByte ( sizebuf_t * );
47
unsigned int MSG_ReadWord ( sizebuf_t * );
48
unsigned int MSG_ReadDWord ( sizebuf_t * );