1 /*---------------------------------------------------------------------------*
2   Project:  Horizon
3   File:     tpl_crc32.h
4 
5   Copyright (C)2009-2012 Nintendo Co., Ltd.  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   $Rev: 46347 $
14  *---------------------------------------------------------------------------*/
15 
16 #ifndef NN_LIBRARIES_TPL_CTR_TPL_CRC32_H_
17 #define NN_LIBRARIES_TPL_CTR_TPL_CRC32_H_
18 
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22 
23 namespace nn { namespace tpl { namespace CTR {
24 
25 // Implementation to search for texture using the hash (search_crc32_data()) from the texture package (.ctpk) header information.
26 //
27 struct TPK_SEARCH_DATA
28 {
29     const char *szFileName; // Texture filename being searched
30     int fileNameLen;        // Character count for comparison (will change depending on whether extensions are compared)
31     const void *infoData;   // Texture package header information
32 };
33 
34 /* Please see man pages for details
35 
36 */
37 unsigned int calculate_crc32(
38     const void *data,
39     unsigned int size);
40 
41 
42 /* Please see man pages for details
43 
44 
45 
46 
47 
48 
49 
50 */
51 int search_crc32_index(
52     const void *base, unsigned int num, unsigned int width, unsigned int crc);
53 
54 
55 /* Please see man pages for details
56 
57 
58 
59 
60 
61 
62 
63 
64 
65 
66 
67 
68 
69 
70 
71 
72 
73 */
74 int search_crc32_data(
75     const void *base, unsigned int num, unsigned int width, unsigned int crc,
76     const void *value);
77 
78 }}} // Namespace
79 
80 #ifdef __cplusplus
81 }
82 #endif
83 
84 
85 #endif	// NN_LIBRARIES_TPL_CTR_TPL_CRC32_H_
86