mirror of
https://github.com/Cesarus85/ringfall-mjolnir-vr.git
synced 2026-10-23 05:00:32 +02:00
75 lines
1.3 KiB
C
75 lines
1.3 KiB
C
/*
|
|
DATA_ENCODING.H
|
|
|
|
header included in hcex build.
|
|
*/
|
|
|
|
#ifndef __DATA_ENCODING_H
|
|
#define __DATA_ENCODING_H
|
|
#pragma once
|
|
|
|
/* ---------- constants */
|
|
|
|
/* ---------- macros */
|
|
|
|
/* ---------- structures */
|
|
|
|
struct data_encoding_state
|
|
{
|
|
byte *buffer;
|
|
long offset;
|
|
long buffer_size;
|
|
boolean overflow;
|
|
byte pad[3];
|
|
};
|
|
|
|
/* ---------- prototypes/DATA_ENCODING.C */
|
|
|
|
void data_encode_new(
|
|
struct data_encoding_state *state,
|
|
void *buffer,
|
|
long buffer_size);
|
|
|
|
void data_encode_memory(
|
|
struct data_encoding_state *state,
|
|
void const *source,
|
|
long element_count,
|
|
long element_size);
|
|
|
|
void data_encode_integer(
|
|
struct data_encoding_state *state,
|
|
long value,
|
|
long maximum_value);
|
|
|
|
void data_encode_string(
|
|
struct data_encoding_state *state,
|
|
char const *string,
|
|
long maximum_length);
|
|
|
|
void data_decode_new(
|
|
struct data_encoding_state *state,
|
|
void const *buffer,
|
|
long buffer_size);
|
|
|
|
void *data_decode_memory(
|
|
struct data_encoding_state *state,
|
|
long element_count,
|
|
long element_size);
|
|
|
|
byte data_decode_byte(
|
|
struct data_encoding_state *state);
|
|
|
|
long data_decode_integer(
|
|
struct data_encoding_state *state,
|
|
long maximum_value);
|
|
|
|
char *data_decode_string(
|
|
struct data_encoding_state *state,
|
|
long maximum_length);
|
|
|
|
/* ---------- globals */
|
|
|
|
/* ---------- public code */
|
|
|
|
#endif // __DATA_ENCODING_H
|