kopia lustrzana https://github.com/Hamlib/Hamlib
Move date_strget to misc.c
rodzic
86d2b4ee6c
commit
bcfd59f3af
16
src/debug.c
16
src/debug.c
|
@ -186,22 +186,6 @@ void HAMLIB_API rig_set_debug_time_stamp(int flag)
|
||||||
rig_debug_time_stamp = 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
|
//! @endcond
|
||||||
|
|
||||||
|
|
||||||
|
|
16
src/misc.c
16
src/misc.c
|
@ -2244,6 +2244,22 @@ uint32_t CRC32_function(uint8_t *buf, uint32_t len)
|
||||||
return crc ^ 0xFFFFFFFF;
|
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
|
//! @endcond
|
||||||
|
|
||||||
|
|
|
@ -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 HAMLIB_EXPORT(uint32_t) CRC32_function(uint8_t *buf, uint32_t len);
|
||||||
|
|
||||||
|
extern char *date_strget(char *buf, int buflen);
|
||||||
|
|
||||||
#ifdef PRId64
|
#ifdef PRId64
|
||||||
/** \brief printf(3) format to be used for long long (64bits) type */
|
/** \brief printf(3) format to be used for long long (64bits) type */
|
||||||
# define PRIll PRId64
|
# define PRIll PRId64
|
||||||
|
|
Ładowanie…
Reference in New Issue