rockbox/rbutil/sansapatcher/sansapatcher.h
Dominik Riebeling 38f03d4eae sansapatcher: factor out handling of bundled bootloaders.
Instead of handling bundled bootloaders in the sansapatcher functions leave
that to the caller. This removes the need to have Rockbox Utility specific
parts in sansapatcher. sansa_add_bootloader() now operates on an already loaded
bootloader. For loading a convenience function sansa_read_bootloader() is
added. This also introduces a new check on loading to prevent installing an
e200 bootloader on a c200 (and vice versa).

These changes will allow building a libsansapatcher for linking with Rockbox
Utility later.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31144 a1c6a512-1295-4272-9138-f99709370657
2011-12-04 19:40:43 +00:00

52 lines
1.9 KiB
C

/***************************************************************************
* __________ __ ___.
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
* \/ \/ \/ \/ \/
* $Id$
*
* Copyright (C) 2006-2007 Dave Chapman
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
****************************************************************************/
#ifndef _SANSAPATCHER_H
#define _SANSAPATCHER_H
#ifdef __cplusplus
extern "C" {
#endif
#include "sansaio.h"
extern int sansa_verbose;
/* Size of buffer for disk I/O - 8MB is large enough for any version
of the Apple firmware, but not the Nano's RSRC image. */
#define BUFFER_SIZE 8*1024*1024
extern unsigned char* sansa_sectorbuf;
int sansa_read_partinfo(struct sansa_t* sansa, int silent);
int is_sansa(struct sansa_t* sansa);
int sansa_scan(struct sansa_t* sansa);
int sansa_read_firmware(struct sansa_t* sansa, const char* filename);
unsigned int sansa_read_bootloader(struct sansa_t* sansa, const char* filename, unsigned char** bl_buffer);
int sansa_add_bootloader(struct sansa_t* sansa, const unsigned char* buf, unsigned int len);
int sansa_delete_bootloader(struct sansa_t* sansa);
int sansa_update_of(struct sansa_t* sansa,const char* filename);
int sansa_update_ppbl(struct sansa_t* sansa,const char* filename);
int sansa_list_images(struct sansa_t* sansa);
#ifdef __cplusplus
}
#endif
#endif