home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 February / CHIP_2_98.iso / misc / src / install / libfdisk / alloc.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-10-09  |  1.1 KB  |  49 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, int wecare,
  42.                   PartitionSpec *spec);
  43.  
  44. int fdiskGrowPartitions(HardDrive **hdar, unsigned int nhd,
  45.                  HardDrive **newhdar, PartitionSpec *spec);
  46. #endif
  47.  
  48.     
  49.