home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 February / CHIP_2_98.iso / misc / src / install / libfdisk / partspec.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-10-09  |  2.5 KB  |  63 lines

  1. #ifndef FDISK_PARTSPEC_H
  2. #define FDISK_PARTSPEC_H
  3.  
  4. /* reasons partition wasnt allocated                  */
  5. /*  ALLOC_UNDEF   - reason is currently undefined     */
  6. /*  ALLOC_OK      - it was allocated just fine        */
  7. /*  ALLOC_SIZE    - no room on allowed drives         */
  8. /*  ALLOC_START   - couldnt start at requested sector */
  9. /*  ALLOC_CYL     - couldnt put in requested range    */
  10. /*  ALLOC_DRIVE   - not really used yet               */
  11. /*  ALLOC_FREEPRI - no free primary partitions        */
  12. /*  ALLOC_EXTCRE  - couldnt create extended partition */
  13. /*  ALLOC_FREEPART- no free slots in HardDrive struct */
  14. enum allocReason {ALLOC_UNDEF, ALLOC_OK, ALLOC_SIZE, ALLOC_START, ALLOC_CYL, 
  15.     ALLOC_DRIVE, ALLOC_FREEPRI, ALLOC_FREEPART };
  16.  
  17. /* holds the reason latest alloc attempt failed (or didnt) */
  18. extern enum allocReason LastAllocStat;
  19.  
  20. /* some structures used to abstact partitions even more */
  21. struct partition_spec {
  22.     char                 *name;
  23.     unsigned int         status;
  24.     enum allocReason     reason;
  25.     Partition            partition;
  26. };
  27.  
  28. #define MAX_PARTITION_SPEC 100
  29. struct all_partition_spec {
  30.     unsigned int              num;
  31.     struct partition_spec     entry[MAX_PARTITION_SPEC];
  32. };
  33.  
  34. typedef struct partition_spec       PartitionSpecEntry;
  35. typedef struct all_partition_spec   PartitionSpec; 
  36.  
  37. #define REQUEST_GRANTED   1
  38. #define REQUEST_PENDING   2
  39. #define REQUEST_DENIED    4
  40. #define REQUEST_ORIGINAL  8
  41.  
  42. char *GetReasonString( enum allocReason reason );
  43. int fdiskHandleSpecialPartitions( PartitionSpec *spec );
  44. int fdiskGetConstraintPriority( Partition *p );
  45. int fdiskReturnPartitionSpec( PartitionSpec *spec, char *name, Partition **p );
  46. int fdiskIndexPartitionSpec( PartitionSpec *spec, char *name, unsigned int *i);
  47. int fdiskInsertPartitionSpec( PartitionSpec *spec, char *name, Partition *p,
  48.                   unsigned int status);
  49. int fdiskRenamePartitionSpec( PartitionSpec *spec, char *name, char *newname);
  50. int fdiskModifyPartitionSpec( PartitionSpec *spec, char *name, Partition *p,
  51.                   unsigned int status);
  52. int fdiskDeletePartitionSpec( PartitionSpec *spec, char *name );
  53. int fdiskWipePartitionSpec( PartitionSpec *spec );
  54. int fdiskSetupPartitionSpec( HardDrive **hdarr, unsigned int numhd,
  55.                  PartitionSpec *spec );
  56. int fdiskCleanOriginalSpecs( HardDrive **hdarr, unsigned int numhd,
  57.                  PartitionSpec *spec );
  58. int fdiskMakeUniqSpecName( PartitionSpec *spec, char * base, char **s );
  59. int fdiskMakeSwapSpecName( PartitionSpec *spec, char **s );
  60. #endif
  61.  
  62.  
  63.