mbgtools-lx
4.2.8
|
#include <pcpslstr.h>
#include <pcpsutil.h>
#include <mbgtime.h>
#include <timeutil.h>
#include <ctry.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
Go to the source code of this file.
Data Structures | |
struct | CLSTR_STATUS |
Macros | |
#define | _PCPSLSTR |
#define | _eos(_s) ( &(_s)[strlen( _s )] ) |
Functions | |
const char * | inv_str (void) |
Return a language dependend string for "invalid". More... | |
static const char * | get_tz_name (PCPS_TIME_STATUS_X pcps_status, long utc_offs, ulong flags, int is_msf) |
Return a static string with the name of the timezone, depending on the UTC offset. More... | |
const char * | pcps_tz_name (const PCPS_TIME *t, ulong flags, int is_msf) |
Return a static time zone string depending on the UTC offset from a PCPS_TIME structure. More... | |
const char * | pcps_tz_name_from_hr_time (const PCPS_HR_TIME *hrt, ushort flags, int is_msf) |
Return a static time zone string depending on the UTC offset from a PCPS_HR_TIME structure. More... | |
const char * | pcps_tz_name_hr_status (const PCPS_HR_TIME *t, ushort flags, int is_msf) |
Return a static time zone string depending on the UTC offset from a PCPS_HR_TIME structure. More... | |
const char * | pcps_tz_name_from_status (PCPS_TIME_STATUS_X status) |
Return a static time zone string depending on the UTC offset from a PCPS_HR_TIME structure. More... | |
char * | pcps_date_time_str (char *s, size_t max_len, const PCPS_TIME *t, int year_limit, const char *tz_str) |
int | pcps_str_tm_gps_date_time (char *s, size_t max_len, const TM_GPS *t) |
static void | pcps_setup_status_str (PCPS_STATUS_STR *pstr, int err_cond, CLSTR_STATUS *pss) |
void | pcps_status_strs (ushort status, int status_is_read, int is_gps, PCPS_STATUS_STRS *pstrs) |
char * | pcps_port_str (char *s, size_t max_len, const PCPS_DEV *pdev) |
const char * | pcps_tzcode_str (PCPS_TZCODE tzcode) |
char * | pcps_serial_str (char *s, size_t max_len, int i, const RECEIVER_PORT_CFG *p, const RECEIVER_INFO *p_ri, int short_strs) |
Variables | |
static const char | tz_name_utc [] = TZ_NAME_UTC |
static CLSTR | str_dst = { "DST", "Sommerzeit" } |
#define _eos | ( | _s | ) | ( &(_s)[strlen( _s )] ) |
Definition at line 105 of file pcpslstr.c.
#define _PCPSLSTR |
Definition at line 91 of file pcpslstr.c.
|
static |
Return a static string with the name of the timezone, depending on the UTC offset.
[in] | pcps_status | Status flags read from a clock device |
[in] | utc_offs | UTC offset in [s] |
[in] | flags | A combination of PCPS_TZ_NAME_FLAGS contolling the output string format |
[in] | is_msf | A Flag used to indicate if the clock is an MSF receiver |
Definition at line 158 of file pcpslstr.c.
References _lstr, lstr_bst, lstr_cest, lstr_cet, lstr_gmt, PCPS_DL_ENB, pcps_time_tz_dist, PCPS_TZ_NAME_APP_DST, PCPS_TZ_NAME_FORCE_UTC_OFFS, PCPS_UTC, SECS_PER_HOUR, sn_cpy_char_safe(), sn_cpy_str_safe(), snprint_utc_offs(), snprintf_safe(), str_dst, and tz_name_utc.
Referenced by pcps_tz_name(), and pcps_tz_name_from_hr_time().
const char* inv_str | ( | void | ) |
Return a language dependend string for "invalid".
Definition at line 131 of file pcpslstr.c.
Referenced by pcps_tzcode_str().
char* pcps_date_time_str | ( | char * | s, |
size_t | max_len, | ||
const PCPS_TIME * | t, | ||
int | year_limit, | ||
const char * | tz_str | ||
) |
Definition at line 344 of file pcpslstr.c.
References _pcps_snprint_date, _pcps_snprint_time_long, _pcps_snprint_wday, _pcps_time_is_read, language, pcps_date_time_dist, pcps_time_tz_dist, pcps_wday_date_dist, sn_cpy_char_safe(), sn_cpy_str_safe(), str_not_avail, and strncpy_safe().
Referenced by pcps_str_tm_gps_date_time(), and print_pcps_time().
char* pcps_port_str | ( | char * | s, |
size_t | max_len, | ||
const PCPS_DEV * | pdev | ||
) |
Definition at line 522 of file pcpslstr.c.
References _pcps_short_port_base, and snprintf_safe().
char* pcps_serial_str | ( | char * | s, |
size_t | max_len, | ||
int | i, | ||
const RECEIVER_PORT_CFG * | p, | ||
const RECEIVER_INFO * | p_ri, | ||
int | short_strs | ||
) |
Definition at line 552 of file pcpslstr.c.
References _lstr, COM_PARM::baud_rate, COM_PARM::framing, STR_TYPE_INFO::long_name, PORT_SETTINGS::mode, mode_name, RECEIVER_INFO::n_str_type, PORT_SETTINGS::parm, RECEIVER_PORT_CFG::pii, short_mode_name, snprintf_safe(), RECEIVER_PORT_CFG::stii, and PORT_SETTINGS::str_type.
|
static |
Definition at line 440 of file pcpslstr.c.
References _lstr, PCPS_STATUS_STR::cp, CLSTR_STATUS::err, PCPS_STATUS_STR::is_err, and CLSTR_STATUS::ok.
Referenced by pcps_status_strs().
void pcps_status_strs | ( | ushort | status, |
int | status_is_read, | ||
int | is_gps, | ||
PCPS_STATUS_STRS * | pstrs | ||
) |
Definition at line 454 of file pcpslstr.c.
References _lstr, PCPS_STATUS_STR::cp, DEFAULT_STR_ANN_DST, DEFAULT_STR_ANN_LS, DEFAULT_STR_DCF_FREE_RUNNING, DEFAULT_STR_DCF_HAS_NOT_SYNCD, DEFAULT_STR_DCF_HAS_SYNCD, DEFAULT_STR_DCF_NOT_FREE_RUNNING, DEFAULT_STR_GPS_NOT_SYNCD, DEFAULT_STR_GPS_POS_NOT_OK, DEFAULT_STR_GPS_POS_OK, DEFAULT_STR_GPS_SYNCD, DEFAULT_STR_SET_MANUALLY, DEFAULT_STR_TIME_INVAL, PCPS_STATUS_STR::is_err, PCPS_DL_ANN, PCPS_FREER, PCPS_IFTM, PCPS_INVT, PCPS_LS_ANN, pcps_setup_status_str(), PCPS_SYNCD, PCPS_STATUS_STRS::s, and str_not_avail.
Referenced by show_time_and_status().
int pcps_str_tm_gps_date_time | ( | char * | s, |
size_t | max_len, | ||
const TM_GPS * | t | ||
) |
Definition at line 387 of file pcpslstr.c.
References _int_from_size_t, TM_GPS::frac, TM_GPS::hour, language, TM_GPS::mday, TM_GPS::min, TM_GPS::month, pcps_date_time_str(), pcps_date_time_wstr(), pcps_wday_date_dist, TM_GPS::sec, sn_cpy_char_safe(), sn_cpy_str_safe(), snprint_ctry_wday(), snprintf_safe(), TM_GPS::wday, TM_GPS::year, and year_limit.
Referenced by show_time_and_status().
Return a static time zone string depending on the UTC offset from a PCPS_TIME structure.
[in] | t | A PCPS_TIME structure read from a clock device |
[in] | flags | A combination of PCPS_TZ_NAME_FLAGS contolling the output string format |
[in] | is_msf | A Flag used to indicate if the clock is an MSF receiver |
Definition at line 245 of file pcpslstr.c.
References get_tz_name(), PCPS_TIME::offs_utc, SECS_PER_HOUR, and PCPS_TIME::status.
Referenced by print_pcps_time().
const char* pcps_tz_name_from_hr_time | ( | const PCPS_HR_TIME * | hrt, |
ushort | flags, | ||
int | is_msf | ||
) |
Return a static time zone string depending on the UTC offset from a PCPS_HR_TIME structure.
[in] | hrt | A PCPS_HR_TIME structure read from a clock device |
[in] | flags | A combination of PCPS_TZ_NAME_FLAGS contolling the output string format |
[in] | is_msf | A Flag used to indicate if the clock is an MSF receiver |
Definition at line 269 of file pcpslstr.c.
References get_tz_name(), PCPS_HR_TIME::status, and PCPS_HR_TIME::utc_offs.
Referenced by pcps_tz_name_hr_status().
const char* pcps_tz_name_from_status | ( | PCPS_TIME_STATUS_X | status | ) |
Return a static time zone string depending on the UTC offset from a PCPS_HR_TIME structure.
This function can be used to build a name for the time zone if only the UTC/DST status is known, but the UTC offset is not. This is the case, for example, if the Meinberg standard time string is decoded.
[in] | status | Clock status in PCPS_TIME_STATUS_X format |
Definition at line 332 of file pcpslstr.c.
References _lstr, PCPS_DL_ENB, PCPS_UTC, str_dst, and tz_name_utc.
const char* pcps_tz_name_hr_status | ( | const PCPS_HR_TIME * | t, |
ushort | flags, | ||
int | is_msf | ||
) |
Return a static time zone string depending on the UTC offset from a PCPS_HR_TIME structure.
This function can be used to build a name for the time zone if the timescale, the UTC/DST status and the UTC offset are known, e.g. from plug-in clock devices.
[in] | t | A PCPS_HR_TIME structure read from a clock device |
[in] | flags | A combination of PCPS_TZ_NAME_FLAGS contolling the output string format |
[in] | is_msf | A Flag used to indicate if the clock is an MSF receiver |
Definition at line 296 of file pcpslstr.c.
References PCPS_SCALE_GPS, PCPS_SCALE_TAI, pcps_tz_name_from_hr_time(), PCPS_HR_TIME::status, and strncpy_safe().
const char* pcps_tzcode_str | ( | PCPS_TZCODE | tzcode | ) |
Definition at line 540 of file pcpslstr.c.
References inv_str(), language, N_LNG, N_PCPS_TZCODE, and tzcode_name.
|
static |
Definition at line 121 of file pcpslstr.c.
Referenced by get_tz_name(), and pcps_tz_name_from_status().
|
static |
Definition at line 120 of file pcpslstr.c.
Referenced by get_tz_name(), and pcps_tz_name_from_status().