Unity 1.0
Parser for unit strings
Data Fields
SimpleUnit Struct Reference

A simple unit, corresponding to, for example, ‘MHz’. More...

#include <unity.h>

Collaboration diagram for SimpleUnit:
Collaboration graph
[legend]

Data Fields

char base10_p
 True (non-zero) if the prefix is a power of 10; false if it's a power of 2.
const UnitDefbase_unit_def
 The base unit of this unit specification, as a known unit.
char * base_unit_string
 The base unit of this unit specification.
int prefix_power
 The base-10 logarithm of the prefix in front of the unit.

Detailed Description

A simple unit, corresponding to, for example, ‘MHz’.


Field Documentation

The base unit of this unit specification, as a known unit.

If this is not a known unit (in the syntax which parsed the associated expression) then this will be NULL.

The base unit of this unit specification.

This might be ‘m’ for metres, ‘Hz’ for Hertz, and so on.

The base-10 logarithm of the prefix in front of the unit.

For example, this will be ‘-3’ for the ‘m’ (milli-) prefix.


The documentation for this struct was generated from the following file:
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines