#ifndef num_strH #define num_strH /*----------------------------------------------------------------------------*/ typedef enum { N_NrDigit = 0x07, N_Hex = 0x08, N_Dec = 0x10, // The number could be a decimal N_NaN = 0x00 } TNumFormat; /*----------------------------------------------------------------------------*/ /* Function */ /*----------------------------------------------------------------------------*/ short byte2str(char b, char* s=NULL) // Hex long word2str(short w, char* s=NULL) // Hex signed short str2byte(short s) // Hex signed long str2word(long s) // Hex signed short sstr2byte(char* s) // Hex signed long sstr2word(char* s) // Hex unsigned long str2num(char* s, char len=0) // Hex char num2str(long n, char* buf) // Hex TNumFormat str2numf(char *s, long* res, char len=0) /*----------------------------------------------------------------------------*/ #include "num_str.cpp" #endif