SIScalarConstants

Declares constants and utility functions for scalar values and periodic table data in the SI system.

SIScalarConstants provides functions for accessing periodic table element and isotope data, including symbols, atomic numbers, molar masses, and nuclear properties. The API is CoreFoundation-style, with explicit memory management and reference counting where applicable.

This interface supports querying element and isotope properties, as well as generating arrays of symbols and physical constants for use in scientific calculations.

Author

Philip Grandinetti

Typedefs

typedef const struct impl_OCArray *OCArrayRef
typedef const struct impl_OCString *OCStringRef
typedef const struct impl_SIScalar *SIScalarRef

Functions

OCArrayRef SIPeriodicTableCreateElementSymbols(OCStringRef *errorString)

Returns an array with the element symbols.

Parameters:
  • errorString – A pointer to an OCStringRef to store error information.

Returns:

An OCArrayRef containing the element symbols.

OCArrayRef SIPeriodicTableCreateIsotopeSymbols(OCStringRef *errorString)

Returns an array with the isotope symbols.

Parameters:
  • errorString – A pointer to an OCStringRef to store error information.

Returns:

An OCArrayRef containing the isotope symbols.

OCArrayRef SIPeriodicTableCreateStableIsotopeSymbols(OCStringRef *errorString)

Returns an array with the stable isotope symbols.

Parameters:
  • errorString – A pointer to an OCStringRef to store error information.

Returns:

An OCArrayRef containing the stable isotope symbols.

OCArrayRef SIPeriodicTableCreateNMRActiveIsotopeSymbols(OCStringRef *errorString)

Returns an array with the NMR active isotope symbols.

Parameters:
  • errorString – A pointer to an OCStringRef to store error information.

Returns:

An OCArrayRef containing the NMR active isotope symbols.

OCArrayRef SIPeriodicTableGetStableNMRActiveIsotopeSymbols(OCStringRef *errorString)

Returns an array with the stable NMR active isotope symbols.

Parameters:
  • errorString – A pointer to an OCStringRef to store error information.

Returns:

An OCArrayRef containing the stable NMR active isotope symbols.

int64_t SIPeriodicTableGetAtomicNumber(OCStringRef elementSymbol, OCStringRef *errorString)

Returns the atomic number of an element.

Parameters:
  • elementSymbol – An OCStringRef containing the element symbol.

  • errorString – A pointer to an OCStringRef to store error information.

Returns:

An integer representing the atomic number.

SIScalarRef SIPeriodicTableCreateMolarMass(OCStringRef elementSymbol, OCStringRef *errorString)

Creates a scalar with the molar mass of an element.

Parameters:
  • elementSymbol – An OCStringRef containing the element symbol.

  • errorString – A pointer to an OCStringRef to store error information.

Returns:

A SIScalarRef representing the molar mass.

bool SIPeriodicTableCreateIsotopeStable(OCStringRef isotopeSymbol, OCStringRef *errorString)

Determines whether an isotope is stable.

Parameters:
  • isotopeSymbol – An OCStringRef containing the isotope symbol.

  • errorString – A pointer to an OCStringRef to store error information.

Returns:

A boolean indicating stability.

SIScalarRef SIPeriodicTableCreateIsotopeMagneticDipoleMoment(OCStringRef isotopeSymbol, OCStringRef *errorString)

Creates a scalar with the magnetic dipole moment of an isotope.

Parameters:
  • isotopeSymbol – An OCStringRef containing the isotope symbol.

  • errorString – A pointer to an OCStringRef to store error information.

Returns:

A SIScalarRef representing the magnetic dipole moment.

SIScalarRef SIPeriodicTableCreateIsotopeElectricQuadrupoleMoment(OCStringRef isotopeSymbol, OCStringRef *errorString)

Creates a scalar with the electric quadrupole moment of an isotope.

Parameters:
  • isotopeSymbol – An OCStringRef containing the isotope symbol.

  • errorString – A pointer to an OCStringRef to store error information.

Returns:

A SIScalarRef representing the electric quadrupole moment.

SIScalarRef SIPeriodicTableCreateIsotopeGyromagneticRatio(OCStringRef isotopeSymbol, OCStringRef *errorString)

Creates a scalar with the gyromagnetic ratio of an isotope.

Parameters:
  • isotopeSymbol – An OCStringRef containing the isotope symbol.

  • errorString – A pointer to an OCStringRef to store error information.

Returns:

A SIScalarRef representing the gyromagnetic ratio.

SIScalarRef SIPeriodicTableCreateIsotopeAbundance(OCStringRef isotopeSymbol, OCStringRef *errorString)

Creates a scalar with the natural abundance of an isotope.

Parameters:
  • isotopeSymbol – An OCStringRef containing the isotope symbol.

  • errorString – A pointer to an OCStringRef to store error information.

Returns:

A SIScalarRef representing the natural abundance.

SIScalarRef SIPeriodicTableCreateIsotopeLifetime(OCStringRef isotopeSymbol, OCStringRef *errorString)

Creates a scalar with the lifetime of an isotope.

Parameters:
  • isotopeSymbol – An OCStringRef containing the isotope symbol.

  • errorString – A pointer to an OCStringRef to store error information.

Returns:

A SIScalarRef representing the lifetime.

SIScalarRef SIPeriodicTableCreateIsotopeHalfLife(OCStringRef isotopeSymbol, OCStringRef *errorString)

Creates a scalar with the half-life of an isotope.

Parameters:
  • isotopeSymbol – An OCStringRef containing the isotope symbol.

  • errorString – A pointer to an OCStringRef to store error information.

Returns:

A SIScalarRef representing the half-life.

SIScalarRef SIPeriodicTableCreateIsotopeSpin(OCStringRef isotopeSymbol, OCStringRef *errorString)

Creates a scalar with the nuclear spin of an isotope.

Parameters:
  • isotopeSymbol – An OCStringRef containing the isotope symbol.

  • errorString – A pointer to an OCStringRef to store error information.

Returns:

A SIScalarRef representing the nuclear spin.

SIScalarRef SIPeriodicTableCreateNMRFrequency(OCStringRef isotopeSymbol, OCStringRef *errorString)

Creates a scalar with the NMR frequency/magnetic flux density of an isotope.

Parameters:
  • isotopeSymbol – An OCStringRef containing the isotope symbol.

  • errorString – A pointer to an OCStringRef to store error information.

Returns:

A SIScalarRef representing the NMR frequency/magnetic flux density.

SIScalarRef SIPeriodicTableCreateFormulaMass(OCStringRef formula, OCStringRef *errorString)

Creates a scalar with the formula mass.

Parameters:
  • formula – An OCStringRef containing the chemical formula.

  • errorString – A pointer to an OCStringRef to store error information.

Returns:

A SIScalarRef representing the formula mass.

void cleanupScalarConstantsLibraries(void)

Cleanup function for scalar constants libraries.

Releases global scalar constants libraries to prevent memory leaks.