Prepare new, unofficial maemo release
[maemo-rb.git] / rbutil / sansapatcher / sansapatcher.h
blob80cef4d417593422c2b6b8cc8b5318c2a8fb4537
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 _SANSAPATCHER_H
23 #define _SANSAPATCHER_H
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
29 #include "sansaio.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 #ifndef _MSC_VER
36 extern unsigned char* sansa_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* sansa_sectorbuf;
43 #endif
45 int sansa_read_partinfo(struct sansa_t* sansa, int silent);
46 int is_sansa(struct sansa_t* sansa);
47 int sansa_scan(struct sansa_t* sansa);
48 int sansa_read_firmware(struct sansa_t* sansa, const char* filename);
49 unsigned int sansa_read_bootloader(struct sansa_t* sansa, const char* filename, unsigned char** bl_buffer);
50 int sansa_add_bootloader(struct sansa_t* sansa, const unsigned char* buf, unsigned int len);
51 int sansa_delete_bootloader(struct sansa_t* sansa);
52 int sansa_update_of(struct sansa_t* sansa,const char* filename);
53 int sansa_update_ppbl(struct sansa_t* sansa,const char* filename);
54 int sansa_list_images(struct sansa_t* sansa);
56 #ifdef __cplusplus
58 #endif
59 #endif