UnitKind.c File Reference

Detailed Description

SBML UnitKind enumeration.

Author:
Ben Bornstein
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.
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.
int UnitKind_isValidUnitKindString (const char *string, unsigned int level, unsigned int version)
 Predicate for testing whether a given string corresponds to a predefined libSBML unit code.
const char * UnitKind_toString (UnitKind_t uk)
 Converts a unit code to a text string equivalent.

Variables

const char * UNIT_KIND_STRINGS []

Function Documentation

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:

In the two cases above, C equality comparison would yield false (because each of the above is a distinct enumeration value), but this function returns true.

Parameters:
uk1a UNIT_KIND_ value
uk2a second UNIT_KIND_ value to compare to uk1
Returns:
nonzero (for true) if uk1 is logically equivalent to uk2, zero (for false) otherwise.
Note:
For more information about the libSBML unit codes, please refer to the class documentation for Unit.
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.
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:
nonzero (for true) if string is the name of a valid UNIT_KIND_ value, zero (for false) otherwise.
Note:
For more information about the libSBML unit codes, please refer to the class documentation for Unit.
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

const char* UNIT_KIND_STRINGS[]
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines