summaryrefslogtreecommitdiffstats
path: root/rbutil/sansapatcher/sansaio.h
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2021-12-15 21:04:28 +0100
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2021-12-24 18:05:53 +0100
commitc876d3bbefe0dc00c27ca0c12d29da5874946962 (patch)
tree69f468a185a369b01998314bc3ecc19b70f4fcaa /rbutil/sansapatcher/sansaio.h
parent6c6f0757d7a902feb293be165d1490c42bc8e7ad (diff)
downloadrockbox-c876d3bbefe0dc00c27ca0c12d29da5874946962.tar.gz
rockbox-c876d3bbefe0dc00c27ca0c12d29da5874946962.zip
rbutil: Merge rbutil with utils folder.
rbutil uses several components from the utils folder, and can be considered part of utils too. Having it in a separate folder is an arbitrary split that doesn't help anymore these days, so merge them. This also allows other utils to easily use libtools.make without the need to navigate to a different folder. Change-Id: I3fc2f4de19e3e776553efb5dea5f779dfec0dc21
Diffstat (limited to 'rbutil/sansapatcher/sansaio.h')
-rw-r--r--rbutil/sansapatcher/sansaio.h88
1 files changed, 0 insertions, 88 deletions
diff --git a/rbutil/sansapatcher/sansaio.h b/rbutil/sansapatcher/sansaio.h
deleted file mode 100644
index 61e2f1d1b2..0000000000
--- a/rbutil/sansapatcher/sansaio.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/***************************************************************************
- * __________ __ ___.
- * 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 __SANSAIO_H
-#define __SANSAIO_H
-
-#include <stdint.h>
-#if !defined(_MSC_VER)
-#include <unistd.h> /* not available on MSVC */
-#endif
-
-#if defined(__WIN32__) || defined(_WIN32)
-#include <windows.h>
-#define loff_t int64_t
-#else
-#define HANDLE int
-#define O_BINARY 0
-
-/* Only Linux seems to need lseek64 and loff_t */
-#if !defined(linux) && !defined (__linux)
-#define loff_t off_t
-#define lseek64 lseek
-#endif
-
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct sansa_partinfo_t {
- unsigned long start; /* first sector (LBA) */
- unsigned long size; /* number of sectors */
- int type;
-};
-
-struct mi4header_t {
- uint32_t version;
- uint32_t length;
- uint32_t crc32;
- uint32_t enctype;
- uint32_t mi4size;
- uint32_t plaintext;
-};
-
-struct sansa_t {
- HANDLE dh;
- unsigned char* sectorbuf;
- char diskname[4096];
- int sector_size;
- struct sansa_partinfo_t pinfo[4];
- int hasoldbootloader;
- char* targetname; /* "e200" or "c200" */
- loff_t start; /* Offset in bytes of firmware partition from start of disk */
-};
-
-void sansa_print_error(char* msg);
-int sansa_open(struct sansa_t* sansa, int silent);
-int sansa_reopen_rw(struct sansa_t* sansa);
-int sansa_close(struct sansa_t* sansa);
-int sansa_seek(struct sansa_t* sansa, loff_t pos);
-int sansa_read(struct sansa_t* sansa, unsigned char* buf, int nbytes);
-int sansa_write(struct sansa_t* sansa, int nbytes);
-int sansa_alloc_buffer(struct sansa_t* sansa, int bufsize);
-int sansa_dealloc_buffer(struct sansa_t* sansa);
-
-#ifdef __cplusplus
-}
-#endif
-#endif