home *** CD-ROM | disk | FTP | other *** search
/ James Briskly's Game Magazine 2 / JBGM002S.ZIP / SOURCE / FIPSSPEC.H < prev    next >
C/C++ Source or Header  |  1995-08-22  |  3KB  |  121 lines

  1. /*
  2.     FIPS - the First nondestructive Interactive Partition Splitting program
  3.  
  4.     Module fipsspec.h
  5.  
  6.     RCS - Header:
  7.     $Header: c:/daten/fips/source/main/RCS/fipsspec.h 1.4 1995/01/19 00:01:26 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 2 of the License, or
  14.     (at your option) 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.     Report problems and direct all questions to:
  27.  
  28.     schaefer@rbg.informatik.th-darmstadt.de
  29. */
  30.  
  31. #ifndef FIPSSPEC_H
  32. #define FIPSSPEC_H
  33.  
  34. #include "logdr_st.h"
  35. #include "hdstruct.h"
  36. #include "primpart.h"
  37. #include "fat.h"
  38. #include "disk_io.h"
  39.  
  40. class fips_bpb:public bios_parameter_block
  41. {
  42. public:
  43.     void print (void);
  44.     void calculate_new_boot (const partition_info &partition_info);
  45. };
  46.  
  47. class fips_partition_table:public partition_table
  48. {
  49. public:
  50.     void print (void);
  51.     void calculate_new_root (dword new_start_cylinder,partition *partition,const drive_geometry &geometry);
  52.     void correct_physical (const drive_geometry &geometry);
  53.     int select (void);
  54. };
  55.  
  56. class fips_harddrive:public harddrive
  57. {
  58.     fips_partition_table pr_partition_table;
  59. protected:
  60.     void get_geometry (void);
  61. public:
  62.     void reset (void);
  63.     class partition_table &partition_table() { return pr_partition_table; }
  64.     void print_partition_table (void) { pr_partition_table.print(); }
  65.     void calculate_new_root (dword new_start_cylinder, partition *partition)
  66.     {
  67.         pr_partition_table.calculate_new_root (new_start_cylinder,partition,geometry);
  68.     }
  69.     void check (boolean final_check);
  70.  
  71.     fips_harddrive (int number)
  72.         :harddrive (number)
  73.     {
  74.         get_geometry ();
  75.         // to write register info to debugfile
  76.     }
  77.  
  78.     fips_harddrive (fips_harddrive &hd):harddrive (hd)
  79.     {
  80.         harddrive::operator= (hd);
  81.         // in constructor of base class virtual functions are not yet
  82.         // accessible => assign again so that partition_table() is
  83.         // copied correctly
  84.     }
  85.  
  86.     void operator= (fips_harddrive &hd)
  87.     {
  88.         harddrive::operator= (hd);
  89.     }
  90. };
  91.  
  92. class fips_logdrive_info:public logical_drive_info
  93. {
  94. public:
  95.     void put_debug_info (void);
  96. };
  97.  
  98. class fips_partition:public partition
  99. {
  100.     fips_bpb pr_bpb;
  101.     fips_logdrive_info pr_info;
  102. public:
  103.     bios_parameter_block &bpb() { return pr_bpb; }
  104.     logical_drive_info &info() { return pr_info; }
  105.  
  106.     void print_bpb (void) { pr_bpb.print(); }
  107.     void write_info_debugfile (void) { pr_info.put_debug_info(); }
  108.     void calculate_new_boot (void)
  109.     {
  110.         pr_bpb.calculate_new_boot (*partition_info);
  111.     }
  112.     void check (void);
  113.  
  114.     fips_partition (class fips_harddrive *drive,int number):partition(drive,number) {}
  115.  
  116.     dword min_cylinder (fat16 fat, drive_geometry geometry);
  117.     boolean split (fips_harddrive hd);
  118. };
  119.  
  120. #endif
  121.