/*
Copyright (C) 2000-2001, 2007, 2009-2010 Free Software Foundation,
Inc.
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Contributor: Sven Luther <luther@debian.org>
*/
#include <config.h>
#include "amiga.h"
#if ENABLE_NLS
# include <libintl.h>
#else
#endif /* ENABLE_NLS */
static const char *
switch (id) {
case IDNAME_RIGIDDISK :
return "RDSK";
case IDNAME_BADBLOCK :
return "BADB";
case IDNAME_PARTITION :
return "PART";
case IDNAME_FILESYSHEADER :
return "FSHD";
case IDNAME_LOADSEG :
return "LSEG";
case IDNAME_BOOT :
return "BOOT";
case IDNAME_FREE :
return "<free>";
default :
return "<unknown>";
}
}
struct AmigaIds *
_("%s : Failed to allocate id list element\n"), __func__);
return 0;
}
return newid;
}
void
}
}
int
return 1;
}
return 0;
}
struct AmigaBlock {
};
struct RigidDiskBlock {
/* block list heads */
/* physical drive characteristics */
/* logical drive characteristics */
/* (not including replacement bad blocks) */
/* drive identification */
};
static int
int i, end;
return sum;
}
static void
return;
}
static struct AmigaBlock *
switch (ped_exception_throw(PED_EXCEPTION_ERROR,
{
case PED_EXCEPTION_CANCEL :
case PED_EXCEPTION_UNHANDLED :
default :
return NULL;
}
}
return NULL;
if (_amiga_checksum (blk) != 0) {
switch (ped_exception_throw(PED_EXCEPTION_ERROR,
_("%s : Bad checksum on block %llu of type %s\n"),
{
case PED_EXCEPTION_CANCEL :
return NULL;
case PED_EXCEPTION_FIX :
switch (ped_exception_throw(PED_EXCEPTION_FATAL,
{
case PED_EXCEPTION_CANCEL :
case PED_EXCEPTION_UNHANDLED :
default :
return NULL;
}
}
case PED_EXCEPTION_IGNORE :
case PED_EXCEPTION_UNHANDLED :
default :
return blk;
}
}
return blk;
}
static uint32_t
int i;
for (i = 0; i<RDB_LOCATION_LIMIT; i++) {
continue;
}
return i;
}
}
return AMIGA_RDB_NOT_FOUND;
}
static int
{
uint32_t i;
for (i = 0; i < max; i++)
/* We are looping, let's stop. */
return 1;
}
return 0;
}
/* We have already allocated a rdb, we are now reading it from the disk */
struct PartitionBlock *
{
int i;
switch (ped_exception_throw(PED_EXCEPTION_ERROR,
_("%s : Failed to allocate disk_specific rdb block\n"), __func__))
{
case PED_EXCEPTION_CANCEL :
case PED_EXCEPTION_UNHANDLED :
default :
return NULL;
}
}
switch (ped_exception_throw(PED_EXCEPTION_ERROR,
_("%s : Didn't find rdb block, should never happen\n"), __func__))
{
case PED_EXCEPTION_CANCEL :
case PED_EXCEPTION_UNHANDLED :
default :
return NULL;
}
}
/* We initialize the hardblock free list to detect loops */
{
/* Let's look for loops in the partition table */
return NULL;
}
/* Let's read a partition block to get its geometry*/
switch (ped_exception_throw(PED_EXCEPTION_ERROR,
_("%s : Failed to read partition block %llu\n"),
{
case PED_EXCEPTION_CANCEL :
case PED_EXCEPTION_UNHANDLED :
default :
return NULL;
}
}
/* Current block is not a Partition Block */
return NULL;
}
/* Calculate the geometry of the partition */
/* And check if it is the one we are searching for */
return part;
}
}
return NULL;
}