Logo Search packages:      
Sourcecode: cbmconvert version File versions  Download package

image.c File Reference


Detailed Description

Disk image management
Author:
Marko Mäkelä (marko.makela@nic.funet.fi)

Pasi Ojala (albert@cs.tut.fi)

Definition in file image.c.

#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <string.h>
#include <errno.h>
#include "output.h"
#include "input.h"

Go to the source code of this file.

Classes

struct  CpmDirEnt
struct  DirEnt
struct  DiskGeometry

Defines

#define CPMBLOCK(block, i)   (au == 8 ? block[i] : block[2 * (i)] + (block[2 * (i) + 1] << 8))
#define infoSector   ssSector
#define infoTrack   ssTrack
#define isVLIR   recordLength

Functions

static bool allocBlock (struct Image *image, byte_t *track, byte_t *sector)
static bool backupBAM (const struct Image *image, byte_t **BAM)
static int blocksFree (const struct Image *image)
static bool checkSideSectors (const struct Image *image, const struct DirEnt *dirent, log_t log)
enum ImStatus CloseImage (struct Image *image)
static void CpmConvertName (const struct CpmDirEnt *dirent, struct Filename *name)
static byte_t ** CpmTransTable (struct Image *image, unsigned *au, unsigned *sectors)
static enum ImStatus deleteDirEnt (struct Image *image, struct DirEnt *dirent)
static enum ImStatus deleteInode (struct Image *image, byte_t track, byte_t sector, bool do_it)
static bool findNextFree (const struct Image *image, byte_t *track, byte_t *sector)
static void FormatImage (struct Image *image)
static bool freeBlock (struct Image *image, byte_t track, byte_t sector)
static byte_tgetBlock (struct Image *image, byte_t track, byte_t sector)
static struct DirEnt * getDirEnt (struct Image *image, const struct Filename *name)
static enum Filetype getFiletype (const struct Image *image, const struct DirEnt *dirent)
static struct DiskGeometry * getGeometry (enum ImageType type)
static bool isFreeBlock (const struct Image *image, byte_t track, byte_t sector)
static bool isGeosDirEnt (const struct DirEnt *dirent)
static size_t mapInode (byte_t ***buf, struct Image *image, byte_t track, byte_t sector, log_t log, const struct DirEnt *dirent)
enum ImStatus OpenImage (const char *filename, struct Image **image, enum ImageType type, enum DirEntOpts direntOpts)
enum RdStatus ReadCpmImage (FILE *file, const char *filename, write_file_t writeCallback, log_t log)
enum RdStatus ReadImage (FILE *file, const char *filename, write_file_t writeCallback, log_t log)
static size_t readInode (byte_t **buf, const struct Image *image, byte_t track, byte_t sector)
static bool restoreBAM (struct Image *image, byte_t **BAM)
static enum WrStatus setupSideSectors (struct Image *image, struct DirEnt *dirent, size_t blocks, log_t log)
enum WrStatus WriteCpmImage (const struct Filename *name, const byte_t *data, size_t length, struct Image *image, log_t log)
enum WrStatus WriteImage (const struct Filename *name, const byte_t *data, size_t length, struct Image *image, log_t log)
static enum WrStatus writeInode (struct Image *image, byte_t track, byte_t sector, const byte_t *buf, size_t size)

Variables

static struct DiskGeometry diskGeometry []
static unsigned int1541 []
static unsigned int1571 []
static unsigned int1581 []
static unsigned sect1541 []
static unsigned sect1571 []
static unsigned sect1581 []


Generated by  Doxygen 1.6.0   Back to index