mbgtools-lx  4.2.8
mbgsetsystime.c File Reference
#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
 

Macro Definition Documentation

◆ MBG_FIRST_COPYRIGHT_YEAR

#define MBG_FIRST_COPYRIGHT_YEAR   2001

Definition at line 72 of file mbgsetsystime.c.

Referenced by main().

◆ MBG_LAST_COPYRIGHT_YEAR

#define MBG_LAST_COPYRIGHT_YEAR   0

Definition at line 73 of file mbgsetsystime.c.

Referenced by main().

Function Documentation

◆ do_mbgsetsystime()

static int do_mbgsetsystime ( MBG_DEV_HANDLE  dh,
const PCPS_DEV p_dev 
)
static

◆ do_set_system_time_from_pcps_hr_time()

◆ do_set_system_time_from_pcps_time()

static int do_set_system_time_from_pcps_time ( MBG_DEV_HANDLE  dh)
static

◆ main()

◆ set_system_time()

static int set_system_time ( const struct timespec *  p_ts)
static

◆ set_system_time_from_pcps_time()

◆ sn_printf_timespec()

static int sn_printf_timespec ( char *  s,
size_t  max_len,
const struct timespec *  p_ts 
)
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().

◆ usage()

static void usage ( void  )
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().

Variable Documentation

◆ do_mbgsetsystime

MBG_DEV_HANDLER_FNC do_mbgsetsystime
static

Definition at line 316 of file mbgsetsystime.c.

Referenced by main().

◆ pname

const char* pname = "mbgsetsystime"
static

Definition at line 75 of file mbgsetsystime.c.

Referenced by main(), and usage().