00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef _MISC_H
00024 #define _MISC_H 1
00025
00026 #include <hamlib/rig.h>
00027
00028
00029
00030
00031
00032
00033
00034
00035 #define Hold_Decode(rig) {(rig)->state.hold_decode = 1;}
00036 #define Unhold_Decode(rig) {(rig)->state.hold_decode = 0;}
00037
00038 __BEGIN_DECLS
00039
00040
00041
00042
00043
00044 void dump_hex(const unsigned char ptr[], size_t size);
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054 extern HAMLIB_EXPORT(unsigned char *) to_bcd(unsigned char bcd_data[], unsigned long long freq, unsigned bcd_len);
00055 extern HAMLIB_EXPORT(unsigned long long) from_bcd(const unsigned char bcd_data[], unsigned bcd_len);
00056
00057
00058
00059
00060 extern HAMLIB_EXPORT(unsigned char *) to_bcd_be(unsigned char bcd_data[], unsigned long long freq, unsigned bcd_len);
00061 extern HAMLIB_EXPORT(unsigned long long) from_bcd_be(const unsigned char bcd_data[], unsigned bcd_len);
00062
00063 extern HAMLIB_EXPORT(int) sprintf_freq(char *str, freq_t);
00064
00065
00066
00067 #define isreturn(c) ((c) == 10 || (c) == 13)
00068
00069
00070
00071 #ifdef HAVE_INTTYPES_H
00072 #include <inttypes.h>
00073 #endif
00074
00075 #ifdef PRId64
00076
00077 #define PRIll PRId64
00078 #else
00079 #ifdef FBSD4
00080 #define PRIll "qd"
00081 #else
00082 #define PRIll "lld"
00083 #endif
00084 #endif
00085
00086 #ifdef SCNd64
00087
00088 #define SCNll SCNd64
00089 #else
00090 #ifdef FBSD4
00091 #define SCNll "qd"
00092 #else
00093 #define SCNll "lld"
00094 #endif
00095 #endif
00096
00097
00098
00099 __END_DECLS
00100
00101 #endif