• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2    LZ4 auto-framing library
3    Header File for static linking only
4    Copyright (C) 2011-2016, 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/lz4/lz4
33    - LZ4 public forum : https://groups.google.com/forum/#!forum/lz4c
34 */
35 
36 #ifndef LZ4FRAME_STATIC_H_0398209384
37 #define LZ4FRAME_STATIC_H_0398209384
38 
39 #if defined (__cplusplus)
40 extern "C" {
41 #endif
42 
43 /* lz4frame_static.h should be used solely in the context of static linking.
44  * It contains definitions which are not stable and may change in the future.
45  * Never use it in the context of DLL linking.
46  * */
47 
48 
49 /* ---   Dependency   --- */
50 #include "lz4frame.h"
51 
52 
53 /* ---   Error List   --- */
54 #define LZ4F_LIST_ERRORS(ITEM) \
55         ITEM(OK_NoError) ITEM(ERROR_GENERIC) \
56         ITEM(ERROR_maxBlockSize_invalid) ITEM(ERROR_blockMode_invalid) ITEM(ERROR_contentChecksumFlag_invalid) \
57         ITEM(ERROR_compressionLevel_invalid) \
58         ITEM(ERROR_headerVersion_wrong) ITEM(ERROR_blockChecksum_unsupported) ITEM(ERROR_reservedFlag_set) \
59         ITEM(ERROR_allocation_failed) \
60         ITEM(ERROR_srcSize_tooLarge) ITEM(ERROR_dstMaxSize_tooSmall) \
61         ITEM(ERROR_frameHeader_incomplete) ITEM(ERROR_frameType_unknown) ITEM(ERROR_frameSize_wrong) \
62         ITEM(ERROR_srcPtr_wrong) \
63         ITEM(ERROR_decompressionFailed) \
64         ITEM(ERROR_headerChecksum_invalid) ITEM(ERROR_contentChecksum_invalid) \
65         ITEM(ERROR_maxCode)
66 
67 #define LZ4F_DISABLE_OLD_ENUMS   /* comment to enable deprecated enums */
68 #ifndef LZ4F_DISABLE_OLD_ENUMS
69 #  define LZ4F_GENERATE_ENUM(ENUM) LZ4F_##ENUM, ENUM = LZ4F_##ENUM,
70 #else
71 #  define LZ4F_GENERATE_ENUM(ENUM) LZ4F_##ENUM,
72 #endif
73 typedef enum { LZ4F_LIST_ERRORS(LZ4F_GENERATE_ENUM) } LZ4F_errorCodes;  /* enum is exposed, to handle specific errors; compare function result to -enum value */
74 
75 LZ4F_errorCodes LZ4F_getErrorCode(size_t functionResult);
76 
77 
78 #if defined (__cplusplus)
79 }
80 #endif
81 
82 #endif /* LZ4FRAME_STATIC_H_0398209384 */
83