1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
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 _SANSAPATCHER_H
23 #define _SANSAPATCHER_H
31 extern int sansa_verbose
;
32 /* Size of buffer for disk I/O - 8MB is large enough for any version
33 of the Apple firmware, but not the Nano's RSRC image. */
34 #define BUFFER_SIZE 8*1024*1024
35 extern unsigned char* sansa_sectorbuf
;
37 #define FILETYPE_MI4 0
38 #define FILETYPE_INTERNAL 1
40 int sansa_read_partinfo(struct sansa_t
* sansa
, int silent
);
41 int is_sansa(struct sansa_t
* sansa
);
42 int sansa_scan(struct sansa_t
* sansa
);
43 int sansa_read_firmware(struct sansa_t
* sansa
, const char* filename
);
44 int sansa_add_bootloader(struct sansa_t
* sansa
, const char* filename
, int type
);
45 int sansa_delete_bootloader(struct sansa_t
* sansa
);
46 int sansa_update_of(struct sansa_t
* sansa
,const char* filename
);
47 int sansa_update_ppbl(struct sansa_t
* sansa
,const char* filename
);
48 int sansa_list_images(struct sansa_t
* sansa
);