libSBML Perl API  libSBML 5.17.2 Perl API
UnitKind.c File Reference

SBML UnitKind enumeration. More...

Include dependency graph for UnitKind.c:

Functions

int UnitKind_equals (UnitKind_t uk1, UnitKind_t uk2)
 Tests for logical equality between two given UNIT_KIND_ code values. More...
 
UnitKind_t UnitKind_forName (const char *name)
 Converts a text string naming a kind of unit to its corresponding libSBML UNIT_KIND_ constant/enumeration value. More...
 
int UnitKind_isValidUnitKindString (const char *str, unsigned int level, unsigned int version)
 Predicate for testing whether a given string corresponds to a predefined libSBML unit code. More...
 
const char * UnitKind_toString (UnitKind_t uk)
 Converts a unit code to a text string equivalent. More...
 

Variables

const char * UNIT_KIND_STRINGS []
 

Detailed Description

SBML UnitKind enumeration.

Author
Ben Bornstein

Function Documentation

◆ UnitKind_equals()

int UnitKind_equals ( UnitKind_t  uk1,
UnitKind_t  uk2 
)

Tests for logical equality between two given UNIT_KIND_ code values.

This function behaves exactly like C's == operator, except for the following two cases:

◆ UnitKind_forName()

UnitKind_t UnitKind_forName ( const char *  name)

Converts a text string naming a kind of unit to its corresponding libSBML UNIT_KIND_ constant/enumeration value.

Parameters
namea string, the name of a predefined base unit in SBML.
Returns
Note
For more information about the libSBML unit codes, please refer to the class documentation for Unit.

◆ UnitKind_isValidUnitKindString()

int UnitKind_isValidUnitKindString ( const char *  str,
unsigned int  level,
unsigned int  version 
)

Predicate for testing whether a given string corresponds to a predefined libSBML unit code.

Parameters
stra text string naming a base unit defined by SBML.
levelthe Level of SBML.
versionthe Version within the Level of SBML.
Returns
1 (true) if string is the name of a valid UNIT_KIND_ value, 0 (false) otherwise.
Note
For more information about the libSBML unit codes, please refer to the class documentation for Unit.

◆ UnitKind_toString()

const char* UnitKind_toString ( UnitKind_t  uk)

Converts a unit code to a text string equivalent.

Parameters
uk
Returns
the name corresponding to the given unit code.
Note
For more information about the libSBML unit codes, please refer to the class documentation for Unit.
Warning
The string returned is a static data value. The caller does not own the returned string and is therefore not allowed to modify it.

Variable Documentation

◆ UNIT_KIND_STRINGS

const char* UNIT_KIND_STRINGS[]