summaryrefslogtreecommitdiff
path: root/utils/ipodpatcher/ipodpatcher.h
diff options
context:
space:
mode:
Diffstat (limited to 'utils/ipodpatcher/ipodpatcher.h')
-rw-r--r--utils/ipodpatcher/ipodpatcher.h84
1 files changed, 84 insertions, 0 deletions
diff --git a/utils/ipodpatcher/ipodpatcher.h b/utils/ipodpatcher/ipodpatcher.h
new file mode 100644
index 0000000000..2cd2331666
--- /dev/null
+++ b/utils/ipodpatcher/ipodpatcher.h
@@ -0,0 +1,84 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2006-2007 Dave Chapman
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21
22#ifndef IPODPATCHER_H
23#define IPODPATCHER_H
24
25#ifdef __cplusplus
26extern "C" {
27#endif
28
29#include "ipodio.h"
30
31/* exit codes */
32#define IPOD_OK 0
33#define IPOD_WRONG_ARGUMENTS 1
34#define IPOD_OPEN_INFILE_FAILED 2
35#define IPOD_PARTITION_ERROR 3
36#define IPOD_OPEN_OUTFILE_FAILED 4
37#define IPOD_CANNOT_REOPEN 5
38#define IPOD_ACCESS_DENIED 10
39#define IPOD_NOT_FOUND 11
40#define IPOD_WRONG_DEVICE_COUNT 12
41#define IPOD_IMAGE_ERROR 13
42#define IPOD_DUMP_FAILED 14
43#define IPOD_MULTIPLE_DEVICES 15
44#define IPOD_WRONG_TYPE 16
45#define IPOD_UNKNOWN_FW_VERSION -1
46
47/* Size of buffer for disk I/O - 8MB is large enough for any version
48 of the Apple firmware, but not the Nano's RSRC image. */
49#define BUFFER_SIZE 8*1024*1024
50
51extern int ipod_verbose;
52
53#define FILETYPE_DOT_IPOD 0
54#define FILETYPE_DOT_BIN 1
55#ifdef WITH_BOOTOBJS
56 #define FILETYPE_INTERNAL 2
57#endif
58
59char* get_parttype(unsigned int pt);
60int read_partinfo(struct ipod_t* ipod, int silent);
61int read_partition(struct ipod_t* ipod, int outfile);
62int write_partition(struct ipod_t* ipod, int infile);
63int diskmove(struct ipod_t* ipod, int delta);
64int add_bootloader(struct ipod_t* ipod, char* filename, int type);
65int delete_bootloader(struct ipod_t* ipod);
66int write_firmware(struct ipod_t* ipod, char* filename, int type);
67int read_firmware(struct ipod_t* ipod, char* filename, int type);
68int read_directory(struct ipod_t* ipod);
69int list_images(struct ipod_t* ipod);
70int getmodel(struct ipod_t* ipod, int ipod_version);
71int ipod_scan(struct ipod_t* ipod);
72int write_dos_partition_table(struct ipod_t* ipod);
73int ipod_get_xmlinfo(struct ipod_t* ipod);
74void ipod_get_ramsize(struct ipod_t* ipod);
75int read_aupd(struct ipod_t* ipod, char* filename);
76int write_aupd(struct ipod_t* ipod, char* filename);
77off_t filesize(int fd);
78int ipod_has_bootloader(struct ipod_t* ipod);
79
80#ifdef __cplusplus
81}
82#endif
83#endif
84