Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

PartInfo.defs.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 // Maintainer: fehr@suse.de
00003 
00004 #ifndef _PART_INFO_DEFS_H
00005 #define _PART_INFO_DEFS_H
00006 
00007 #include <iostream>
00008 #include <string>
00009 
00010 using std::ostream;
00011 
00012 #define PART_ID_LINUX_NATIVE 0x83
00013 #define PART_ID_LINUX_SWAP   0x82
00014 #define PART_ID_DOS          0x06
00015 #define PART_ID_UNUSED       0x00
00016 #define LVM_PART_ID          0x8E
00017 
00018 #define LVM_MAJOR_NUMBER       58
00019 
00020 enum PartitionType
00021 {
00022   PAR_TYPE_LINUX,
00023   PAR_TYPE_SWAP,
00024   PAR_TYPE_DOS,
00025   PAR_TYPE_HPFS,
00026   PAR_TYPE_EXTENDED,
00027   PAR_TYPE_PRIMARY,
00028   PAR_TYPE_LOGICAL,
00029   PAR_TYPE_LVM_PV,
00030   PAR_TYPE_RAID_PV,
00031   PAR_TYPE_UNUSED,
00032   PAR_TYPE_OTHER     // Should be last value
00033 };
00034 
00035 enum ErrorBehaviour
00036 {
00037   EB_DEFAULT,
00038   EB_REMOUNT_RO,
00039   EB_CONTINUE,
00040   EB_PANIC
00041 };
00042 
00043 inline ostream& operator<<(ostream& Str, const PartitionType& Obj) { return Str << (int)Obj; }
00044 
00045 
00046 enum FilesystemType
00047 {
00048   FS_TYPE_EXT2,
00049   FS_TYPE_XIAFS,
00050   FS_TYPE_DOS,
00051   FS_TYPE_UMSDOS,
00052   FS_TYPE_HPFS,
00053   FS_TYPE_ISO9660,
00054   FS_TYPE_MINIX,
00055   FS_TYPE_NFS,
00056   FS_TYPE_VFAT,
00057   FS_TYPE_SWAP,
00058   FS_TYPE_REISER,
00059   FS_TYPE_HFS,
00060   FS_TYPE_ANY,
00061   FS_TYPE_UNUSED,
00062   FS_TYPE_OTHER       // Should be last value
00063 };
00064 
00065 inline ostream& operator<<(ostream& Str, const FilesystemType& Obj) { return Str << (int)Obj; }
00066 
00067 
00068 enum FormatType
00069 {
00070   FORMAT_NO,
00071   FORMAT_YES,
00072   FORMAT_CHECK
00073 };
00074 
00075 inline ostream& operator<<(ostream& Str, const FormatType& Obj ) { return Str << (int)Obj; }
00076 
00077 
00078 struct PartInfo
00079 {
00080   PartInfo() 
00081   {
00082     PType_e = PAR_TYPE_LINUX;
00083     Blocks_l = Id_i = Num_i = Start_i = End_i = 0;
00084     Boot_b = false;
00085   }
00086   PartitionType PType_e;
00087   string Device_C;
00088   string Info_C;
00089   string RealStart_C;
00090   unsigned Id_i;
00091   unsigned Num_i;
00092   unsigned Start_i;
00093   unsigned End_i;
00094   unsigned long long Blocks_l;
00095   bool Boot_b;
00096   bool operator ==(const PartInfo& Rhs_rv)
00097   {
00098     return (Start_i == Rhs_rv.Start_i &&
00099             End_i == Rhs_rv.End_i &&
00100             Blocks_l == Rhs_rv.Blocks_l &&
00101             PType_e == Rhs_rv.PType_e &&
00102             Device_C == Rhs_rv.Device_C &&
00103             Info_C == Rhs_rv.Info_C &&
00104             Id_i == Rhs_rv.Id_i &&
00105             Num_i == Rhs_rv.Num_i );
00106   }
00107 };
00108 
00109 #define IsSwap( A ) ((A).PType_e==PAR_TYPE_SWAP||(A).Filesys_e==FS_TYPE_SWAP)
00110 #define IsLinuxPart( A ) ((A).PType_e==PAR_TYPE_LINUX || \
00111                           (A).PType_e==PAR_TYPE_RAID_PV || \
00112                           (A).PType_e==PAR_TYPE_LVM_PV)
00113 
00114 #define PartInfoEQ( A, B ) ((A)==(B))
00115 
00116 #endif

Generated on Tue Jul 17 04:35:14 2007 for yast2-storage by doxygen 1.3.6