liblzg  1.0.8
 All Data Structures Files Functions Variables Typedefs Macros
lzg.h
Go to the documentation of this file.
1 /* -*- mode: c; tab-width: 4; indent-tabs-mode: nil; -*- */
2 
3 /*
4 * This file is part of liblzg.
5 *
6 * Copyright (c) 2010-2014 Marcus Geelnard
7 *
8 * This software is provided 'as-is', without any express or implied
9 * warranty. In no event will the authors be held liable for any damages
10 * arising from the use of this software.
11 *
12 * Permission is granted to anyone to use this software for any purpose,
13 * including commercial applications, and to alter it and redistribute it
14 * freely, subject to the following restrictions:
15 *
16 * 1. The origin of this software must not be misrepresented; you must not
17 * claim that you wrote the original software. If you use this software
18 * in a product, an acknowledgment in the product documentation would
19 * be appreciated but is not required.
20 *
21 * 2. Altered source versions must be plainly marked as such, and must not
22 * be misrepresented as being the original software.
23 *
24 * 3. This notice may not be removed or altered from any source
25 * distribution.
26 */
27 
28 #ifndef _LIBLZG_H_
29 #define _LIBLZG_H_
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
35 #define LZG_VERSION "1.0.8"
36 #define LZG_VERNUM 0x01000008
38 #define LZG_VER_MAJOR 1
39 #define LZG_VER_MINOR 0
40 #define LZG_VER_REVISION 8
136 /* Basic types */
137 typedef int lzg_bool_t;
138 typedef int lzg_int32_t;
139 typedef unsigned int lzg_uint32_t;
141 #define LZG_FALSE 0
142 #define LZG_TRUE 1
144 /* Compression levels */
145 #define LZG_LEVEL_1 1
146 #define LZG_LEVEL_2 2
147 #define LZG_LEVEL_3 3
148 #define LZG_LEVEL_4 4
149 #define LZG_LEVEL_5 5
150 #define LZG_LEVEL_6 6
151 #define LZG_LEVEL_7 7
152 #define LZG_LEVEL_8 8
153 #define LZG_LEVEL_9 9
156 #define LZG_LEVEL_DEFAULT LZG_LEVEL_5
163 typedef void (*LZGPROGRESSFUN)(lzg_int32_t progress, void *userdata);
171 typedef struct {
179  lzg_int32_t level;
188  lzg_bool_t fast;
197  LZGPROGRESSFUN progressfun;
206  void *userdata;
208 
209 
216 lzg_uint32_t LZG_MaxEncodedSize(lzg_uint32_t insize);
217 
223 
241 lzg_uint32_t LZG_Encode(const unsigned char *in, lzg_uint32_t insize,
242  unsigned char *out, lzg_uint32_t outsize,
243  lzg_encoder_config_t *config);
244 
245 
256 lzg_uint32_t LZG_DecodedSize(const unsigned char *in, lzg_uint32_t insize);
257 
258 
269 lzg_uint32_t LZG_Decode(const unsigned char *in, lzg_uint32_t insize,
270  unsigned char *out, lzg_uint32_t outsize);
271 
272 
278 lzg_uint32_t LZG_Version(void);
279 
280 
286 const char* LZG_VersionString(void);
287 
288 #ifdef __cplusplus
289 }
290 #endif
291 
292 #endif // _LIBLZG_H_
void LZG_InitEncoderConfig(lzg_encoder_config_t *config)
void(* LZGPROGRESSFUN)(lzg_int32_t progress, void *userdata)
Definition: lzg.h:164
lzg_uint32_t LZG_Encode(const unsigned char *in, lzg_uint32_t insize, unsigned char *out, lzg_uint32_t outsize, lzg_encoder_config_t *config)
int lzg_int32_t
Signed 32-bit integer.
Definition: lzg.h:139
lzg_uint32_t LZG_DecodedSize(const unsigned char *in, lzg_uint32_t insize)
lzg_uint32_t LZG_MaxEncodedSize(lzg_uint32_t insize)
lzg_uint32_t LZG_Version(void)
LZG compression configuration parameters.
Definition: lzg.h:172
lzg_uint32_t LZG_Decode(const unsigned char *in, lzg_uint32_t insize, unsigned char *out, lzg_uint32_t outsize)
unsigned int lzg_uint32_t
Unsigned 32-bit integer.
Definition: lzg.h:140
int lzg_bool_t
Boolean (LZG_TRUE/LZG_FALSE)
Definition: lzg.h:138
const char * LZG_VersionString(void)