1 /*---------------------------------------------------------------------------*
2   Project:  Horizon
3   File:     cx_SecureUncompression.h
4 
5   Copyright (C)2009-2012 Nintendo Co., Ltd./HAL Laboratory, Inc.  All rights reserved.
6 
7   These coded instructions, statements, and computer programs contain
8   proprietary information of Nintendo of America Inc. and/or Nintendo
9   Company Ltd., and are protected by Federal copyright law.  They may
10   not be disclosed to third parties or copied or duplicated in any form,
11   in whole or in part, without the prior written consent of Nintendo.
12 
13   $Revision: 47717 $
14  *---------------------------------------------------------------------------*/
15 
16 /* Please see man pages for details
17 
18 
19 
20 */
21 
22 #ifndef NN_CX_CX_SECURE_UNCOMPRESSION_H_
23 #define NN_CX_CX_SECURE_UNCOMPRESSION_H_
24 
25 #include <nn/types.h>
26 #include <nn/cx/cx_Uncompression.h>
27 
28 namespace nn {
29 namespace cx {
30 
31 /* Please see man pages for details
32 
33  */
34 enum ErrorCode
35 {
36     ERROR_CODE_SUCCESS            =  0, //
37     ERROR_CODE_UNSUPPORTED        = -1, //
38     ERROR_CODE_DATA_SHORTAGE      = -2, //
39     ERROR_CODE_DATA_REMAINDER     = -3, //
40     ERROR_CODE_BUFFER_OVERRUN     = -4, //
41     ERROR_CODE_ILLEGAL_TABLE      = -5  //
42 };
43 
44 enum
45 {
46     CX_ERR_SUCCESS           = ERROR_CODE_SUCCESS,
47     CX_ERR_UNSUPPORTED       = ERROR_CODE_UNSUPPORTED,
48     CX_ERR_SRC_SHORTAGE      = ERROR_CODE_DATA_SHORTAGE,
49     CX_ERR_SRC_REMAINDER     = ERROR_CODE_DATA_REMAINDER,
50     CX_ERR_DEST_OVERRUN      = ERROR_CODE_BUFFER_OVERRUN,
51     CX_ERR_ILLEGAL_TABLE     = ERROR_CODE_ILLEGAL_TABLE
52 };
53 
54 /* Please see man pages for details
55 
56 
57 */
58 
59 /* Please see man pages for details
60 
61 
62 
63 
64 
65 
66 
67 
68 
69 
70 
71 
72 
73 
74  */
75 s32 SecureUncompressAny( const void* srcp, u32 srcSize, void* destp );
76 
77 
78 /* Please see man pages for details
79 
80 
81 
82 
83 
84 
85 
86 
87 
88  */
89 s32 SecureUncompressRL( const void *srcp, u32 srcSize, void *destp );
90 
91 
92 /* Please see man pages for details
93 
94 
95 
96 
97 
98 
99 
100 
101 
102 
103 
104  */
105 s32 SecureUncompressLZ( const void *srcp, u32 srcSize, void *destp );
106 
107 
108 /* Please see man pages for details
109 
110 
111 
112 
113 
114 
115 
116 
117 
118 
119 
120  */
121 s32 SecureUncompressHuffman( const void *srcp, u32 srcSize, void *destp );
122 
123 
124 /* Please see man pages for details
125 
126 
127 
128 
129 
130 
131  */
132 s32 SecureUncompressLH( const u8* srcp, u32 srcSize, u8* destp, void* work );
133 
134 
135 /* Please see man pages for details
136 
137 
138 
139 
140 
141 
142  */
143 s32 SecureUncompressLRC( const u8* srcp, u32 srcSize, u8* destp, void* work );
144 
145 
146 /* Please see man pages for details
147 
148 
149 
150 
151 
152 
153  */
154 s32 SecureUnfilterDiff( register const void *srcp, u32 srcSize, register void *destp );
155 
156 /* Please see man pages for details
157 
158 
159 
160 
161 
162  */
163 s32 SecureUncompressBLZ(void* pData, size_t dataSize, size_t bufferSize);
164 
165 /*
166 
167 */
168 
169 namespace internal {
170 
171 bool VerifyHuffmanTable( const void* pTable, u8 bit );
172 bool LHVerifyTable( const void* pTable, u8 bit );
173 
174 }   // namespace internal
175 
176 }   // namespace cx
177 }   // namespace nn
178 
179 /* NN_CX_CX_SECURE_UNCOMPRESSION_H_ */
180 #endif
181