blob: 30a1b1e9fd1e121a56147f174d7ef1b9d0489885 [file] [log] [blame]
Dave Chapman79a1fb12007-02-08 23:57:41 +00001/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
Dominik Riebeling7e0fe362009-11-06 23:20:51 +00008 * $Id$
Dave Chapman79a1fb12007-02-08 23:57:41 +00009 *
10 * Copyright (C) 2006-2007 Dave Chapman
11 *
Daniel Stenberg2acc0ac2008-06-28 18:10:04 +000012 * 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.
Dave Chapman79a1fb12007-02-08 23:57:41 +000016 *
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
Dominik Riebeling3f65a702008-05-22 17:51:35 +000025#ifdef __cplusplus
26extern "C" {
27#endif
28
Dave Chapman79a1fb12007-02-08 23:57:41 +000029#include "ipodio.h"
30
31/* Size of buffer for disk I/O - 8MB is large enough for any version
32 of the Apple firmware, but not the Nano's RSRC image. */
33#define BUFFER_SIZE 8*1024*1024
Dominik Riebelingab49b5e2012-01-08 19:51:11 +000034
35#ifndef _MSC_VER
Dominik Riebelingd131a312008-06-17 17:52:13 +000036extern unsigned char* ipod_sectorbuf;
Dominik Riebelingab49b5e2012-01-08 19:51:11 +000037#else
38/* MSVC needs to use dllimport to allow using it directly from a DLL.
39 * See http://support.microsoft.com/kb/90530
40 * Building with MSVC is only when using as DLL.
41 */
42_declspec(dllimport) unsigned char* ipod_sectorbuf;
43#endif
44
Dominik Riebelingd131a312008-06-17 17:52:13 +000045extern int ipod_verbose;
Dave Chapman79a1fb12007-02-08 23:57:41 +000046
47#define FILETYPE_DOT_IPOD 0
48#define FILETYPE_DOT_BIN 1
49#ifdef WITH_BOOTOBJS
50 #define FILETYPE_INTERNAL 2
51#endif
52
Dave Chapmana6d68bd2007-02-10 20:09:23 +000053char* get_parttype(int pt);
Dave Chapman79a1fb12007-02-08 23:57:41 +000054int read_partinfo(struct ipod_t* ipod, int silent);
55int read_partition(struct ipod_t* ipod, int outfile);
56int write_partition(struct ipod_t* ipod, int infile);
57int diskmove(struct ipod_t* ipod, int delta);
58int add_bootloader(struct ipod_t* ipod, char* filename, int type);
59int delete_bootloader(struct ipod_t* ipod);
60int write_firmware(struct ipod_t* ipod, char* filename, int type);
Dave Chapman427fff42007-04-13 23:28:20 +000061int read_firmware(struct ipod_t* ipod, char* filename, int type);
Dave Chapman79a1fb12007-02-08 23:57:41 +000062int read_directory(struct ipod_t* ipod);
63int list_images(struct ipod_t* ipod);
64int getmodel(struct ipod_t* ipod, int ipod_version);
65int ipod_scan(struct ipod_t* ipod);
Dave Chapman35735c662007-07-27 20:51:36 +000066int write_dos_partition_table(struct ipod_t* ipod);
Dave Chapman1eca02d2009-08-04 20:32:30 +000067int ipod_get_xmlinfo(struct ipod_t* ipod);
68void ipod_get_ramsize(struct ipod_t* ipod);
Dave Chapman6e797152007-09-08 23:27:49 +000069int read_aupd(struct ipod_t* ipod, char* filename);
70int write_aupd(struct ipod_t* ipod, char* filename);
Dave Chapman79a1fb12007-02-08 23:57:41 +000071off_t filesize(int fd);
72
Dominik Riebeling3f65a702008-05-22 17:51:35 +000073#ifdef __cplusplus
74}
Dave Chapman79a1fb12007-02-08 23:57:41 +000075#endif
Dominik Riebeling3f65a702008-05-22 17:51:35 +000076#endif
77