Skip to main content

Crate qtty_ffi

Crate qtty_ffi 

Source
Expand description

C-compatible FFI bindings for qtty.

qtty-ffi exposes a stable ABI around qtty’s unit registry and conversion logic. It is intended for C and C++ adapters, and for Rust crates that need to mirror qtty quantities across an FFI boundary.

§What this crate provides

  • ABI-stable carrier structs such as QttyQuantity and QttyDerivedQuantity
  • stable UnitId and DimensionId discriminants
  • extern "C" functions for construction, conversion, validation, and formatting
  • a generated public header at include/qtty_ffi.h
  • optional Rust-side qtty_serde and pyo3 helpers

§Quick Start (C/C++)

#include "qtty_ffi.h"

qtty_quantity_t meters;
qtty_quantity_make(1000.0, UNIT_ID_METER, &meters);

qtty_quantity_t kilometers;
if (qtty_quantity_convert(meters, UNIT_ID_KILOMETER, &kilometers) == QTTY_OK) {
    /* kilometers.value == 1.0 */
}

§Quick Start (Rust)

use qtty::Meter;
use qtty_ffi::{QttyQuantity, UnitId};

let qty: QttyQuantity = Meter::new(12.5).into();
assert_eq!(qty.unit, UnitId::Meter as u32);

§ABI Stability

Existing UnitId and DimensionId values, carrier layouts, status codes, and exported function signatures are part of the ABI contract. New units or functions may be added in future releases, but existing values remain stable.

§Error Handling

All FFI functions return status codes:

Format flags for qtty_quantity_format:

§Thread Safety

All functions are thread-safe. The library contains no global mutable state.

Modules§

helpers
Trait implementations for downstream crate integration.
macros
Macros for implementing FFI conversions for qtty unit types.
registry
Unit registry and conversion logic for FFI.

Macros§

impl_unit_ffi
Implements From<$qty_type> for QttyQuantity and TryFrom<QttyQuantity> for $qty_type.

Structs§

QttyDerivedQuantity
A derived quantity representing a compound unit (numerator/denominator).
QttyQuantity
A POD quantity carrier type suitable for FFI.

Enums§

DimensionId
Dimension identifier for FFI.
QttyStatus
Status codes returned by every qtty-ffi function.
UnitId
Unit identifier for FFI.

Constants§

QTTY_FMT_DEFAULT
Format flag: default decimal notation (e.g. "1234.57 m").
QTTY_FMT_LOWER_EXP
Format flag: scientific notation with lowercase e (e.g. "1.23e3 m").
QTTY_FMT_UPPER_EXP
Format flag: scientific notation with uppercase E (e.g. "1.23E3 m").
QTTY_UNIT_ACRE
Raw unit ID constant for Acre (Area).
QTTY_UNIT_AIRMASS
Raw unit ID constant for Airmass (Dimensionless).
QTTY_UNIT_ALBEDO
Raw unit ID constant for Albedo (Dimensionless).
QTTY_UNIT_AMPERE
Raw unit ID constant for Ampere (Current).
QTTY_UNIT_ARCMINUTE
Raw unit ID constant for Arcminute (Angle).
QTTY_UNIT_ARCSECOND
Raw unit ID constant for Arcsecond (Angle).
QTTY_UNIT_ARE
Raw unit ID constant for Are (Area).
QTTY_UNIT_ASTRONOMICAL_UNIT
Raw unit ID constant for AstronomicalUnit (Length).
QTTY_UNIT_ATMOSPHERE
Raw unit ID constant for Atmosphere (Pressure).
QTTY_UNIT_ATOMIC_MASS_UNIT
Raw unit ID constant for AtomicMassUnit (Mass).
QTTY_UNIT_ATTOGRAM
Raw unit ID constant for Attogram (Mass).
QTTY_UNIT_ATTOMETER
Raw unit ID constant for Attometer (Length).
QTTY_UNIT_ATTOSECOND
Raw unit ID constant for Attosecond (Time).
QTTY_UNIT_ATTOWATT
Raw unit ID constant for Attowatt (Power).
QTTY_UNIT_BAR
Raw unit ID constant for Bar (Pressure).
QTTY_UNIT_BOHR_RADIUS
Raw unit ID constant for BohrRadius (Length).
QTTY_UNIT_BRITISH_THERMAL_UNIT
Raw unit ID constant for BritishThermalUnit (Energy).
QTTY_UNIT_CALORIE
Raw unit ID constant for Calorie (Energy).
QTTY_UNIT_CANDELA
Raw unit ID constant for Candela (LuminousIntensity).
QTTY_UNIT_CARAT
Raw unit ID constant for Carat (Mass).
QTTY_UNIT_CENTIGRAM
Raw unit ID constant for Centigram (Mass).
QTTY_UNIT_CENTILITER
Raw unit ID constant for Centiliter (Volume).
QTTY_UNIT_CENTIMETER
Raw unit ID constant for Centimeter (Length).
QTTY_UNIT_CENTISECOND
Raw unit ID constant for Centisecond (Time).
QTTY_UNIT_CENTURY
Raw unit ID constant for Century (Time).
QTTY_UNIT_CHAIN
Raw unit ID constant for Chain (Length).
QTTY_UNIT_CLASSICAL_ELECTRON_RADIUS
Raw unit ID constant for ClassicalElectronRadius (Length).
QTTY_UNIT_COULOMB
Raw unit ID constant for Coulomb (Charge).
QTTY_UNIT_CUBIC_CENTIMETER
Raw unit ID constant for CubicCentimeter (Volume).
QTTY_UNIT_CUBIC_FOOT
Raw unit ID constant for CubicFoot (Volume).
QTTY_UNIT_CUBIC_INCH
Raw unit ID constant for CubicInch (Volume).
QTTY_UNIT_CUBIC_KILOMETER
Raw unit ID constant for CubicKilometer (Volume).
QTTY_UNIT_CUBIC_METER
Raw unit ID constant for CubicMeter (Volume).
QTTY_UNIT_CUBIC_MILLIMETER
Raw unit ID constant for CubicMillimeter (Volume).
QTTY_UNIT_DAY
Raw unit ID constant for Day (Time).
QTTY_UNIT_DECADE
Raw unit ID constant for Decade (Time).
QTTY_UNIT_DECAGRAM
Raw unit ID constant for Decagram (Mass).
QTTY_UNIT_DECAMETER
Raw unit ID constant for Decameter (Length).
QTTY_UNIT_DECASECOND
Raw unit ID constant for Decasecond (Time).
QTTY_UNIT_DECAWATT
Raw unit ID constant for Decawatt (Power).
QTTY_UNIT_DECIGRAM
Raw unit ID constant for Decigram (Mass).
QTTY_UNIT_DECILITER
Raw unit ID constant for Deciliter (Volume).
QTTY_UNIT_DECIMETER
Raw unit ID constant for Decimeter (Length).
QTTY_UNIT_DECISECOND
Raw unit ID constant for Decisecond (Time).
QTTY_UNIT_DECIWATT
Raw unit ID constant for Deciwatt (Power).
QTTY_UNIT_DEGREE
Raw unit ID constant for Degree (Angle).
QTTY_UNIT_DYNE
Raw unit ID constant for Dyne (Force).
QTTY_UNIT_EARTH_EQUATORIAL_CIRCUMFERENCE
Raw unit ID constant for EarthEquatorialCircumference (Length).
QTTY_UNIT_EARTH_MERIDIONAL_CIRCUMFERENCE
Raw unit ID constant for EarthMeridionalCircumference (Length).
QTTY_UNIT_ELECTRONVOLT
Raw unit ID constant for Electronvolt (Energy).
QTTY_UNIT_ELECTRON_REDUCED_COMPTON_WAVELENGTH
Raw unit ID constant for ElectronReducedComptonWavelength (Length).
QTTY_UNIT_ERG
Raw unit ID constant for Erg (Energy).
QTTY_UNIT_ERG_PER_SECOND
Raw unit ID constant for ErgPerSecond (Power).
QTTY_UNIT_ERG_PER_SECOND_SQUARE_CENTIMETER_STERADIAN
Raw unit ID constant for ErgPerSecondSquareCentimeterSteradian (Radiance).
QTTY_UNIT_ERG_PER_SECOND_SQUARE_CENTIMETER_STERADIAN_ANGSTROM
Raw unit ID constant for ErgPerSecondSquareCentimeterSteradianAngstrom (SpectralRadiance).
QTTY_UNIT_EXAGRAM
Raw unit ID constant for Exagram (Mass).
QTTY_UNIT_EXAMETER
Raw unit ID constant for Exameter (Length).
QTTY_UNIT_EXAWATT
Raw unit ID constant for Exawatt (Power).
QTTY_UNIT_FARAD
Raw unit ID constant for Farad (Capacitance).
QTTY_UNIT_FATHOM
Raw unit ID constant for Fathom (Length).
QTTY_UNIT_FEMTOGRAM
Raw unit ID constant for Femtogram (Mass).
QTTY_UNIT_FEMTOMETER
Raw unit ID constant for Femtometer (Length).
QTTY_UNIT_FEMTOSECOND
Raw unit ID constant for Femtosecond (Time).
QTTY_UNIT_FEMTOWATT
Raw unit ID constant for Femtowatt (Power).
QTTY_UNIT_FOOT
Raw unit ID constant for Foot (Length).
QTTY_UNIT_FORTNIGHT
Raw unit ID constant for Fortnight (Time).
QTTY_UNIT_GIGAGRAM
Raw unit ID constant for Gigagram (Mass).
QTTY_UNIT_GIGAHERTZ
Raw unit ID constant for Gigahertz (Frequency).
QTTY_UNIT_GIGAJOULE
Raw unit ID constant for Gigajoule (Energy).
QTTY_UNIT_GIGAMETER
Raw unit ID constant for Gigameter (Length).
QTTY_UNIT_GIGANEWTON
Raw unit ID constant for Giganewton (Force).
QTTY_UNIT_GIGAPARSEC
Raw unit ID constant for Gigaparsec (Length).
QTTY_UNIT_GIGAPASCAL
Raw unit ID constant for Gigapascal (Pressure).
QTTY_UNIT_GIGASECOND
Raw unit ID constant for Gigasecond (Time).
QTTY_UNIT_GIGAWATT
Raw unit ID constant for Gigawatt (Power).
QTTY_UNIT_GRADIAN
Raw unit ID constant for Gradian (Angle).
QTTY_UNIT_GRAIN
Raw unit ID constant for Grain (Mass).
QTTY_UNIT_GRAM
Raw unit ID constant for Gram (Mass).
QTTY_UNIT_GRAM_PER_CUBIC_CENTIMETER
Raw unit ID constant for GramPerCubicCentimeter (Density).
QTTY_UNIT_GRAM_PER_MILLILITER
Raw unit ID constant for GramPerMilliliter (Density).
QTTY_UNIT_HECTARE
Raw unit ID constant for Hectare (Area).
QTTY_UNIT_HECTOGRAM
Raw unit ID constant for Hectogram (Mass).
QTTY_UNIT_HECTOMETER
Raw unit ID constant for Hectometer (Length).
QTTY_UNIT_HECTOPASCAL
Raw unit ID constant for Hectopascal (Pressure).
QTTY_UNIT_HECTOSECOND
Raw unit ID constant for Hectosecond (Time).
QTTY_UNIT_HECTOWATT
Raw unit ID constant for Hectowatt (Power).
QTTY_UNIT_HENRY
Raw unit ID constant for Henry (Inductance).
QTTY_UNIT_HERTZ
Raw unit ID constant for Hertz (Frequency).
QTTY_UNIT_HORSEPOWER_ELECTRIC
Raw unit ID constant for HorsepowerElectric (Power).
QTTY_UNIT_HORSEPOWER_METRIC
Raw unit ID constant for HorsepowerMetric (Power).
QTTY_UNIT_HOUR
Raw unit ID constant for Hour (Time).
QTTY_UNIT_HOUR_ANGLE
Raw unit ID constant for HourAngle (Angle).
QTTY_UNIT_ILLUMINATION_FRACTION
Raw unit ID constant for IlluminationFraction (Dimensionless).
QTTY_UNIT_INCH
Raw unit ID constant for Inch (Length).
QTTY_UNIT_INCH_OF_MERCURY
Raw unit ID constant for InchOfMercury (Pressure).
QTTY_UNIT_JOULE
Raw unit ID constant for Joule (Energy).
QTTY_UNIT_JULIAN_CENTURY
Raw unit ID constant for JulianCentury (Time).
QTTY_UNIT_JULIAN_YEAR
Raw unit ID constant for JulianYear (Time).
QTTY_UNIT_KELVIN
Raw unit ID constant for Kelvin (Temperature).
QTTY_UNIT_KILOAMPERE
Raw unit ID constant for Kiloampere (Current).
QTTY_UNIT_KILOCALORIE
Raw unit ID constant for Kilocalorie (Energy).
QTTY_UNIT_KILOCOULOMB
Raw unit ID constant for Kilocoulomb (Charge).
QTTY_UNIT_KILOELECTRONVOLT
Raw unit ID constant for Kiloelectronvolt (Energy).
QTTY_UNIT_KILOGRAM
Raw unit ID constant for Kilogram (Mass).
QTTY_UNIT_KILOGRAM_PER_CUBIC_METER
Raw unit ID constant for KilogramPerCubicMeter (Density).
QTTY_UNIT_KILOHERTZ
Raw unit ID constant for Kilohertz (Frequency).
QTTY_UNIT_KILOHM
Raw unit ID constant for Kilohm (Resistance).
QTTY_UNIT_KILOJOULE
Raw unit ID constant for Kilojoule (Energy).
QTTY_UNIT_KILOLUMEN
Raw unit ID constant for Kilolumen (LuminousFlux).
QTTY_UNIT_KILOLUX
Raw unit ID constant for Kilolux (Illuminance).
QTTY_UNIT_KILOMETER
Raw unit ID constant for Kilometer (Length).
QTTY_UNIT_KILOMOLE
Raw unit ID constant for Kilomole (AmountOfSubstance).
QTTY_UNIT_KILONEWTON
Raw unit ID constant for Kilonewton (Force).
QTTY_UNIT_KILOPARSEC
Raw unit ID constant for Kiloparsec (Length).
QTTY_UNIT_KILOPASCAL
Raw unit ID constant for Kilopascal (Pressure).
QTTY_UNIT_KILOSECOND
Raw unit ID constant for Kilosecond (Time).
QTTY_UNIT_KILOVOLT
Raw unit ID constant for Kilovolt (Voltage).
QTTY_UNIT_KILOWATT
Raw unit ID constant for Kilowatt (Power).
QTTY_UNIT_KILOWATT_HOUR
Raw unit ID constant for KilowattHour (Energy).
QTTY_UNIT_LIGHT_YEAR
Raw unit ID constant for LightYear (Length).
QTTY_UNIT_LINK
Raw unit ID constant for Link (Length).
QTTY_UNIT_LITER
Raw unit ID constant for Liter (Volume).
QTTY_UNIT_LONG_TON
Raw unit ID constant for LongTon (Mass).
QTTY_UNIT_LUMEN
Raw unit ID constant for Lumen (LuminousFlux).
QTTY_UNIT_LUX
Raw unit ID constant for Lux (Illuminance).
QTTY_UNIT_MEGAELECTRONVOLT
Raw unit ID constant for Megaelectronvolt (Energy).
QTTY_UNIT_MEGAGRAM
Raw unit ID constant for Megagram (Mass).
QTTY_UNIT_MEGAHERTZ
Raw unit ID constant for Megahertz (Frequency).
QTTY_UNIT_MEGAJOULE
Raw unit ID constant for Megajoule (Energy).
QTTY_UNIT_MEGAMETER
Raw unit ID constant for Megameter (Length).
QTTY_UNIT_MEGANEWTON
Raw unit ID constant for Meganewton (Force).
QTTY_UNIT_MEGAOHM
Raw unit ID constant for Megaohm (Resistance).
QTTY_UNIT_MEGAPARSEC
Raw unit ID constant for Megaparsec (Length).
QTTY_UNIT_MEGAPASCAL
Raw unit ID constant for Megapascal (Pressure).
QTTY_UNIT_MEGASECOND
Raw unit ID constant for Megasecond (Time).
QTTY_UNIT_MEGAVOLT
Raw unit ID constant for Megavolt (Voltage).
QTTY_UNIT_MEGAWATT
Raw unit ID constant for Megawatt (Power).
QTTY_UNIT_METER
Raw unit ID constant for Meter (Length).
QTTY_UNIT_METER_PER_SECOND_SQUARED
Raw unit ID constant for MeterPerSecondSquared (Acceleration).
QTTY_UNIT_MICROAMPERE
Raw unit ID constant for Microampere (Current).
QTTY_UNIT_MICROCOULOMB
Raw unit ID constant for Microcoulomb (Charge).
QTTY_UNIT_MICROFARAD
Raw unit ID constant for Microfarad (Capacitance).
QTTY_UNIT_MICROGRAM
Raw unit ID constant for Microgram (Mass).
QTTY_UNIT_MICROHENRY
Raw unit ID constant for Microhenry (Inductance).
QTTY_UNIT_MICROJOULE
Raw unit ID constant for Microjoule (Energy).
QTTY_UNIT_MICROLITER
Raw unit ID constant for Microliter (Volume).
QTTY_UNIT_MICROMETER
Raw unit ID constant for Micrometer (Length).
QTTY_UNIT_MICROMOLE
Raw unit ID constant for Micromole (AmountOfSubstance).
QTTY_UNIT_MICRONEWTON
Raw unit ID constant for Micronewton (Force).
QTTY_UNIT_MICROSECOND
Raw unit ID constant for Microsecond (Time).
QTTY_UNIT_MICROTESLA
Raw unit ID constant for Microtesla (MagneticFluxDensity).
QTTY_UNIT_MICROVOLT
Raw unit ID constant for Microvolt (Voltage).
QTTY_UNIT_MICROWATT
Raw unit ID constant for Microwatt (Power).
QTTY_UNIT_MICRO_ARCSECOND
Raw unit ID constant for MicroArcsecond (Angle).
QTTY_UNIT_MILE
Raw unit ID constant for Mile (Length).
QTTY_UNIT_MILLENNIUM
Raw unit ID constant for Millennium (Time).
QTTY_UNIT_MILLIAMPERE
Raw unit ID constant for Milliampere (Current).
QTTY_UNIT_MILLICOULOMB
Raw unit ID constant for Millicoulomb (Charge).
QTTY_UNIT_MILLIFARAD
Raw unit ID constant for Millifarad (Capacitance).
QTTY_UNIT_MILLIGRAM
Raw unit ID constant for Milligram (Mass).
QTTY_UNIT_MILLIHENRY
Raw unit ID constant for Millihenry (Inductance).
QTTY_UNIT_MILLIHERTZ
Raw unit ID constant for Millihertz (Frequency).
QTTY_UNIT_MILLIJOULE
Raw unit ID constant for Millijoule (Energy).
QTTY_UNIT_MILLILITER
Raw unit ID constant for Milliliter (Volume).
QTTY_UNIT_MILLILUMEN
Raw unit ID constant for Millilumen (LuminousFlux).
QTTY_UNIT_MILLILUX
Raw unit ID constant for Millilux (Illuminance).
QTTY_UNIT_MILLIMETER
Raw unit ID constant for Millimeter (Length).
QTTY_UNIT_MILLIMETER_OF_MERCURY
Raw unit ID constant for MillimeterOfMercury (Pressure).
QTTY_UNIT_MILLIMOLE
Raw unit ID constant for Millimole (AmountOfSubstance).
QTTY_UNIT_MILLINEWTON
Raw unit ID constant for Millinewton (Force).
QTTY_UNIT_MILLIOHM
Raw unit ID constant for Milliohm (Resistance).
QTTY_UNIT_MILLIPASCAL
Raw unit ID constant for Millipascal (Pressure).
QTTY_UNIT_MILLIRADIAN
Raw unit ID constant for Milliradian (Angle).
QTTY_UNIT_MILLISECOND
Raw unit ID constant for Millisecond (Time).
QTTY_UNIT_MILLITESLA
Raw unit ID constant for Millitesla (MagneticFluxDensity).
QTTY_UNIT_MILLIVOLT
Raw unit ID constant for Millivolt (Voltage).
QTTY_UNIT_MILLIWATT
Raw unit ID constant for Milliwatt (Power).
QTTY_UNIT_MILLIWEBER
Raw unit ID constant for Milliweber (MagneticFlux).
QTTY_UNIT_MILLI_ARCSECOND
Raw unit ID constant for MilliArcsecond (Angle).
QTTY_UNIT_MINUTE
Raw unit ID constant for Minute (Time).
QTTY_UNIT_MOLE
Raw unit ID constant for Mole (AmountOfSubstance).
QTTY_UNIT_NANOFARAD
Raw unit ID constant for Nanofarad (Capacitance).
QTTY_UNIT_NANOGRAM
Raw unit ID constant for Nanogram (Mass).
QTTY_UNIT_NANOJOULE
Raw unit ID constant for Nanojoule (Energy).
QTTY_UNIT_NANOMETER
Raw unit ID constant for Nanometer (Length).
QTTY_UNIT_NANOMOLE
Raw unit ID constant for Nanomole (AmountOfSubstance).
QTTY_UNIT_NANOSECOND
Raw unit ID constant for Nanosecond (Time).
QTTY_UNIT_NANOWATT
Raw unit ID constant for Nanowatt (Power).
QTTY_UNIT_NAUTICAL_MILE
Raw unit ID constant for NauticalMile (Length).
QTTY_UNIT_NEWTON
Raw unit ID constant for Newton (Force).
QTTY_UNIT_NOMINAL_EARTH_EQUATORIAL_RADIUS
Raw unit ID constant for NominalEarthEquatorialRadius (Length).
QTTY_UNIT_NOMINAL_EARTH_POLAR_RADIUS
Raw unit ID constant for NominalEarthPolarRadius (Length).
QTTY_UNIT_NOMINAL_EARTH_RADIUS
Raw unit ID constant for NominalEarthRadius (Length).
QTTY_UNIT_NOMINAL_JUPITER_RADIUS
Raw unit ID constant for NominalJupiterRadius (Length).
QTTY_UNIT_NOMINAL_LUNAR_DISTANCE
Raw unit ID constant for NominalLunarDistance (Length).
QTTY_UNIT_NOMINAL_LUNAR_RADIUS
Raw unit ID constant for NominalLunarRadius (Length).
QTTY_UNIT_NOMINAL_SOLAR_DIAMETER
Raw unit ID constant for NominalSolarDiameter (Length).
QTTY_UNIT_NOMINAL_SOLAR_RADIUS
Raw unit ID constant for NominalSolarRadius (Length).
QTTY_UNIT_OHM
Raw unit ID constant for Ohm (Resistance).
QTTY_UNIT_OPTICAL_DEPTH
Raw unit ID constant for OpticalDepth (Dimensionless).
QTTY_UNIT_OUNCE
Raw unit ID constant for Ounce (Mass).
QTTY_UNIT_PARSEC
Raw unit ID constant for Parsec (Length).
QTTY_UNIT_PASCAL
Raw unit ID constant for Pascal (Pressure).
QTTY_UNIT_PETAGRAM
Raw unit ID constant for Petagram (Mass).
QTTY_UNIT_PETAMETER
Raw unit ID constant for Petameter (Length).
QTTY_UNIT_PETAWATT
Raw unit ID constant for Petawatt (Power).
QTTY_UNIT_PHOTON_PER_SQUARE_CENTIMETER_NANOSECOND_STERADIAN
Raw unit ID constant for PhotonPerSquareCentimeterNanosecondSteradian (PhotonRadiance).
QTTY_UNIT_PHOTON_PER_SQUARE_CENTIMETER_NANOSECOND_STERADIAN_NANOMETER
Raw unit ID constant for PhotonPerSquareCentimeterNanosecondSteradianNanometer (SpectralPhotonRadiance).
QTTY_UNIT_PHOTON_PER_SQUARE_CENTIMETER_SECOND_STERADIAN
Raw unit ID constant for PhotonPerSquareCentimeterSecondSteradian (PhotonRadiance).
QTTY_UNIT_PHOTON_PER_SQUARE_CENTIMETER_SECOND_STERADIAN_ANGSTROM
Raw unit ID constant for PhotonPerSquareCentimeterSecondSteradianAngstrom (SpectralPhotonRadiance).
QTTY_UNIT_PHOTON_PER_SQUARE_CENTIMETER_SECOND_STERADIAN_NANOMETER
Raw unit ID constant for PhotonPerSquareCentimeterSecondSteradianNanometer (SpectralPhotonRadiance).
QTTY_UNIT_PHOTON_PER_SQUARE_METER_SECOND_STERADIAN
Raw unit ID constant for PhotonPerSquareMeterSecondSteradian (PhotonRadiance).
QTTY_UNIT_PHOTON_PER_SQUARE_METER_SECOND_STERADIAN_METER
Raw unit ID constant for PhotonPerSquareMeterSecondSteradianMeter (SpectralPhotonRadiance).
QTTY_UNIT_PICOFARAD
Raw unit ID constant for Picofarad (Capacitance).
QTTY_UNIT_PICOGRAM
Raw unit ID constant for Picogram (Mass).
QTTY_UNIT_PICOJOULE
Raw unit ID constant for Picojoule (Energy).
QTTY_UNIT_PICOMETER
Raw unit ID constant for Picometer (Length).
QTTY_UNIT_PICOSECOND
Raw unit ID constant for Picosecond (Time).
QTTY_UNIT_PICOWATT
Raw unit ID constant for Picowatt (Power).
QTTY_UNIT_PLANCK_LENGTH
Raw unit ID constant for PlanckLength (Length).
QTTY_UNIT_POUND
Raw unit ID constant for Pound (Mass).
QTTY_UNIT_POUND_FORCE
Raw unit ID constant for PoundForce (Force).
QTTY_UNIT_POUND_PER_CUBIC_FOOT
Raw unit ID constant for PoundPerCubicFoot (Density).
QTTY_UNIT_POUND_PER_SQUARE_INCH
Raw unit ID constant for PoundPerSquareInch (Pressure).
QTTY_UNIT_RADIAN
Raw unit ID constant for Radian (Angle).
QTTY_UNIT_RANKINE
Raw unit ID constant for Rankine (Temperature).
QTTY_UNIT_REFRACTIVITY
Raw unit ID constant for Refractivity (Dimensionless).
QTTY_UNIT_ROD
Raw unit ID constant for Rod (Length).
QTTY_UNIT_S10
Raw unit ID constant for S10 (InverseSolidAngle).
QTTY_UNIT_SECOND
Raw unit ID constant for Second (Time).
QTTY_UNIT_SHORT_TON
Raw unit ID constant for ShortTon (Mass).
QTTY_UNIT_SIDEREAL_DAY
Raw unit ID constant for SiderealDay (Time).
QTTY_UNIT_SIDEREAL_YEAR
Raw unit ID constant for SiderealYear (Time).
QTTY_UNIT_SOLAR_LUMINOSITY
Raw unit ID constant for SolarLuminosity (Power).
QTTY_UNIT_SOLAR_MASS
Raw unit ID constant for SolarMass (Mass).
QTTY_UNIT_SQUARE_ARCMINUTE
Raw unit ID constant for SquareArcminute (SolidAngle).
QTTY_UNIT_SQUARE_ARCSECOND
Raw unit ID constant for SquareArcsecond (SolidAngle).
QTTY_UNIT_SQUARE_CENTIMETER
Raw unit ID constant for SquareCentimeter (Area).
QTTY_UNIT_SQUARE_DEGREE
Raw unit ID constant for SquareDegree (SolidAngle).
QTTY_UNIT_SQUARE_FOOT
Raw unit ID constant for SquareFoot (Area).
QTTY_UNIT_SQUARE_INCH
Raw unit ID constant for SquareInch (Area).
QTTY_UNIT_SQUARE_KILOMETER
Raw unit ID constant for SquareKilometer (Area).
QTTY_UNIT_SQUARE_METER
Raw unit ID constant for SquareMeter (Area).
QTTY_UNIT_SQUARE_MILE
Raw unit ID constant for SquareMile (Area).
QTTY_UNIT_SQUARE_MILLIMETER
Raw unit ID constant for SquareMillimeter (Area).
QTTY_UNIT_SQUARE_MILLIRADIAN
Raw unit ID constant for SquareMilliradian (SolidAngle).
QTTY_UNIT_SQUARE_YARD
Raw unit ID constant for SquareYard (Area).
QTTY_UNIT_STANDARD_GRAVITY
Raw unit ID constant for StandardGravity (Acceleration).
QTTY_UNIT_STERADIAN
Raw unit ID constant for Steradian (SolidAngle).
QTTY_UNIT_STONE
Raw unit ID constant for Stone (Mass).
QTTY_UNIT_SYNODIC_MONTH
Raw unit ID constant for SynodicMonth (Time).
QTTY_UNIT_TERAGRAM
Raw unit ID constant for Teragram (Mass).
QTTY_UNIT_TERAHERTZ
Raw unit ID constant for Terahertz (Frequency).
QTTY_UNIT_TERAJOULE
Raw unit ID constant for Terajoule (Energy).
QTTY_UNIT_TERAMETER
Raw unit ID constant for Terameter (Length).
QTTY_UNIT_TERASECOND
Raw unit ID constant for Terasecond (Time).
QTTY_UNIT_TERAWATT
Raw unit ID constant for Terawatt (Power).
QTTY_UNIT_TESLA
Raw unit ID constant for Tesla (MagneticFluxDensity).
QTTY_UNIT_THERM
Raw unit ID constant for Therm (Energy).
QTTY_UNIT_TONNE
Raw unit ID constant for Tonne (Mass).
QTTY_UNIT_TORR
Raw unit ID constant for Torr (Pressure).
QTTY_UNIT_TRANSMITTANCE
Raw unit ID constant for Transmittance (Dimensionless).
QTTY_UNIT_TURN
Raw unit ID constant for Turn (Angle).
QTTY_UNIT_US_FLUID_OUNCE
Raw unit ID constant for UsFluidOunce (Volume).
QTTY_UNIT_US_GALLON
Raw unit ID constant for UsGallon (Volume).
QTTY_UNIT_VOLT
Raw unit ID constant for Volt (Voltage).
QTTY_UNIT_WATT
Raw unit ID constant for Watt (Power).
QTTY_UNIT_WATT_HOUR
Raw unit ID constant for WattHour (Energy).
QTTY_UNIT_WATT_PER_SQUARE_METER_STERADIAN
Raw unit ID constant for WattPerSquareMeterSteradian (Radiance).
QTTY_UNIT_WATT_PER_SQUARE_METER_STERADIAN_METER
Raw unit ID constant for WattPerSquareMeterSteradianMeter (SpectralRadiance).
QTTY_UNIT_WATT_PER_SQUARE_METER_STERADIAN_NANOMETER
Raw unit ID constant for WattPerSquareMeterSteradianNanometer (SpectralRadiance).
QTTY_UNIT_WEBER
Raw unit ID constant for Weber (MagneticFlux).
QTTY_UNIT_WEEK
Raw unit ID constant for Week (Time).
QTTY_UNIT_YARD
Raw unit ID constant for Yard (Length).
QTTY_UNIT_YEAR
Raw unit ID constant for Year (Time).
QTTY_UNIT_YOCTOGRAM
Raw unit ID constant for Yoctogram (Mass).
QTTY_UNIT_YOCTOMETER
Raw unit ID constant for Yoctometer (Length).
QTTY_UNIT_YOCTOWATT
Raw unit ID constant for Yoctowatt (Power).
QTTY_UNIT_YOTTAGRAM
Raw unit ID constant for Yottagram (Mass).
QTTY_UNIT_YOTTAMETER
Raw unit ID constant for Yottameter (Length).
QTTY_UNIT_YOTTAWATT
Raw unit ID constant for Yottawatt (Power).
QTTY_UNIT_ZEPTOGRAM
Raw unit ID constant for Zeptogram (Mass).
QTTY_UNIT_ZEPTOMETER
Raw unit ID constant for Zeptometer (Length).
QTTY_UNIT_ZEPTOWATT
Raw unit ID constant for Zeptowatt (Power).
QTTY_UNIT_ZETTAGRAM
Raw unit ID constant for Zettagram (Mass).
QTTY_UNIT_ZETTAMETER
Raw unit ID constant for Zettameter (Length).
QTTY_UNIT_ZETTAWATT
Raw unit ID constant for Zettawatt (Power).

Functions§

qtty_derived_convert
Converts a derived quantity to different units.
qtty_derived_make
Creates a new derived quantity (compound unit like m/s).
qtty_ffi_version
Returns the FFI ABI version (major10000 + minor100 + patch).
qtty_quantity_convert
Converts a quantity to a different unit.
qtty_quantity_convert_value
Converts a raw value from one unit to another.
qtty_quantity_format
Formats a quantity as a human-readable string into a caller-provided buffer.
qtty_quantity_make
Creates a new quantity with the given value and unit.
qtty_unit_dimension
Gets the dimension of a unit.
qtty_unit_is_valid
Checks if a raw unit ID is valid (recognized by the registry).
qtty_unit_name
Gets the name of a unit as a NUL-terminated C string.
qtty_units_compatible
Checks if two units are compatible (same dimension).