mbgtools-lx
4.2.8
|
#include <mbgdevio.h>
#include <pcpsmktm.h>
#include <pcpsutil.h>
#include <toolutil.h>
#include <timeutil.h>
#include <str_util.h>
#include <mbgerror.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
Go to the source code of this file.
Macros | |
#define | MBG_FIRST_COPYRIGHT_YEAR 2001 |
#define | MBG_LAST_COPYRIGHT_YEAR 0 |
Functions | |
static int | sn_printf_timespec (char *s, size_t max_len, const struct timespec *p_ts) |
static int | set_system_time (const struct timespec *p_ts) |
static int | set_system_time_from_pcps_time (const PCPS_TIME *p_t) |
static int | do_set_system_time_from_pcps_time (MBG_DEV_HANDLE dh) |
static int | do_set_system_time_from_pcps_hr_time (MBG_DEV_HANDLE dh) |
static int | do_mbgsetsystime (MBG_DEV_HANDLE dh, const PCPS_DEV *p_dev) |
static void | usage (void) |
int | main (int argc, char *argv[]) |
Variables | |
static const char * | pname = "mbgsetsystime" |
static MBG_DEV_HANDLER_FNC | do_mbgsetsystime |
#define MBG_FIRST_COPYRIGHT_YEAR 2001 |
Definition at line 72 of file mbgsetsystime.c.
Referenced by main().
#define MBG_LAST_COPYRIGHT_YEAR 0 |
Definition at line 73 of file mbgsetsystime.c.
Referenced by main().
|
static |
Definition at line 290 of file mbgsetsystime.c.
References do_set_system_time_from_pcps_hr_time(), do_set_system_time_from_pcps_time(), mbg_chk_dev_has_hr_time, mbg_rc_is_success, and MBG_SUCCESS.
|
static |
Definition at line 262 of file mbgsetsystime.c.
References bin_frac_32_to_dec_frac(), PCPS_TIME_STAMP::frac, mbg_cond_err_msg(), MBG_ERR_INV_TIME, mbg_get_hr_time(), NSEC_PER_SEC, PCPS_INVT, PCPS_TIME_STAMP::sec, set_system_time(), PCPS_HR_TIME::status, and PCPS_HR_TIME::tstamp.
Referenced by do_mbgsetsystime().
|
static |
Definition at line 236 of file mbgsetsystime.c.
References mbg_cond_err_msg(), MBG_ERR_INV_TIME, mbg_get_time(), PCPS_INVT, set_system_time_from_pcps_time(), and PCPS_TIME::status.
Referenced by do_mbgsetsystime().
int main | ( | int | argc, |
char * | argv[] | ||
) |
Definition at line 336 of file mbgsetsystime.c.
References do_mbgsetsystime, MBG_ERR_INV_TIME, MBG_EXIT_CODE_FAIL, MBG_EXIT_CODE_INV_TIME, MBG_EXIT_CODE_SUCCESS, MBG_EXIT_CODE_USAGE, MBG_FIRST_COPYRIGHT_YEAR, mbg_handle_devices(), MBG_LAST_COPYRIGHT_YEAR, mbg_print_program_info(), mbg_rc_is_success, must_print_usage, pname, and usage().
|
static |
Definition at line 98 of file mbgsetsystime.c.
References mbg_get_last_error(), mbg_strerror(), MBG_SUCCESS, and sn_printf_timespec().
Referenced by do_set_system_time_from_pcps_hr_time(), and set_system_time_from_pcps_time().
|
static |
Definition at line 127 of file mbgsetsystime.c.
References FILETIME, PCPS_TIME::hour, MBG_ERR_OVERFLOW, MBG_ERR_RANGE, mbg_gmtime(), mbg_rc_is_error, mbg_strerror(), MBG_SUCCESS, mbg_win32_sys_err_to_mbg(), PCPS_TIME::mday, PCPS_TIME::min, PCPS_TIME::month, NSEC_PER_SEC, PCPS_TIME::offs_utc, pcps_mktime(), PCPS_TIME::sec, PCPS_TIME::sec100, SECS_PER_HOUR, set_system_time(), and PCPS_TIME::year.
Referenced by do_set_system_time_from_pcps_time().
|
static |
Definition at line 80 of file mbgsetsystime.c.
References mbg_gmtime(), mbg_rc_is_error, sn_cpy_str_safe(), and snprintf_safe().
Referenced by set_system_time().
|
static |
Definition at line 321 of file mbgsetsystime.c.
References mbg_print_device_options(), mbg_print_help_options(), mbg_print_usage_intro(), and pname.
Referenced by main().
|
static |
Definition at line 316 of file mbgsetsystime.c.
Referenced by main().
|
static |
Definition at line 75 of file mbgsetsystime.c.