00001 00009 #ifndef _UNIT_H 00010 #define _UNIT_H 00011 00012 #include "complex.h" 00013 00014 typedef struct s_unit { 00015 char name[64]; 00016 double c,e,h,k,m,s,a,b; 00017 int prec; 00018 struct s_unit *next; 00019 } UNIT; 00021 #ifdef __cplusplus 00022 extern "C" { 00023 #endif 00024 int unit_convert(char *from, char *to, double *pValue); 00025 int unit_convert_ex(UNIT *from, UNIT *to, double *pValue); 00026 int unit_convert_complex(UNIT *from, UNIT *to, complex *pValue); 00027 UNIT *unit_find(char *); 00028 #ifdef __cplusplus 00029 } 00030 #endif 00031 00032 int unit_test(void); 00033 00034 #endif 00035