units.c File Reference

#include "common.h"
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
#include <strings.h>
#include "machine.h"
#include "bu.h"

Include dependency graph for units.c:

Go to the source code of this file.

Data Structures

struct  cvt_tab

Defines

#define BU_UNITS_TABLE_SIZE   (sizeof(bu_units_tab) / sizeof(struct cvt_tab) - 1)

Functions

double bu_units_conversion (const char *str)
const char * bu_units_string (register const double mm)
double bu_mm_value (const char *s)
void bu_mm_cvt (register const struct bu_structparse *sdp, register const char *name, char *base, const char *value)


Detailed Description

Module of libbu to handle units conversion between strings and mm.

Author:
Michael John Muuss
Source -
SECAD/VLD Computing Consortium, Bldg 394
The U. S. Army Ballistic Research Laboratory
Aberdeen Proving Ground, Maryland 21005-5066

Definition in file units.c.


Define Documentation

#define BU_UNITS_TABLE_SIZE   (sizeof(bu_units_tab) / sizeof(struct cvt_tab) - 1)
 

Definition at line 100 of file units.c.


Function Documentation

const char* bu_units_string register const double  mm  ) 
 

B U _ U N I T S _ S T R I N G

Given a conversion factor to mm, search the table to find what unit this represents. To accomodate floating point fuzz, a "near miss" is allowed. The algorithm depends on the table being sorted small-to-large.

Returns - char* units string NULL No known unit matches this conversion factor.

Definition at line 161 of file units.c.

References NULL.


Generated on Mon Sep 18 01:25:04 2006 for BRL-CAD by  doxygen 1.4.6