Move date_strget to misc.c

pull/712/head
Mike Black W9MDB 2021-05-21 12:33:42 -05:00
rodzic 86d2b4ee6c
commit bcfd59f3af
3 zmienionych plików z 18 dodań i 16 usunięć

Wyświetl plik

@ -186,22 +186,6 @@ void HAMLIB_API rig_set_debug_time_stamp(int flag)
rig_debug_time_stamp = flag;
}
//! @cond Doxygen_Suppress
char *date_strget(char *buf, int buflen)
{
char tmp[16];
struct tm *mytm;
time_t t;
struct timeval tv;
t = time(NULL);
mytm = gmtime(&t);
strftime(buf, buflen, "%Y-%m-%d:%H:%M:%S.", mytm);
gettimeofday(&tv, NULL);
sprintf(tmp, "%06ld", (long)tv.tv_usec);
strcat(buf, tmp);
return buf;
}
//! @endcond

Wyświetl plik

@ -2244,6 +2244,22 @@ uint32_t CRC32_function(uint8_t *buf, uint32_t len)
return crc ^ 0xFFFFFFFF;
}
//! @cond Doxygen_Suppress
char *date_strget(char *buf, int buflen)
{
char tmp[16];
struct tm *mytm;
time_t t;
struct timeval tv;
t = time(NULL);
mytm = gmtime(&t);
strftime(buf, buflen, "%Y-%m-%d:%H:%M:%S.", mytm);
gettimeofday(&tv, NULL);
sprintf(tmp, "%06ld", (long)tv.tv_usec);
strcat(buf, tmp);
return buf;
}
//! @endcond

Wyświetl plik

@ -112,6 +112,8 @@ extern HAMLIB_EXPORT(int) parse_hoststr(char *host, char hoststr[256], char port
extern HAMLIB_EXPORT(uint32_t) CRC32_function(uint8_t *buf, uint32_t len);
extern char *date_strget(char *buf, int buflen);
#ifdef PRId64
/** \brief printf(3) format to be used for long long (64bits) type */
# define PRIll PRId64