-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathhfscommon.h
45 lines (28 loc) · 962 Bytes
/
hfscommon.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/* Thomas BERNARD */
#ifndef __HFSCOMMON_H__
#define __HFSCOMMON_H__
#include <stdint.h>
#include <stdio.h>
#define SECTOR_SIZE 512
#define PARTITION_MAP_OFFSET 512
#define HFS_VOLUME_HEADER_OFFSET 1024
struct find_infos {
unsigned char * p; /* struct HFSPlusCatalogFolder or HFSPlusCatalogFile */
uint32_t folder_id;
};
extern uint32_t hfs_part_sector;
extern uint32_t hfs_part_sector_count;
extern uint32_t catalog_node_size;
extern uint32_t catalog_root_node;
uint16_t readu16(const unsigned char * p);
int16_t reads16(const unsigned char * p);
uint32_t readu32(const unsigned char * p);
int read_hfs_volume_header (FILE * f);
unsigned char * load_catalog(FILE * f);
int save_catalog(FILE * f, unsigned char * catalog);
int read_catalog(FILE * f);
int print_node(const unsigned char * p);
int hfs_find(unsigned char * catalog, uint32_t parent_id,
const char * name, struct find_infos * infos);
void read_partition_map(FILE * f);
#endif