56 lines
801 B
C
56 lines
801 B
C
#include "time_header.h"
|
|
|
|
const char* tzgetname(const timezone_t sp, int isdst)
|
|
{
|
|
int i;
|
|
|
|
for (i = 0; i < sp->timecnt; ++i) {
|
|
const struct ttinfo *const ttisp = &sp->ttis[sp->types[i]];
|
|
|
|
if (ttisp->tt_isdst == isdst)
|
|
return &sp->chars[ttisp->tt_abbrind];
|
|
}
|
|
|
|
return NULL;
|
|
}
|
|
|
|
|
|
const char* tzgetlocation(void)
|
|
{
|
|
static char nowhere[2] = "";
|
|
|
|
if (lcl_is_set > 0) {
|
|
return lcl_TZname;
|
|
} else {
|
|
return nowhere;
|
|
}
|
|
}
|
|
|
|
/**
|
|
* @brief
|
|
* Space to underscore
|
|
*/
|
|
void stou(char *s)
|
|
{
|
|
while (*s) {
|
|
if (*s == ' ') {
|
|
*s = '_';
|
|
}
|
|
s++;
|
|
}
|
|
}
|
|
|
|
/**
|
|
* @brief
|
|
* Underscore to space
|
|
*/
|
|
void utos(char *s)
|
|
{
|
|
while (*s) {
|
|
if (*s == '_') {
|
|
*s = ' ';
|
|
}
|
|
s++;
|
|
}
|
|
}
|