ROOTANA
mlz4frame_static.h
Go to the documentation of this file.
1 /*
2  LZ4 auto-framing library
3  Header File for static linking only
4  Copyright (C) 2011-2015, Yann Collet.
5 
6  BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php)
7 
8  Redistribution and use in source and binary forms, with or without
9  modification, are permitted provided that the following conditions are
10  met:
11 
12  * Redistributions of source code must retain the above copyright
13  notice, this list of conditions and the following disclaimer.
14  * Redistributions in binary form must reproduce the above
15  copyright notice, this list of conditions and the following disclaimer
16  in the documentation and/or other materials provided with the
17  distribution.
18 
19  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 
31  You can contact the author at :
32  - LZ4 source repository : https://github.com/Cyan4973/lz4
33  - LZ4 public forum : https://groups.google.com/forum/#!forum/lz4c
34 */
35 
36 #pragma once
37 
38 //#if defined (__cplusplus)
39 //extern "C" {
40 //#endif
41 
42 /* lz4frame_static.h should be used solely in the context of static linking.
43  * It contains definitions which may still change overtime.
44  * Never use it in the context of DLL linking.
45  * */
46 
47 
48 /**************************************
49 * Includes
50 **************************************/
51 #include "mlz4frame.h"
52 
53 
54 /**************************************
55  * Error management
56  * ************************************/
57 #define MLZ4F_LIST_ERRORS(ITEM) \
58  ITEM(OK_NoError) ITEM(ERROR_GENERIC) \
59  ITEM(ERROR_maxBlockSize_invalid) ITEM(ERROR_blockMode_invalid) ITEM(ERROR_contentChecksumFlag_invalid) \
60  ITEM(ERROR_compressionLevel_invalid) \
61  ITEM(ERROR_headerVersion_wrong) ITEM(ERROR_blockChecksum_unsupported) ITEM(ERROR_reservedFlag_set) \
62  ITEM(ERROR_allocation_failed) \
63  ITEM(ERROR_srcSize_tooLarge) ITEM(ERROR_dstMaxSize_tooSmall) \
64  ITEM(ERROR_frameHeader_incomplete) ITEM(ERROR_frameType_unknown) ITEM(ERROR_frameSize_wrong) \
65  ITEM(ERROR_srcPtr_wrong) \
66  ITEM(ERROR_decompressionFailed) \
67  ITEM(ERROR_headerChecksum_invalid) ITEM(ERROR_contentChecksum_invalid) \
68  ITEM(ERROR_maxCode)
69 
70 //#define MLZ4F_DISABLE_OLD_ENUMS
71 #ifndef MLZ4F_DISABLE_OLD_ENUMS
72 #define MLZ4F_GENERATE_ENUM(ENUM) MLZ4F_##ENUM, ENUM = MLZ4F_##ENUM,
73 #else
74 #define MLZ4F_GENERATE_ENUM(ENUM) MLZ4F_##ENUM,
75 #endif
76 typedef enum { MLZ4F_LIST_ERRORS(MLZ4F_GENERATE_ENUM) } MLZ4F_errorCodes; /* enum is exposed, to handle specific errors; compare function result to -enum value */
77 
78 
79 //#if defined (__cplusplus)
80 //}
81 //#endif
MLZ4F_errorCodes
#define MLZ4F_LIST_ERRORS(ITEM)
#define MLZ4F_GENERATE_ENUM(ENUM)