Files
RomWBW/branches/s100/Apps/crossdev/METADATA.C
2012-12-30 07:28:56 +00:00

58 lines
1.0 KiB
C
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/* metadata.c 6/10/2012 dwg - functions for manipulating a drive's metadata */
#include "portab.h"
#include "globals.h"
#include "cpmbios.h"
#include "bioscall.h"
#include "sectorio.h"
#include "infolist.h"
#include "dphmap.h"
int hasmeta(drive)
int drive;
{
ireghl = pGETINFO;
bioscall();
pINFOLIST = ireghl;
pDPHVEC = pINFOLIST->dphmap;
pDPH = pDPHVEC[drive]
pDPB = pDPH->dpb;
if(0 < pDPB->off) {
return TRUE;
} else {
return FALSE;
}
}
int getmeta(drive,buffer)
int drive;
struct METADATA * buffer;
{
if(TRUE == hasmeta(drive)) {
rdsector(drive,track,sector,buffer,0);
return SUCCESS;
} else {
return FAILURE;
}
}
int putmeta(drive,buffer)
int drive;
struct METADATA * buffer;
{
if(TRUE == hasmeta(drive)) {
wrsector(drive,track,sector,buffer,0);
return SUCCESS;
} else {
return FAILURE;
}
}
/********************/
/* eof - metadata.c */
/********************/