The threading model should be set from configure, not config.h.
[maemo-rb.git] / rbutil / ipodpatcher / ipodpatcher.h
blob30a1b1e9fd1e121a56147f174d7ef1b9d0489885
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright (C) 2006-2007 Dave Chapman
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.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
22 #ifndef _IPODPATCHER_H
23 #define _IPODPATCHER_H
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
29 #include "ipodio.h"
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
35 #ifndef _MSC_VER
36 extern unsigned char* ipod_sectorbuf;
37 #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.
42 _declspec(dllimport) unsigned char* ipod_sectorbuf;
43 #endif
45 extern int ipod_verbose;
47 #define FILETYPE_DOT_IPOD 0
48 #define FILETYPE_DOT_BIN 1
49 #ifdef WITH_BOOTOBJS
50 #define FILETYPE_INTERNAL 2
51 #endif
53 char* get_parttype(int pt);
54 int read_partinfo(struct ipod_t* ipod, int silent);
55 int read_partition(struct ipod_t* ipod, int outfile);
56 int write_partition(struct ipod_t* ipod, int infile);
57 int diskmove(struct ipod_t* ipod, int delta);
58 int add_bootloader(struct ipod_t* ipod, char* filename, int type);
59 int delete_bootloader(struct ipod_t* ipod);
60 int write_firmware(struct ipod_t* ipod, char* filename, int type);
61 int read_firmware(struct ipod_t* ipod, char* filename, int type);
62 int read_directory(struct ipod_t* ipod);
63 int list_images(struct ipod_t* ipod);
64 int getmodel(struct ipod_t* ipod, int ipod_version);
65 int ipod_scan(struct ipod_t* ipod);
66 int write_dos_partition_table(struct ipod_t* ipod);
67 int ipod_get_xmlinfo(struct ipod_t* ipod);
68 void ipod_get_ramsize(struct ipod_t* ipod);
69 int read_aupd(struct ipod_t* ipod, char* filename);
70 int write_aupd(struct ipod_t* ipod, char* filename);
71 off_t filesize(int fd);
73 #ifdef __cplusplus
75 #endif
76 #endif