Unity  0.8
Parser for unit strings
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Data Fields
SimpleUnit Struct Reference

A simple unit, corresponding to, for example, 'MHz'. More...

#include <unity.h>

Data Fields

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

Detailed Description

A simple unit, corresponding to, for example, 'MHz'.

Field Documentation

struct unit_definition* base_unit_def

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.

char* base_unit_string

The base unit of this unit specification.

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

int prefix_power

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: