home *** CD-ROM | disk | FTP | other *** search
/ James Briskly's Game Magazine 2 / JBGM002S.ZIP / RESTORRB / RTYPES.H < prev    next >
C/C++ Source or Header  |  1993-04-28  |  3KB  |  80 lines

  1. /*
  2.     FIPS - the First nondestructive Interactive Partition Splitting program
  3.     
  4.     Module types.h
  5.  
  6.     RCS - Header:
  7.     $Header: c:/daten/c/fips/source/RCS/types.h%v 2.0 1993/04/28 03:32:20 schaefer Exp schaefer $
  8.  
  9.     Copyright (C) 1993 Arno Schaefer
  10.  
  11.     This program is free software; you can redistribute it and/or modify
  12.     it under the terms of the GNU General Public License as published by
  13.     the Free Software Foundation; either version 1, or (at your option)
  14.     any later version.
  15.  
  16.     This program is distributed in the hope that it will be useful,
  17.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  18.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  19.     GNU General Public License for more details.
  20.  
  21.     You should have received a copy of the GNU General Public License
  22.     along with this program; if not, write to the Free Software
  23.     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  24. */
  25.  
  26. typedef unsigned char byte;
  27. typedef unsigned int word;
  28. typedef unsigned long dword;
  29.  
  30. typedef enum {false,true} boolean;
  31.  
  32. struct drive_geometry
  33. {
  34.     dword heads;
  35.     dword cylinders;
  36.     dword sectors;
  37. };
  38.  
  39. struct physical_sector
  40. {
  41.     dword head;
  42.     dword cylinder;
  43.     dword sector;
  44. };
  45.  
  46. struct partition_info
  47. {
  48.     byte bootable;                  /* 80h or 0 */
  49.     byte start_head;                /* location of first sector (bootsector) */
  50.     word start_cylinder;
  51.     byte start_sector;
  52.     byte system;                    /* 1 = 12-bit FAT, 4 = 16-bit FAT & 16-bit sector number */
  53.                     /* 6 = 16-bit FAT & 32-bit sector number (BIGDOS) */
  54.     byte end_head;                  /* location of last sector */
  55.     word end_cylinder;
  56.     byte end_sector;
  57.     dword start_sector_abs;         /* = start_cylinder * heads * sectors + start_head * sectors */
  58.                     /* + start_sector - 1 */
  59.     dword no_of_sectors_abs;        /* = end_cylinder * heads * sectors + end_head * sectors */
  60.                     /* + end_sector - start_sector_abs */
  61. };
  62.  
  63. struct bootsector_info
  64. {
  65.     word bytes_per_sector;          /* usually 512 */
  66.     byte sectors_per_cluster;       /* may differ */
  67.     word reserved_sectors;          /* usually 1 (bootsector) */
  68.     byte no_of_fats;                /* usually 2 */
  69.     word no_of_rootdir_entries;     /* usually 512 (?) */
  70.     word no_of_sectors;             /* 0 on BIGDOS partitions */
  71.     byte media_descriptor;          /* usually F8h */
  72.     word sectors_per_fat;           /* depends on partition size */
  73.     word sectors_per_track;         /* = sectors */
  74.     word drive_heads;               /* = heads */
  75.     dword hidden_sectors;           /* first sector of partition */
  76.     dword no_of_sectors_long;       /* number of sectors on BIGDOS partitions */
  77.     byte phys_drive_no;             /* 80h or 81h */
  78.     byte signature;                 /* usually 29h */
  79. };
  80.