Files
open-simh.simtools/extracters/ods2/device.h
Timothe Litt 3f193e6f99 Baselevel commit for V2.99
Reorganize commands into separate modules - ods2.c was way too big.
This reduces it from around 3000 LOC to less than 1K LOC.

Reorder I/O so PHYVIRT mediates all physical access.

Fix memory leaks of device structures.

Reorganize Files-11 vs. internal structures.

Allow more granular control of DEBUG from the makefile.

Show VOLUME handles free space and tries to match geometry from SCB to known disk types.

Fix many compilation warnings.

Add code to allow dumping disk data for debug.

Automatically generate descrip.mms from dependencies.

Correctly handle directory default version limit; previously confused with file version limit.

Teach help to sort tables for presentation; manually keeping them sorted is problematic,
and code maintenance prefers functional groupings.

Add the ability to initialize a Files-11 volume. (Not quite complete.)

Add dependency generation to makefiles.  Excludes system headers so
makedepends isn't required to build.

Simplify makefiles to use more recipes.

Teach makefiles to list all sources and headers so it's easier to keep git and MSVC up-to-date.

Add support for accessing images of disks with interleave/skew/offsets (e.g. RX02).

Add VHD support, including ability to create a snapshot with mount/write.

Teach RMS to handle NOSPAN variable length records correctly.

Fix RMS GET handling of variable length records with VFC that span block boundaries.

Fix delete file (a day-one incomplete).   Still some cases to validate.

 Purge cache of modified blocks at rundown and at the end of each command.

Do not allow deletion of reserved files.

Move revision history to version.h

Correct various permissions in git.
2016-03-23 16:53:27 -04:00

65 lines
2.3 KiB
C

/* Device.h Definitions for device routines */
/*
This is part of ODS2 written by Paul Nankervis,
email address: Paulnank@au1.ibm.com
ODS2 is distributed freely for all members of the
VMS community to use. However all derived works
must maintain comments in their source to acknowledge
the contibution of the original author.
*/
#ifndef _DEVICE_H
#define _DEVICE_H
#ifdef _WIN32
#include <windows.h> /* HANDLE */
#endif
#include <stdio.h>
#include <sys/types.h>
#include "access.h"
#include "cache.h"
#include "phyio.h"
struct DEV { /* Device information */
struct CACHE cache;
struct VCB *vcb; /* Pointer to volume (if mounted) */
int access; /* Device mount options (e.g., /Write) */
void *context; /* Context for implementation */
#ifdef _WIN32
short drive; /* Drive no. (0=A, 1=B, 2=C, ...) */
unsigned bytespersector; /* Device physical sectorsize (bytes) */
unsigned blockspersector; /* Device physical sectorsize (blocks) */
union {
struct { /* Device uses Win32 APIs for physical I/O */
HANDLE handle; /* Win32 I/O handle */
} Win32;
struct { /* Device uses ASPI APIs for physical I/O */
short dtype; /* ASPI disk type */
short bus; /* ASPI device bus */
short id; /* ASPI device id */
} ASPI;
} API;
unsigned last_sector; /* Last sector no read (still in buffer) */
#else
int handle; /* Device physical I/O handle */
#endif
#if defined(_WIN32) || defined(USE_VHD)
char *IoBuffer; /* Pointer to a buffer for the device */
#endif
struct disktype *disktype; /* Structure defining virtual disk geometry */
phy_iord_t devread; /* Device read function */
phy_iowr_t devwrite; /* Device write function */
off_t eofptr; /* End of file on virtual files */
char devnam[1]; /* Device name */
};
unsigned device_lookup( unsigned devlen, char *devnam, int create,
struct DEV **retdev );
void device_done( struct DEV *dev );
#endif /* # ifndef _DEVICE_H */