home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD (UK) 1999 May / pcp151c.iso / misc / src / install / libfdisk / alloc.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-07-21  |  1.1 KB  |  48 lines

  1. #ifndef FDISK_ALLOC_H
  2. #define FDISK_ALLOC_H
  3.  
  4. /* space map structs */
  5.  
  6. struct spacemapentry {
  7.     unsigned int start;
  8.     unsigned int size;
  9. };
  10.  
  11. struct spacemap {
  12.     unsigned int               len;
  13.     unsigned int               num;
  14.     struct spacemapentry       *entry;
  15. };
  16.  
  17. typedef struct spacemapentry SpaceMapEntry;
  18. typedef struct spacemap      SpaceMap;
  19.  
  20. /* number of entries to allocate at a time */
  21. #define SpaceMapChunk 8
  22.  
  23.  
  24. int fdiskSpaceMapInit( SpaceMap **map );
  25.  
  26. int fdiskSpaceMapKrunch( SpaceMap *map, unsigned int fuzz );
  27.  
  28. int fdiskSpaceMapFree( SpaceMap *map );
  29.  
  30. int fdiskSpaceMapAdd( SpaceMap *map, SpaceMapEntry *entry, unsigned int fuzz );
  31.  
  32. int fdiskSpaceMapDel( SpaceMap *map, unsigned int n );
  33.  
  34. int fdiskUsedMapGen( HardDrive *hd, SpaceMap **map );
  35.  
  36. int fdiskFreeMapGen( HardDrive *hd, SpaceMap **map );
  37.  
  38. int fdiskAutoInsertPartition(HardDrive **hdar, unsigned int nhd, Partition *p);
  39.  
  40. int fdiskAutoInsertPartitions(HardDrive **hdar, unsigned int nhd, 
  41.                   HardDrive **newhdar, PartitionSpec *spec);
  42.  
  43. int fdiskGrowPartitions(HardDrive **hdar, unsigned int nhd,
  44.                  HardDrive **newhdar, PartitionSpec *spec);
  45. #endif
  46.  
  47.     
  48.