AnimaEngine  1.0.0
Nintendo DS Pokemon Black, White, Black 2, and White 2 sprite extraction and preview toolchain
nitro_util.h
Go to the documentation of this file.
1 
6 #ifndef NITRO_UTIL_H
7 #define NITRO_UTIL_H
8 
9 #include "common.h"
10 
18 int Nitro_HasMagic(const u8 *data, size_t size, const char *magic);
19 
30  const u8 *data,
31  size_t size,
32  const char *magic,
33  size_t *out_offset,
34  u32 *out_size
35 );
36 
43 void Nitro_GetPrintableMagic(const u8 *data, size_t size, char out[5]);
44 
50 int Nitro_AbsInt(int value);
51 
57 s32 Nitro_ReadS32LE(const u8 *p);
58 
64 s16 Nitro_ReadS16LE(const u8 *p);
65 
66 #endif
67 
Common types, macros, and standard library includes used throughout AnimaEngine.
signed int s32
Definition: common.h:20
unsigned int u32
Definition: common.h:16
signed short s16
Definition: common.h:19
unsigned char u8
Definition: common.h:14
int Nitro_AbsInt(int value)
Math helper returning absolute value of an integer.
Definition: nitro_util.c:67
int Nitro_FindSection(const u8 *data, size_t size, const char *magic, size_t *out_offset, u32 *out_size)
Searches for a section starting with a specific 4-character magic string.
Definition: nitro_util.c:13
int Nitro_HasMagic(const u8 *data, size_t size, const char *magic)
Verifies if the buffer starts with the target 4-character magic signature.
Definition: nitro_util.c:4
void Nitro_GetPrintableMagic(const u8 *data, size_t size, char out[5])
Safely reads the first 4 bytes of a buffer and formats them as a null-terminated string.
Definition: nitro_util.c:50
s16 Nitro_ReadS16LE(const u8 *p)
Safely reads a little-endian signed 16-bit value.
Definition: nitro_util.c:77
s32 Nitro_ReadS32LE(const u8 *p)
Safely reads a little-endian signed 32-bit value.
Definition: nitro_util.c:72