#include <stdio.h>
#include <math.h>
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#include <memory.h>
#define QUNIT_CATALOGUE_ENTRIES 28 |
#define QUNIT_FALSE 0 |
#define QUNIT_TRUE 1 |
Some useful constants
typedef struct QunitSIConversion qunit_si_conversion |
Structure to describe a parsed SI_conversion attribute
typedef struct QunitUnitDescription qunit_unit_description_t |
Unit description structure for catalogue of recognized units
typedef struct QunitUnitEntry qunit_unit_entry_t |
Symbol table element to hold unit expressions and constants
enum QunitVerbosity |
double Qar_pow | ( | double | x, | |
double | y | |||
) |
char* qunit_findNext | ( | ) |
struct QunitSIConversion* QunitAccumulateSIConversion | ( | struct QunitSIConversion * | ) | [read] |
Accumulate base unit counts in SIConversion from list of unit entries, and remove any unit entries with exponent zero from list.
struct QunitUnitEntry* QunitAccumulateUnitEntry | ( | struct QunitUnitEntry * | , | |
struct QunitUnitEntry * | ||||
) | [read] |
qunit structure accumulating routines
If new_entry is an SI_unit, look for an existing entry for this unit and accumulate the exponent if found, then free the new_entry. If new_entry is an SI_unit with no existing entry, or if it is a text entry, append it to the existing list (and don't free it!)
void QunitAddUnit | ( | struct QunitSIConversion * | SI_c, | |
char * | unit, | |||
float | power | |||
) |
struct QunitSIConversion* QunitCreateSIConvDescrip | ( | ) | [read] |
qunit structure creation, destruction and output routines
struct QunitUnitEntry* QunitCreateUnitEntry | ( | ) | [read] |
void QunitDestroySIConvDescrip | ( | struct QunitSIConversion * | ) |
void QunitDestroyUnitEntry | ( | struct QunitUnitEntry * | ) |
void QunitInitialiseCatalogue | ( | ) |
qunit catalogue routines
Inits catalogue of recognized SI units and their properties
struct QunitUnitDescription* QunitLookupCatalogueDescription | ( | const char * | ) | [read] |
Lookup a unit in the catalogue by symbol or name and
return a pointer to its description, or NULL if not found.
First try for an exact case-sensitive match of unit symbol
If symbol was not matched, try for case-insensitive name match. Names are stored lowercase as per SI standard, so can do this by testing for an exact match of a lowercase copy of test_string.
void QunitPrintCatalogueDescription | ( | const struct QunitUnitDescription * | ) |
Print qunit catalogue description of an SI unit
int QunitSIConvParse | ( | struct QunitSIConversion * | ) |
parsing routine
void QunitStrCatPowerTidy | ( | char * | str_buf, | |
struct QunitSIConversion * | SIc, | |||
double | p | |||
) |
void QunitStrCatSIConversionBase | ( | char * | , | |
struct QunitSIConversion * | ||||
) |
void QunitStrCatSIConversionTidy | ( | char * | , | |
struct QunitSIConversion * | ||||
) |
void QunitStrCatUnitEntry | ( | char * | , | |
struct QunitUnitEntry * | ||||
) |