fork of PCE focusing on macplus, supporting DaynaPort SCSI network emulation
at master 56 lines 2.2 kB view raw
1/***************************************************************************** 2 * pce * 3 *****************************************************************************/ 4 5/***************************************************************************** 6 * File name: src/drivers/block/blkraw.h * 7 * Created: 2004-09-17 by Hampa Hug <hampa@hampa.ch> * 8 * Copyright: (C) 2004-2011 Hampa Hug <hampa@hampa.ch> * 9 *****************************************************************************/ 10 11/***************************************************************************** 12 * This program is free software. You can redistribute it and / or modify it * 13 * under the terms of the GNU General Public License version 2 as published * 14 * by the Free Software Foundation. * 15 * * 16 * This program is distributed in the hope that it will be useful, but * 17 * WITHOUT ANY WARRANTY, without even the implied warranty of * 18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General * 19 * Public License for more details. * 20 *****************************************************************************/ 21 22 23#ifndef PCE_DEVICES_BLOCK_BLKIMG_H 24#define PCE_DEVICES_BLOCK_BLKIMG_H 1 25 26 27#include <config.h> 28 29#include <drivers/block/block.h> 30 31#include <stdio.h> 32#include <stdint.h> 33 34 35/*!*************************************************************************** 36 * @short The image file disk structure 37 *****************************************************************************/ 38typedef struct { 39 disk_t dsk; 40 41 FILE *fp; 42 43 uint64_t start; 44} disk_img_t; 45 46 47disk_t *dsk_img_open_fp (FILE *fp, uint64_t ofs, int ro); 48disk_t *dsk_img_open (const char *fname, uint64_t ofs, int ro); 49 50void dsk_img_set_offset (disk_t *dsk, uint64_t ofs); 51 52int dsk_img_create_fp (FILE *fp, uint32_t n, uint64_t ofs); 53int dsk_img_create (const char *fname, uint32_t n, uint64_t ofs); 54 55 56#endif