home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The World of Computer Software
/
World_Of_Computer_Software-02-387-Vol-3of3.iso
/
f
/
ftp-102.zip
/
ftape-1.02
/
qic
/
header.h
< prev
next >
Wrap
C/C++ Source or Header
|
1992-10-12
|
4KB
|
140 lines
/* Header segment definition.
Copyright (C) 1992 David L. Brown, Jr.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
/*
* header.h,v 1.3 1992/10/13 01:55:21 dbrown Exp
*
* header.h,v
* Revision 1.3 1992/10/13 01:55:21 dbrown
* Added FSF copyright.
*
* Revision 1.2 1992/03/19 23:00:59 dbrown
* Now compiles for tape but doesn't do anything.
*
*/
#ifndef _HEADER_H_
#define _HEADER_H_
struct failed_log {
short number; /* Segment number of failure. */
short date;
};
/* Since the compiler tries to pad longs, this allows us to define a
long and use it. */
typedef unsigned char llong[4];
#define LLONG_SET(l,value) \
do { \
(l)[0] = (value); \
(l)[1] = (value) >> 8; \
(l)[2] = (value) >> 16; \
(l)[3] = (value) >> 24; \
} while(0)
#define LLONG(l) ((l)[0] | ((l)[1] << 8) | ((l)[2] << 16) | ((l)[3] << 24))
struct qic_header_segment {
char signature[4]; /* Signature. */
char format_code; /* Type of format. */
char unused_1;
short header; /* Segment number of header. */
short alt_header; /* Segment humber of duplicate header. */
short data_first; /* First logical area data segment. */
short data_last; /* Last logical area data segment. */
llong format_time; /* Time of last format (seconds). */
llong write_time; /* Time of last format or write. */
short unused_2;
short segments_per_track;
char tracks_per_cartridge;
char maximum_floppy_side;
char maximum_floppy_track;
char maximum_floppy_sector;
char tape_name[8];
char unused_6[36];
llong tape_name_time; /* Time tape name was written
(seconds). */
short compression_map; /* Segment of compression map segment. */
char unused_3[48];
char format_error;
char unused_7;
llong segments_used; /* Number of segments written,
formatted or verified throughout
the life of tape. */
llong unused_4;
llong initial_format_time; /* Time of initial tape format. */
short format_count;
short failed_sector_count; /* Number of entries in failed sector
log. */
char oem_name[44];
char oem_lot[44];
char unused_5[22];
#ifdef FLOPPY
struct failed_log bad_log[64+128]; /* Failed sector log. */
#else /* not FLOPPY */
struct failed_log bad_log[192+256]; /* Failed sector log. */
#endif /* not FLOPPY */
#if 0
/* In next block. */
#ifdef FLOPPY
struct failed_log bad_log2[128]; /* Failed sector log. */
#else /* not FLOPPY */
struct failed_log bad_log2[256]; /* Failed sector log. */
#endif /* not FLOPPY */
#endif
/* Bad sector table. */
#ifdef FLOPPY
BAD_SECTOR bad_sectors[3456];
#else /* not FLOPPY */
BAD_SECTOR bad_sectors[6912];
#endif /* not FLOPPY */
};
extern struct qic_header_segment current_header;
/* Volume table segment. Each entry of the volume table is 128 bytes
long, and of this format. */
struct vt_entry {
char signature[4];
short start_segment; /* First segment of entry. */
short last_segment; /* Last segment of entry. */
char description[44]; /* Ascii description. */
llong time; /* Time of storage. */
char flags; /* Flags (see below). */
char sequence; /* Multi-cartridge sequence number. */
char vendor_ext[26];
char password[8]; /* Ascii, '\0' for no password. */
llong directory_size; /* Bytes for directory. */
llong data_size; /* Bytes of data following directory.
Includes multiple cartridges if
necessary. */
short os_version; /* First byte, major, second byte is
minor. */
char volume_label[16]; /* Name of volume, or '\0' if
undefined. */
char logical_origin;
char physical_origin;
char compression_type; /* Zero if no compression. */
char unused[7];
};
#endif _HEADER_H_