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 / qic.h < prev    next >
C/C++ Source or Header  |  1992-10-12  |  2KB  |  77 lines

  1. /* QIC declarations.
  2.    Copyright (C) 1992 David L. Brown, Jr.
  3.  
  4.    This program is free software; you can redistribute it and/or modify
  5.    it under the terms of the GNU General Public License as published by
  6.    the Free Software Foundation; either version 2, or (at your option)
  7.    any later version.
  8.    
  9.    This program is distributed in the hope that it will be useful,
  10.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  11.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12.    GNU General Public License for more details.
  13.    
  14.    You should have received a copy of the GNU General Public License
  15.    along with this program; see the file COPYING.  If not, write to
  16.    the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
  17.  
  18. /*
  19.  * qic.h,v 1.3 1992/10/13 01:55:27 dbrown Exp
  20.  *
  21.  * qic.h,v
  22.  * Revision 1.3  1992/10/13  01:55:27  dbrown
  23.  * Added FSF copyright.
  24.  *
  25.  * Revision 1.2  1992/03/19  23:01:05  dbrown
  26.  * Now compiles for tape but doesn't do anything.
  27.  *
  28.  */
  29.  
  30. #ifndef _QIC_H_
  31. #define _QIC_H_
  32.  
  33. #ifdef FLOPPY
  34. # define BLOCK_SIZE 512
  35. #else
  36. # define BLOCK_SIZE 1024
  37. #endif
  38.  
  39. #define BLOCKS_PER_SEGMENT 32
  40.  
  41. #ifdef FLOPPY
  42. # define NUMBER_OF_SEGMENTS 45
  43. #else
  44. # define NUMBER_OF_SEGMENTS 4200
  45. #endif
  46.  
  47. /* Bad sector map. */
  48.  
  49. #ifndef BIG_ENDIAN
  50. typedef unsigned long BAD_SECTOR;
  51. #define BAD_CLEAR(entry) ((entry)=0)
  52. #define BAD_SET(entry,sector) ((entry)|=(1<<(sector)))
  53. #define BAD_CHECK(entry,sector) ((entry)&(1<<(sector)))
  54. #else
  55. #  error not yet written.
  56. #endif
  57.  
  58. /* Representation of an in memory segment.  marked_bad lists the
  59.    sectors that were marked bad during format.  This is absolute
  60.    sector.   The sectors should be read in from the disk and packed,
  61.    as if the bad sectors were not there, and the segment just
  62.    contained fewer sectors.  read_sectors is a bitmap of errors
  63.    encountered while reading the data.  These offsets are relative to
  64.    the packed data.  blocks is a count of the sectors not marked bad.
  65.    This is just to prevent having to count the clear bits in
  66.    marked_bad each time this is used.  data is the actual sector
  67.    packed data from (or to) the tape. */
  68.  
  69. struct memory_segment {
  70.   BAD_SECTOR marked_bad;
  71.   BAD_SECTOR read_bad;
  72.   int blocks;
  73.   char *data;
  74. };
  75.  
  76. #endif _QIC_H_
  77.