home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 8 / IOPROG_8.ISO / install / fips / source / fipsspec.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-08-25  |  3.3 KB  |  121 lines

  1. /*
  2.  
  3.     FIPS - the First nondestructive Interactive Partition Splitting program
  4.  
  5.  
  6.  
  7.     Module fipsspec.h
  8.  
  9.  
  10.  
  11.     RCS - Header:
  12.  
  13.     $Header: c:/daten/fips/source/main/RCS/fipsspec.h 1.4 1995/01/19 00:01:26 schaefer Exp schaefer $
  14.  
  15.  
  16.  
  17.     Copyright (C) 1993 Arno Schaefer
  18.  
  19.  
  20.  
  21.     This program is free software; you can redistribute it and/or modify
  22.  
  23.     it under the terms of the GNU General Public License as published by
  24.  
  25.     the Free Software Foundation; either version 2 of the License, or
  26.  
  27.     (at your option) any later version.
  28.  
  29.  
  30.  
  31.     This program is distributed in the hope that it will be useful,
  32.  
  33.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  34.  
  35.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  36.  
  37.     GNU General Public License for more details.
  38.  
  39.  
  40.  
  41.     You should have received a copy of the GNU General Public License
  42.  
  43.     along with this program; if not, write to the Free Software
  44.  
  45.     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  46.  
  47.  
  48.  
  49.  
  50.  
  51.     Report problems and direct all questions to:
  52.  
  53.  
  54.  
  55.     schaefer@rbg.informatik.th-darmstadt.de
  56.  
  57. */
  58.  
  59.  
  60.  
  61. #ifndef FIPSSPEC_H
  62.  
  63. #define FIPSSPEC_H
  64.  
  65.  
  66.  
  67. #include "logdr_st.h"
  68.  
  69. #include "hdstruct.h"
  70.  
  71. #include "primpart.h"
  72.  
  73. #include "fat.h"
  74.  
  75. #include "disk_io.h"
  76.  
  77.  
  78.  
  79. class fips_bpb:public bios_parameter_block
  80.  
  81. {
  82.  
  83. public:
  84.  
  85.     void print (void);
  86.  
  87.     void calculate_new_boot (const partition_info &partition_info);
  88.  
  89. };
  90.  
  91.  
  92.  
  93. class fips_partition_table:public partition_table
  94.  
  95. {
  96.  
  97. public:
  98.  
  99.     void print (void);
  100.  
  101.     void calculate_new_root (dword new_start_cylinder,partition *partition,const drive_geometry &geometry);
  102.  
  103.     void correct_physical (const drive_geometry &geometry);
  104.  
  105.     int select (void);
  106.  
  107. };
  108.  
  109.  
  110.  
  111. class fips_harddrive:public harddrive
  112.  
  113. {
  114.  
  115.     fips_partition_table pr_partition_table;
  116.  
  117. protected:
  118.  
  119.     void get_geometry (void);
  120.  
  121. public:
  122.  
  123.     void reset (void);
  124.  
  125.     class partition_table &partition_table() { return pr_partition_table; }
  126.  
  127.     void print_partition_table (void) { pr_partition_table.print(); }
  128.  
  129.     void calculate_new_root (dword new_start_cylinder, partition *partition)
  130.  
  131.     {
  132.  
  133.         pr_partition_table.calculate_new_root (new_start_cylinder,partition,geometry);
  134.  
  135.     }
  136.  
  137.     void check (boolean final_check);
  138.  
  139.  
  140.  
  141.     fips_harddrive (int number)
  142.  
  143.         :harddrive (number)
  144.  
  145.     {
  146.  
  147.         get_geometry ();
  148.  
  149.         // to write register info to debugfile
  150.  
  151.     }
  152.  
  153.  
  154.  
  155.     fips_harddrive (fips_harddrive &hd):harddrive (hd)
  156.  
  157.     {
  158.  
  159.         harddrive::operator= (hd);
  160.  
  161.         // in constructor of base class virtual functions are not yet
  162.  
  163.         // accessible => assign again so that partition_table() is
  164.  
  165.         // copied correctly
  166.  
  167.     }
  168.  
  169.  
  170.  
  171.     void operator= (fips_harddrive &hd)
  172.  
  173.     {
  174.  
  175.         harddrive::operator= (hd);
  176.  
  177.     }
  178.  
  179. };
  180.  
  181.  
  182.  
  183. class fips_logdrive_info:public logical_drive_info
  184.  
  185. {
  186.  
  187. public:
  188.  
  189.     void put_debug_info (void);
  190.  
  191. };
  192.  
  193.  
  194.  
  195. class fips_partition:public partition
  196.  
  197. {
  198.  
  199.     fips_bpb pr_bpb;
  200.  
  201.     fips_logdrive_info pr_info;
  202.  
  203. public:
  204.  
  205.     bios_parameter_block &bpb() { return pr_bpb; }
  206.  
  207.     logical_drive_info &info() { return pr_info; }
  208.  
  209.  
  210.  
  211.     void print_bpb (void) { pr_bpb.print(); }
  212.  
  213.     void write_info_debugfile (void) { pr_info.put_debug_info(); }
  214.  
  215.     void calculate_new_boot (void)
  216.  
  217.     {
  218.  
  219.         pr_bpb.calculate_new_boot (*partition_info);
  220.  
  221.     }
  222.  
  223.     void check (void);
  224.  
  225.  
  226.  
  227.     fips_partition (class fips_harddrive *drive,int number):partition(drive,number) {}
  228.  
  229.  
  230.  
  231.     dword min_cylinder (fat16 fat, drive_geometry geometry);
  232.  
  233.     boolean split (fips_harddrive hd);
  234.  
  235. };
  236.  
  237.  
  238.  
  239. #endif
  240.  
  241.