AnimaEngine  1.0.0
Nintendo DS Pokemon Black, White, Black 2, and White 2 sprite extraction and preview toolchain
narc.h
Go to the documentation of this file.
1 
6 #ifndef NARC_H
7 #define NARC_H
8 
9 #include "common.h"
10 
14 typedef struct NarcArchive {
15  const u8 *data;
16  size_t size;
25 
29 typedef struct NarcMemberRange {
31  u32 end;
34 
42 int Narc_Init(NarcArchive *narc, const u8 *data, size_t size);
43 
52  const NarcArchive *narc,
53  int member_id,
54  NarcMemberRange *out_range
55 );
56 
66  const NarcArchive *narc,
67  int member_id,
68  u8 **out_data,
69  size_t *out_size
70 );
71 
76 void Narc_PrintInfo(const NarcArchive *narc);
77 
78 #endif
Common types, macros, and standard library includes used throughout AnimaEngine.
unsigned int u32
Definition: common.h:16
unsigned char u8
Definition: common.h:14
struct NarcArchive NarcArchive
Structure containing offsets and metadata representing an active .NARC archive file.
struct NarcMemberRange NarcMemberRange
Offset and size boundaries of an individual member file within the NARC database.
int Narc_GetMemberRange(const NarcArchive *narc, int member_id, NarcMemberRange *out_range)
Resolves the file offset boundaries of an archived member index.
Definition: narc.c:99
int Narc_ExtractMember(const NarcArchive *narc, int member_id, u8 **out_data, size_t *out_size)
Copies/extracts an archived member from NARC into a separate buffer.
Definition: narc.c:146
void Narc_PrintInfo(const NarcArchive *narc)
Debug printer function writing NARC layout stats to console stdout.
Definition: narc.c:180
int Narc_Init(NarcArchive *narc, const u8 *data, size_t size)
Initializes and validates a NarcArchive from raw binary data.
Definition: narc.c:5
Structure containing offsets and metadata representing an active .NARC archive file.
Definition: narc.h:14
u32 btnf_offset
Definition: narc.h:19
const u8 * data
Definition: narc.h:15
u32 gmif_offset
Definition: narc.h:20
u32 btaf_offset
Definition: narc.h:18
size_t size
Definition: narc.h:16
u32 gmif_data_offset
Definition: narc.h:21
u32 file_count
Definition: narc.h:23
Offset and size boundaries of an individual member file within the NARC database.
Definition: narc.h:29
u32 size
Definition: narc.h:32
u32 start
Definition: narc.h:30
u32 end
Definition: narc.h:31