Blender  V2.59
Classes | Defines | Typedefs | Functions | Variables
unit.c File Reference
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
#include <string.h>
#include <assert.h>
#include "BKE_unit.h"
#include "BLI_math.h"
#include "BLI_winstuff.h"

Go to the source code of this file.

Classes

struct  bUnitDef
struct  bUnitCollection

Defines

#define TEMP_STR_SIZE   256
#define SEP_CHR   '#'
#define SEP_STR   "#"
#define EPS   0.00001
#define UN_SC_KM   1000.0f
#define UN_SC_HM   100.0f
#define UN_SC_DAM   10.0f
#define UN_SC_M   1.0f
#define UN_SC_DM   0.1f
#define UN_SC_CM   0.01f
#define UN_SC_MM   0.001f
#define UN_SC_UM   0.000001f
#define UN_SC_MI   1609.344f
#define UN_SC_FUR   201.168f
#define UN_SC_CH   20.1168f
#define UN_SC_YD   0.9144f
#define UN_SC_FT   0.3048f
#define UN_SC_IN   0.0254f
#define UN_SC_MIL   0.0000254f
#define UN_SC_MTON   1000.0f
#define UN_SC_QL   100.0f
#define UN_SC_KG   1.0f
#define UN_SC_HG   0.1f
#define UN_SC_DAG   0.01f
#define UN_SC_G   0.001f
#define UN_SC_ITON   907.18474f
#define UN_SC_CWT   45.359237f
#define UN_SC_ST   6.35029318f
#define UN_SC_LB   0.45359237f
#define UN_SC_OZ   0.028349523125f
#define B_UNIT_DEF_NONE   0
#define B_UNIT_DEF_SUPPRESS   1
#define UNIT_SYSTEM_TOT   (((sizeof(bUnitSystems) / 9) / sizeof(void *)) - 1)

Typedefs

typedef struct bUnitDef bUnitDef
typedef struct bUnitCollection bUnitCollection

Functions

static bUnitCollectionunit_get_system (int system, int type)
static bUnitDefunit_default (bUnitCollection *usys)
static bUnitDefunit_best_fit (double value, bUnitCollection *usys, bUnitDef *unit_start, int suppress)
static void unit_dual_convert (double value, bUnitCollection *usys, bUnitDef **unit_a, bUnitDef **unit_b, double *value_a, double *value_b)
static int unit_as_string (char *str, int len_max, double value, int prec, bUnitCollection *usys, bUnitDef *unit, char pad)
void bUnit_AsString (char *str, int len_max, double value, int prec, int system, int type, int split, int pad)
static char * unit_find_str (char *str, const char *substr)
static int ch_is_op (char op)
static int unit_scale_str (char *str, int len_max, char *str_tmp, double scale_pref, bUnitDef *unit, const char *replace_str)
static int unit_replace (char *str, int len_max, char *str_tmp, double scale_pref, bUnitDef *unit)
static int unit_find (char *str, bUnitDef *unit)
int bUnit_ReplaceString (char *str, int len_max, char *str_prev, double scale_pref, int system, int type)
void bUnit_ToUnitAltName (char *str, int len_max, char *orig_str, int system, int type)
double bUnit_ClosestScalar (double value, int system, int type)
double bUnit_BaseScalar (int system, int type)
int bUnit_IsValid (int system, int type)
void bUnit_GetSystem (void **usys_pt, int *len, int system, int type)
int bUnit_GetBaseUnit (void *usys_pt)
const char * bUnit_GetName (void *usys_pt, int index)
const char * bUnit_GetNameDisplay (void *usys_pt, int index)
double bUnit_GetScaler (void *usys_pt, int index)

Variables

static struct bUnitDef buDummyDef []
static struct bUnitCollection buDummyCollecton = {buDummyDef, 0, 0, sizeof(buDummyDef)}
static struct bUnitDef buMetricLenDef []
static struct bUnitCollection buMetricLenCollecton = {buMetricLenDef, 3, 0, sizeof(buMetricLenDef)/sizeof(bUnitDef)}
static struct bUnitDef buImperialLenDef []
static struct bUnitCollection buImperialLenCollecton = {buImperialLenDef, 4, 0, sizeof(buImperialLenDef)/sizeof(bUnitDef)}
static struct bUnitDef buMetricAreaDef []
static struct bUnitCollection buMetricAreaCollecton = {buMetricAreaDef, 3, 0, sizeof(buMetricAreaDef)/sizeof(bUnitDef)}
static struct bUnitDef buImperialAreaDef []
static struct bUnitCollection buImperialAreaCollecton = {buImperialAreaDef, 4, 0, sizeof(buImperialAreaDef)/sizeof(bUnitDef)}
static struct bUnitDef buMetricVolDef []
static struct bUnitCollection buMetricVolCollecton = {buMetricVolDef, 3, 0, sizeof(buMetricVolDef)/sizeof(bUnitDef)}
static struct bUnitDef buImperialVolDef []
static struct bUnitCollection buImperialVolCollecton = {buImperialVolDef, 4, 0, sizeof(buImperialVolDef)/sizeof(bUnitDef)}
static struct bUnitDef buMetricMassDef []
static struct bUnitCollection buMetricMassCollecton = {buMetricMassDef, 2, 0, sizeof(buMetricMassDef)/sizeof(bUnitDef)}
static struct bUnitDef buImperialMassDef []
static struct bUnitCollection buImperialMassCollecton = {buImperialMassDef, 3, 0, sizeof(buImperialMassDef)/sizeof(bUnitDef)}
static struct bUnitDef buMetricVelDef []
static struct bUnitCollection buMetricVelCollecton = {buMetricVelDef, 0, 0, sizeof(buMetricVelDef)/sizeof(bUnitDef)}
static struct bUnitDef buImperialVelDef []
static struct bUnitCollection buImperialVelCollecton = {buImperialVelDef, 0, 0, sizeof(buImperialVelDef)/sizeof(bUnitDef)}
static struct bUnitDef buMetricAclDef []
static struct bUnitCollection buMetricAclCollecton = {buMetricAclDef, 0, 0, sizeof(buMetricAclDef)/sizeof(bUnitDef)}
static struct bUnitDef buImperialAclDef []
static struct bUnitCollection buImperialAclCollecton = {buImperialAclDef, 0, 0, sizeof(buImperialAclDef)/sizeof(bUnitDef)}
static struct bUnitDef buNaturalTimeDef []
static struct bUnitCollection buNaturalTimeCollecton = {buNaturalTimeDef, 3, 0, sizeof(buNaturalTimeDef)/sizeof(bUnitDef)}
static struct bUnitDef buNaturalRotDef []
static struct bUnitCollection buNaturalRotCollection = {buNaturalRotDef, 0, 0, sizeof(buNaturalRotDef)/sizeof(bUnitDef)}
static struct bUnitCollectionbUnitSystems [][9]

Detailed Description

Definition in file unit.c.


Define Documentation

#define B_UNIT_DEF_NONE   0

Definition at line 92 of file unit.c.

#define B_UNIT_DEF_SUPPRESS   1

Definition at line 93 of file unit.c.

Referenced by unit_best_fit().

#define EPS   0.00001

Definition at line 45 of file unit.c.

Referenced by unit_best_fit().

#define SEP_CHR   '#'

Definition at line 42 of file unit.c.

Referenced by bUnit_ReplaceString().

#define SEP_STR   "#"

Definition at line 43 of file unit.c.

Referenced by unit_scale_str().

#define TEMP_STR_SIZE   256

Definition at line 40 of file unit.c.

Referenced by bUnit_ReplaceString(), and unit_scale_str().

#define UN_SC_CH   20.1168f

Definition at line 58 of file unit.c.

#define UN_SC_CM   0.01f

Definition at line 52 of file unit.c.

#define UN_SC_CWT   45.359237f

Definition at line 72 of file unit.c.

#define UN_SC_DAG   0.01f

Definition at line 68 of file unit.c.

#define UN_SC_DAM   10.0f

Definition at line 49 of file unit.c.

#define UN_SC_DM   0.1f

Definition at line 51 of file unit.c.

#define UN_SC_FT   0.3048f

Definition at line 60 of file unit.c.

#define UN_SC_FUR   201.168f

Definition at line 57 of file unit.c.

#define UN_SC_G   0.001f

Definition at line 69 of file unit.c.

#define UN_SC_HG   0.1f

Definition at line 67 of file unit.c.

#define UN_SC_HM   100.0f

Definition at line 48 of file unit.c.

#define UN_SC_IN   0.0254f

Definition at line 61 of file unit.c.

#define UN_SC_ITON   907.18474f

Definition at line 71 of file unit.c.

#define UN_SC_KG   1.0f

Definition at line 66 of file unit.c.

#define UN_SC_KM   1000.0f

Definition at line 47 of file unit.c.

#define UN_SC_LB   0.45359237f

Definition at line 74 of file unit.c.

#define UN_SC_M   1.0f

Definition at line 50 of file unit.c.

#define UN_SC_MI   1609.344f

Definition at line 56 of file unit.c.

#define UN_SC_MIL   0.0000254f

Definition at line 62 of file unit.c.

#define UN_SC_MM   0.001f

Definition at line 53 of file unit.c.

#define UN_SC_MTON   1000.0f

Definition at line 64 of file unit.c.

#define UN_SC_OZ   0.028349523125f

Definition at line 75 of file unit.c.

#define UN_SC_QL   100.0f

Definition at line 65 of file unit.c.

#define UN_SC_ST   6.35029318f

Definition at line 73 of file unit.c.

#define UN_SC_UM   0.000001f

Definition at line 54 of file unit.c.

#define UN_SC_YD   0.9144f

Definition at line 59 of file unit.c.

#define UNIT_SYSTEM_TOT   (((sizeof(bUnitSystems) / 9) / sizeof(void *)) - 1)

Definition at line 271 of file unit.c.

Referenced by bUnit_IsValid(), bUnit_ReplaceString(), and unit_get_system().


Typedef Documentation

typedef struct bUnitDef bUnitDef

Function Documentation

void bUnit_AsString ( char *  str,
int  len_max,
double  value,
int  prec,
int  system,
int  type,
int  split,
int  pad 
)
double bUnit_BaseScalar ( int  system,
int  type 
)

Definition at line 738 of file unit.c.

References bUnitDef::scalar, unit_default(), and unit_get_system().

Referenced by ui_numedit_apply_snapf().

double bUnit_ClosestScalar ( double  value,
int  system,
int  type 
)

Definition at line 723 of file unit.c.

References NULL, bUnitDef::scalar, unit_best_fit(), and unit_get_system().

Referenced by ui_get_but_step_unit().

int bUnit_GetBaseUnit ( void *  usys_pt)

Definition at line 764 of file unit.c.

Referenced by drawfloor().

const char* bUnit_GetName ( void *  usys_pt,
int  index 
)

Definition at line 769 of file unit.c.

const char* bUnit_GetNameDisplay ( void *  usys_pt,
int  index 
)

Definition at line 773 of file unit.c.

Referenced by drawfloor(), and drawgrid().

double bUnit_GetScaler ( void *  usys_pt,
int  index 
)

Definition at line 778 of file unit.c.

Referenced by drawfloor(), and drawgrid().

void bUnit_GetSystem ( void **  usys_pt,
int *  len,
int  system,
int  type 
)

Definition at line 751 of file unit.c.

References bUnitCollection::length, NULL, and unit_get_system().

Referenced by drawfloor(), and drawgrid().

int bUnit_IsValid ( int  system,
int  type 
)

Definition at line 745 of file unit.c.

References B_UNIT_TYPE_TOT, and UNIT_SYSTEM_TOT.

Referenced by ui_numedit_apply_snapf().

int bUnit_ReplaceString ( char *  str,
int  len_max,
char *  str_prev,
double  scale_pref,
int  system,
int  type 
)
void bUnit_ToUnitAltName ( char *  str,
int  len_max,
char *  orig_str,
int  system,
int  type 
)
static int ch_is_op ( char  op) [static]

Definition at line 463 of file unit.c.

Referenced by bUnit_ReplaceString().

static int unit_as_string ( char *  str,
int  len_max,
double  value,
int  prec,
bUnitCollection usys,
bUnitDef unit,
char  pad 
) [static]

Definition at line 325 of file unit.c.

References i, bUnitDef::name_short, NULL, bUnitDef::scalar, unit_best_fit(), and unit_default().

Referenced by bUnit_AsString().

static bUnitDef* unit_best_fit ( double  value,
bUnitCollection usys,
bUnitDef unit_start,
int  suppress 
) [static]
static bUnitDef* unit_default ( bUnitCollection usys) [static]
static void unit_dual_convert ( double  value,
bUnitCollection usys,
bUnitDef **  unit_a,
bUnitDef **  unit_b,
double *  value_a,
double *  value_b 
) [static]

Definition at line 313 of file unit.c.

References NULL, bUnitDef::scalar, and unit_best_fit().

Referenced by bUnit_AsString().

static int unit_find ( char *  str,
bUnitDef unit 
) [static]
static char* unit_find_str ( char *  str,
const char *  substr 
) [static]

Definition at line 430 of file unit.c.

References NULL.

Referenced by bUnit_ToUnitAltName(), unit_find(), and unit_scale_str().

static bUnitCollection* unit_get_system ( int  system,
int  type 
) [static]
static int unit_replace ( char *  str,
int  len_max,
char *  str_tmp,
double  scale_pref,
bUnitDef unit 
) [static]
static int unit_scale_str ( char *  str,
int  len_max,
char *  str_tmp,
double  scale_pref,
bUnitDef unit,
const char *  replace_str 
) [static]

Definition at line 485 of file unit.c.

References bUnitDef::scalar, SEP_STR, TEMP_STR_SIZE, and unit_find_str().

Referenced by unit_replace().


Variable Documentation

struct bUnitCollection buDummyCollecton = {buDummyDef, 0, 0, sizeof(buDummyDef)} [static]

Definition at line 108 of file unit.c.

Referenced by bUnit_AsString().

struct bUnitDef buDummyDef[] [static]
Initial value:
 {
        {"",    NULL, "",       NULL, NULL, 1.0, 0.0},
        {NULL,  NULL, NULL,     NULL, NULL, 0.0, 0.0}
}

Definition at line 104 of file unit.c.

Definition at line 247 of file unit.c.

struct bUnitDef buImperialAclDef[] [static]
Initial value:
 {
        {"foot per second squared", "feet per second squared", "ft/s²", "ft/s2", "Feet per second squared", UN_SC_FT, 0.0, B_UNIT_DEF_NONE}, 
        {NULL, NULL, NULL, NULL, NULL, 0.0, 0.0}
}

Definition at line 243 of file unit.c.

Definition at line 168 of file unit.c.

struct bUnitDef buImperialAreaDef[] [static]
Initial value:
 {
        {"square mile", "square miles",                 "sq mi", "sq m","Square Miles", UN_SC_MI*UN_SC_MI, 0.0,         B_UNIT_DEF_NONE},
        {"square furlong", "square furlongs",   "sq fur",NULL,  "Square Furlongs", UN_SC_FUR*UN_SC_FUR, 0.0,B_UNIT_DEF_SUPPRESS},
        {"square chain", "square chains",               "sq ch", NULL,  "Square Chains", UN_SC_CH*UN_SC_CH, 0.0,        B_UNIT_DEF_SUPPRESS},
        {"square yard", "square yards",                 "sq yd", NULL,  "Square Yards", UN_SC_YD*UN_SC_YD, 0.0,         B_UNIT_DEF_NONE},
        {"square foot", "square feet",                  "sq ft", NULL,  "Square Feet", UN_SC_FT*UN_SC_FT, 0.0,          B_UNIT_DEF_NONE}, 
        {"square inch", "square inches",                "sq in", NULL,  "Square Inches", UN_SC_IN*UN_SC_IN, 0.0,        B_UNIT_DEF_NONE},
        {"square thou", "square thous",                 "sq mil",NULL,  "Square Thous", UN_SC_MIL*UN_SC_MIL, 0.0,       B_UNIT_DEF_NONE},
        {NULL, NULL, NULL, NULL, NULL, 0.0, 0.0}
}

Definition at line 158 of file unit.c.

Definition at line 142 of file unit.c.

struct bUnitDef buImperialLenDef[] [static]
Initial value:
 {
        {"mile", "miles",               "mi", "m", "Miles",             UN_SC_MI, 0.0,  B_UNIT_DEF_NONE},
        {"furlong", "furlongs", "fur", NULL, "Furlongs",UN_SC_FUR, 0.0, B_UNIT_DEF_SUPPRESS},
        {"chain", "chains",             "ch", NULL, "Chains",   UN_SC_CH, 0.0,  B_UNIT_DEF_SUPPRESS},
        {"yard", "yards",               "yd", NULL, "Yards",    UN_SC_YD, 0.0,  B_UNIT_DEF_NONE},
        {"foot", "feet",                "'", "ft", "Feet",              UN_SC_FT, 0.0,  B_UNIT_DEF_NONE}, 
        {"inch", "inches",              "\"", "in", "Inches",   UN_SC_IN, 0.0,  B_UNIT_DEF_NONE},
        {"thou", "thou",                "thou", "mil", "Thou",  UN_SC_MIL, 0.0, B_UNIT_DEF_NONE}, 
        {NULL, NULL, NULL, NULL, NULL, 0.0, 0.0}
}

Definition at line 132 of file unit.c.

Definition at line 216 of file unit.c.

struct bUnitDef buImperialMassDef[] [static]
Initial value:
 {
        {"ton", "tonnes",       "ton", "t",     "Tonnes", UN_SC_ITON, 0.0,              B_UNIT_DEF_NONE},
        {"centum weight", "centum weights", "cwt", NULL, "Centum weights", UN_SC_CWT, 0.0, B_UNIT_DEF_NONE},
        {"stone", "stones",     "st", NULL,             "Stones", UN_SC_ST, 0.0,        B_UNIT_DEF_NONE},
        {"pound", "pounds",     "lb", NULL,             "Pounds", UN_SC_LB, 0.0,        B_UNIT_DEF_NONE}, 
        {"ounce", "ounces",     "oz", NULL,             "Ounces", UN_SC_OZ, 0.0,        B_UNIT_DEF_NONE},
        {NULL, NULL, NULL, NULL, NULL, 0.0, 0.0}
}

Definition at line 208 of file unit.c.

Definition at line 234 of file unit.c.

struct bUnitDef buImperialVelDef[] [static]
Initial value:
 {
        {"foot per second", "feet per second",  "ft/s", "fps",  "Feet per second", UN_SC_FT, 0.0,               B_UNIT_DEF_NONE}, 
        {"mile per hour", "miles per hour",             "mph", NULL,    "Miles per hour", UN_SC_MI/3600.0f, 0.0,B_UNIT_DEF_SUPPRESS},
        {NULL, NULL, NULL, NULL, NULL, 0.0, 0.0}
}

Definition at line 229 of file unit.c.

Definition at line 194 of file unit.c.

struct bUnitDef buImperialVolDef[] [static]
Initial value:
 {
        {"cubic mile", "cubic miles",           "cu mi", "cu m","Cubic Miles", UN_SC_MI*UN_SC_MI*UN_SC_MI, 0.0,         B_UNIT_DEF_NONE},
        {"cubic furlong", "cubic furlongs",     "cu fur",NULL,  "Cubic Furlongs", UN_SC_FUR*UN_SC_FUR*UN_SC_FUR, 0.0,B_UNIT_DEF_SUPPRESS},
        {"cubic chain", "cubic chains",         "cu ch", NULL,  "Cubic Chains", UN_SC_CH*UN_SC_CH*UN_SC_CH, 0.0,        B_UNIT_DEF_SUPPRESS},
        {"cubic yard", "cubic yards",           "cu yd", NULL,  "Cubic Yards", UN_SC_YD*UN_SC_YD*UN_SC_YD, 0.0,         B_UNIT_DEF_NONE},
        {"cubic foot", "cubic feet",            "cu ft", NULL,  "Cubic Feet", UN_SC_FT*UN_SC_FT*UN_SC_FT, 0.0,          B_UNIT_DEF_NONE}, 
        {"cubic inch", "cubic inches",          "cu in", NULL,  "Cubic Inches", UN_SC_IN*UN_SC_IN*UN_SC_IN, 0.0,        B_UNIT_DEF_NONE},
        {"cubic thou", "cubic thous",           "cu mil",NULL,  "Cubic Thous", UN_SC_MIL*UN_SC_MIL*UN_SC_MIL, 0.0,      B_UNIT_DEF_NONE},
        {NULL, NULL, NULL, NULL, NULL, 0.0, 0.0}
}

Definition at line 184 of file unit.c.

struct bUnitCollection buMetricAclCollecton = {buMetricAclDef, 0, 0, sizeof(buMetricAclDef)/sizeof(bUnitDef)} [static]

Definition at line 241 of file unit.c.

struct bUnitDef buMetricAclDef[] [static]
Initial value:
 {
        {"meter per second squared", "meters per second squared", "m/s²", "m/s2", "Meters per second squared", UN_SC_M, 0.0, B_UNIT_DEF_NONE}, 
        {NULL, NULL, NULL,      NULL, NULL, 0.0, 0.0}
}

Definition at line 237 of file unit.c.

Definition at line 156 of file unit.c.

struct bUnitDef buMetricAreaDef[] [static]
Initial value:
 {
        {"square kilometer", "square kilometers",       "km²", "km2",  "Square Kilometers", UN_SC_KM*UN_SC_KM, 0.0,    B_UNIT_DEF_NONE},
        {"square hectometer","square hectometers",      "hm²", "hm2",  "Square Hectometers", UN_SC_HM*UN_SC_HM, 0.0,   B_UNIT_DEF_NONE}, 
        {"square dekameter", "square dekameters",       "dam²","dam2", "Square Dekameters", UN_SC_DAM*UN_SC_DAM, 0.0,  B_UNIT_DEF_SUPPRESS}, 
        {"square meter", "square meters",                       "m²",  "m2",   "Square Meters", UN_SC_M*UN_SC_M, 0.0,                  B_UNIT_DEF_NONE}, 
        {"square decimetre", "square decimetres",       "dm²", "dm2",  "Square Decimetres", UN_SC_DM*UN_SC_DM, 0.0,    B_UNIT_DEF_SUPPRESS},
        {"square centimeter", "square centimeters",     "cm²", "cm2",  "Square Centimeters", UN_SC_CM*UN_SC_CM, 0.0,   B_UNIT_DEF_NONE},
        {"square millimeter", "square millimeters",     "mm²", "mm2",  "Square Millimeters", UN_SC_MM*UN_SC_MM, 0.0,   B_UNIT_DEF_NONE},
        {"square micrometer", "square micrometers",     "µm²", "um2", "Square Micrometers", UN_SC_UM*UN_SC_UM, 0.0,   B_UNIT_DEF_NONE},
        {NULL, NULL, NULL,      NULL, NULL, 0.0, 0.0}
}

Definition at line 145 of file unit.c.

struct bUnitCollection buMetricLenCollecton = {buMetricLenDef, 3, 0, sizeof(buMetricLenDef)/sizeof(bUnitDef)} [static]

Definition at line 130 of file unit.c.

struct bUnitDef buMetricLenDef[] [static]
Initial value:
 {
        {"kilometer", "kilometers",             "km", NULL,     "Kilometers", UN_SC_KM, 0.0,    B_UNIT_DEF_NONE},
        {"hectometer", "hectometers",   "hm", NULL,     "100 Meters", UN_SC_HM, 0.0,    B_UNIT_DEF_SUPPRESS},
        {"dekameter", "dekameters",             "dam",NULL,     "10 Meters",  UN_SC_DAM, 0.0,   B_UNIT_DEF_SUPPRESS},
        {"meter", "meters",                             "m",  NULL,     "Meters",     UN_SC_M, 0.0,     B_UNIT_DEF_NONE}, 
        {"decimetre", "decimetres",             "dm", NULL,     "10 Centimeters", UN_SC_DM, 0.0,        B_UNIT_DEF_SUPPRESS},
        {"centimeter", "centimeters",   "cm", NULL,     "Centimeters", UN_SC_CM, 0.0,   B_UNIT_DEF_NONE},
        {"millimeter", "millimeters",   "mm", NULL,     "Millimeters", UN_SC_MM, 0.0,   B_UNIT_DEF_NONE},
        {"micrometer", "micrometers",   "µm", "um",    "Micrometers", UN_SC_UM, 0.0,   B_UNIT_DEF_NONE}, 

        
        
        {NULL, NULL, NULL,      NULL, NULL, 0.0, 0.0}
}

Definition at line 112 of file unit.c.

Definition at line 206 of file unit.c.

struct bUnitDef buMetricMassDef[] [static]
Initial value:
 {
        {"ton", "tonnes",                       "ton", "t", "1000 Kilograms", UN_SC_MTON, 0.0,  B_UNIT_DEF_NONE},
        {"quintal", "quintals",         "ql", "q",      "100 Kilograms", UN_SC_QL, 0.0,         B_UNIT_DEF_NONE},
        {"kilogram", "kilograms",       "kg", NULL,     "Kilograms", UN_SC_KG, 0.0,                     B_UNIT_DEF_NONE}, 
        {"hectogram", "hectograms",     "hg", NULL,     "Hectograms", UN_SC_HG, 0.0,            B_UNIT_DEF_NONE},
        {"dekagram", "dekagrams",       "dag",NULL,     "10 Grams", UN_SC_DAG, 0.0,                     B_UNIT_DEF_SUPPRESS},
        {"gram", "grams",                       "g",  NULL,     "Grams", UN_SC_G, 0.0,                          B_UNIT_DEF_NONE},
        {NULL, NULL, NULL,      NULL, NULL, 0.0, 0.0}
}

Definition at line 197 of file unit.c.

struct bUnitCollection buMetricVelCollecton = {buMetricVelDef, 0, 0, sizeof(buMetricVelDef)/sizeof(bUnitDef)} [static]

Definition at line 227 of file unit.c.

struct bUnitDef buMetricVelDef[] [static]
Initial value:
 {
        {"meter per second", "meters per second",               "m/s",  NULL,   "Meters per second", UN_SC_M, 0.0,                        B_UNIT_DEF_NONE}, 
        {"kilometer per hour", "kilometers per hour",   "km/h", NULL,   "Kilometers per hour", UN_SC_KM/3600.0f, 0.0, B_UNIT_DEF_SUPPRESS},
        {NULL, NULL, NULL,      NULL, NULL, 0.0, 0.0}
}

Definition at line 222 of file unit.c.

struct bUnitCollection buMetricVolCollecton = {buMetricVolDef, 3, 0, sizeof(buMetricVolDef)/sizeof(bUnitDef)} [static]

Definition at line 182 of file unit.c.

struct bUnitDef buMetricVolDef[] [static]
Initial value:
 {
        {"cubic kilometer", "cubic kilometers",         "km³", "km3",  "Cubic Kilometers", UN_SC_KM*UN_SC_KM*UN_SC_KM, 0.0,    B_UNIT_DEF_NONE},
        {"cubic hectometer","cubic hectometers",        "hm³", "hm3",  "Cubic Hectometers", UN_SC_HM*UN_SC_HM*UN_SC_HM, 0.0,   B_UNIT_DEF_NONE},
        {"cubic dekameter", "cubic dekameters",         "dam³","dam3", "Cubic Dekameters", UN_SC_DAM*UN_SC_DAM*UN_SC_DAM, 0.0, B_UNIT_DEF_SUPPRESS},
        {"cubic meter", "cubic meters",                         "m³",  "m3",   "Cubic Meters", UN_SC_M*UN_SC_M*UN_SC_M, 0.0,                   B_UNIT_DEF_NONE}, 
        {"cubic decimetre", "cubic decimetres",         "dm³", "dm3",  "Cubic Decimetres", UN_SC_DM*UN_SC_DM*UN_SC_DM, 0.0,    B_UNIT_DEF_SUPPRESS},
        {"cubic centimeter", "cubic centimeters",       "cm³", "cm3",  "Cubic Centimeters", UN_SC_CM*UN_SC_CM*UN_SC_CM, 0.0,   B_UNIT_DEF_NONE},
        {"cubic millimeter", "cubic millimeters",       "mm³", "mm3",  "Cubic Millimeters", UN_SC_MM*UN_SC_MM*UN_SC_MM, 0.0,   B_UNIT_DEF_NONE},
        {"cubic micrometer", "cubic micrometers",       "µm³", "um3", "Cubic Micrometers", UN_SC_UM*UN_SC_UM*UN_SC_UM, 0.0,   B_UNIT_DEF_NONE},
        {NULL, NULL, NULL,      NULL, NULL, 0.0, 0.0}
}

Definition at line 171 of file unit.c.

Definition at line 269 of file unit.c.

struct bUnitDef buNaturalRotDef[] [static]
Initial value:
 {
        {"degree", "degrees",                   "°", NULL, "Degrees",          M_PI/180.0, 0.0,        B_UNIT_DEF_NONE},


        {NULL, NULL, NULL, NULL, NULL, 0.0, 0.0}
}

Definition at line 263 of file unit.c.

Definition at line 260 of file unit.c.

struct bUnitDef buNaturalTimeDef[] [static]
Initial value:
 {
        
        {"day", "days",                                 "d", NULL,      "Days",                 90000.0, 0.0,   B_UNIT_DEF_NONE},
        {"hour", "hours",                               "hr", "h",      "Hours",                3600.0, 0.0,    B_UNIT_DEF_NONE},
        {"minute", "minutes",                   "min", "m",     "Minutes",              60.0, 0.0,              B_UNIT_DEF_NONE},
        {"second", "seconds",                   "sec", "s",     "Seconds",              1.0, 0.0,               B_UNIT_DEF_NONE}, 
        {"millisecond", "milliseconds", "ms", NULL,     "Milliseconds", 0.001, 0.0      ,       B_UNIT_DEF_NONE},
        {"microsecond", "microseconds", "µs", "us",    "Microseconds", 0.000001, 0.0,  B_UNIT_DEF_NONE},
        {NULL, NULL, NULL, NULL, NULL, 0.0, 0.0}
}

Definition at line 250 of file unit.c.

struct bUnitCollection* bUnitSystems[][9] [static]