librnr  1.14.5
RoadNarrows Robotics Common Library 1
units.c File Reference

Units names, conversions, etc. More...

#include <sys/types.h>
#include <stdlib.h>
#include <string.h>
#include "rnr/rnrconfig.h"
#include "rnr/assoc.h"
#include "rnr/units.h"

Go to the source code of this file.

Functions

const char * units_shortname (units_t u)
 Get the units name. More...
 

Variables

static Nvp_T UnitNamesTbl []
 

Detailed Description

Units names, conversions, etc.

LastChangedDate
2013-03-18 11:39:24 -0600 (Mon, 18 Mar 2013)
Rev
2765
Todo:
Add conversion functions to library.
Author
Robin Knight (robin.nosp@m..kni.nosp@m.ght@r.nosp@m.oadn.nosp@m.arrow.nosp@m.s.co.nosp@m.m)

Definition in file units.c.

Function Documentation

const char* units_shortname ( units_t  u)

Get the units name.

Parameters
uName-Value Pair table
Returns
The associated units short name.

Definition at line 112 of file units.c.

References arraysize, and NvpVal2Name().

113 {
115 }
const char * NvpVal2Name(Nvp_T tbl[], size_t nTblEntries, int iVal)
Get the name associated with the value.
Definition: assoc.c:94
#define arraysize(array)
array size, i.e. number of array entries
Definition: rnrconfig.h:259
static Nvp_T UnitNamesTbl[]
Definition: units.c:64

Variable Documentation

Nvp_T UnitNamesTbl[]
static

Unit short names table. Singular form.

Definition at line 64 of file units.c.