libparted 3.6
Loading...
Searching...
No Matches
Macros | Enumerations | Functions
unit.in.h File Reference

Go to the source code of this file.

Macros

#define PED_GIBIBYTE_SIZE   1073741824LL
 
#define PED_GIGABYTE_SIZE   1000000000LL
 
#define PED_KIBIBYTE_SIZE   1024LL
 
#define PED_KILOBYTE_SIZE   1000LL
 
#define PED_MEBIBYTE_SIZE   1048576LL
 
#define PED_MEGABYTE_SIZE   1000000LL
 
#define PED_SECTOR_SIZE_DEFAULT   512LL
 
#define PED_TEBIBYTE_SIZE   1099511627776LL
 
#define PED_TERABYTE_SIZE   1000000000000LL
 
#define PED_UNIT_FIRST   PED_UNIT_SECTOR
 
#define PED_UNIT_LAST   PED_UNIT_TEBIBYTE
 

Enumerations

enum  PedUnit {
  PED_UNIT_SECTOR , PED_UNIT_BYTE , PED_UNIT_KILOBYTE , PED_UNIT_MEGABYTE ,
  PED_UNIT_GIGABYTE , PED_UNIT_TERABYTE , PED_UNIT_COMPACT , PED_UNIT_CYLINDER ,
  PED_UNIT_CHS , PED_UNIT_PERCENT , PED_UNIT_KIBIBYTE , PED_UNIT_MEBIBYTE ,
  PED_UNIT_GIBIBYTE , PED_UNIT_TEBIBYTE , PED_UNIT_SECTOR , PED_UNIT_BYTE ,
  PED_UNIT_KILOBYTE , PED_UNIT_MEGABYTE , PED_UNIT_GIGABYTE , PED_UNIT_TERABYTE ,
  PED_UNIT_COMPACT , PED_UNIT_CYLINDER , PED_UNIT_CHS , PED_UNIT_PERCENT ,
  PED_UNIT_KIBIBYTE , PED_UNIT_MEBIBYTE , PED_UNIT_GIBIBYTE , PED_UNIT_TEBIBYTE
}
 Human-friendly unit for representation of a location within device. More...
 

Functions

char * ped_unit_format (const PedDevice *dev, PedSector sector)
 Get a string that describes the location sector on device dev.
 
char * ped_unit_format_byte (const PedDevice *dev, PedSector byte)
 Get a string that describes the location of the byte on device dev.
 
char * ped_unit_format_custom (const PedDevice *dev, PedSector sector, PedUnit unit)
 Get a string that describes the location sector on device dev.
 
char * ped_unit_format_custom_byte (const PedDevice *dev, PedSector byte, PedUnit unit)
 Get a string that describes the location of the byte on device dev.
 
PedUnit ped_unit_get_by_name (const char *unit_name)
 Get a unit based on its textual representation: unit_name.
 
PedUnit ped_unit_get_default ()
 Get the current default unit.
 
const char * ped_unit_get_name (PedUnit unit)
 Get a textual (non-internationalized) representation of a unit.
 
long long ped_unit_get_size (const PedDevice *dev, PedUnit unit)
 Get the byte size of a given unit.
 
int ped_unit_parse (const char *str, const PedDevice *dev, PedSector *sector, PedGeometry **range)
 If str contains a valid description of a location on dev, then *sector is modified to describe the location and a geometry is created in *range describing a 2 units large area centered on *sector.
 
int ped_unit_parse_custom (const char *str, const PedDevice *dev, PedUnit unit, PedSector *sector, PedGeometry **range)
 If str contains a valid description of a location on dev, then *sector is modified to describe the location and a geometry is created in *range describing a 2 units large area centered on *sector.
 
void ped_unit_set_default (PedUnit unit)
 Set the default unit used by subsequent calls to the PedUnit API.