#ifndef __util_h #define __util_h /* prints long val in decimal format with leading zeros, depending on configval 'm', to string trg. m must be normally a value properly divideable by 10. If sign is greater 0, first char will be set to the +, or - sign. This makes string one char greater. Some examples for the minimum settings: m = 1 avoids that val is a number between 0-9, and prints only one char. m = 10 avoids that val is a number between 0-99 and prints nr in format XX. m = 100 0 - 999 999 = 999 99 = 099 9 = 009 A 0 byte will be append after the last printed char, in every case. Attention: Be sure m reflects a value which is really greater then val, otherwise the result is not properly. */ extern void printLongDc( long val, long m, short sign, char *trg); /* This is the same as printLongDc, but only avoiding a short 16 bit integer, instead a 32 bit long. */ extern void printShortDc( short val, short m, short sign, char *trg); /* Avoids a double which contains a number of arcseconds. Converts it to a string of the form +/-000:00:00 ( hours:minutes:seconds ). If flag hours is set to 1, it will not be convertet to a string representating degrees, instead +/-hours:minutes:seconds */ extern void printArcStr( double arc, int hours, char *trg ); #define printArcAz(x,t) printArcStr((x),0,(t)) #define printArcAlt(x,t) printArcStr((x),0,(t)) #define printArcRa(x,t) printArcStr((x),1,(t)) #define printArcDec(x,t) printArcStr((x),0,(t)) #define printAz(x,t) printArcStr((x)*3600,0,(t)) #define printAlt(x,t) printArcStr((x)*3600,0,(t)) #define printRa(x,t) printArcStr((x)*3600,1,(t)) #define printDec(x,t) printArcStr((x)*3600,0,(t)) #endif