Timothe Litt 886c1fae06 Preliminary merge with Baker + other changes
Many style/formatting edits.

Bug fixes.

Reverted some previous changes temporarily while reviewing new code.

Merged Baker's "virtual device" in a simpler form.  ODS2 will assign a sensible
drive name when mounting /image (== /virtual).  If a specific drive name
is desired, mount /image drivename=filespec.

Files can be quoted, or use set qualifier_style unix if slashes are a problem.
Note that mount on the command line allows tab completion.

Moved "statistics" command into show.

Coded support for import/binary (fixed records, 512 bytes).

Converted fgets to fgetline

Added show devices for Unix (limited by standard APIs)

Got rid of separate ODS2-Image build.
2016-03-05 01:27:56 -05:00

54 lines
1.9 KiB
C

/* Device.h V2.1 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 "access.h"
#include "cache.h"
struct DEV { /* Device information */
struct CACHE cache;
struct VCB *vcb; /* Pointer to volume (if mounted) */
int access; /* Device mount options (e.g., /Write) */
unsigned sectors; /* Device physical sectors */
#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;
char *IoBuffer; /* Pointer to a buffer for the device */
unsigned last_sector; /* Last sector no read (still in buffer) */
#else
int handle; /* Device physical I/O handle */
#endif
char devnam[1]; /* Device name */
};
unsigned device_lookup( unsigned devlen, char *devnam, int create,
struct DEV **retdev );
#endif /* # ifndef _DEVICE_H */