mbgtools-lx  4.2.8
ctrydttm.c File Reference
#include <ctrydttm.h>
#include <ctry.h>
#include <str_util.h>
#include <stdio.h>

Go to the source code of this file.

Macros

#define _CTRYDTTM
 
#define DAYS_PER_WEEK   7
 

Functions

int snprint_02u (char *s, size_t max_len, unsigned int uc)
 
int snprint_04u (char *s, size_t max_len, unsigned int us)
 
int snprint_ctry_wday (char *s, size_t max_len, int wday, LANGUAGE language)
 
int snprint_ctry_dt_short (char *s, size_t max_len, int mday, int month)
 
int snprint_ctry_dt (char *s, size_t max_len, int mday, int month, int year)
 
int snprint_ctry_tm_short (char *s, size_t max_len, uchar hour, uchar minute)
 
int snprint_ctry_tm (char *s, size_t max_len, uchar hour, uchar minute, uchar second)
 
int snprint_ctry_tm_long (char *s, size_t max_len, uchar hour, uchar minute, uchar second, long frac, ushort frac_digits)
 

Variables

static const char * lstrs_wday [N_LNG][7]
 
CTRY ctry
 
LANGUAGE language
 

Macro Definition Documentation

◆ _CTRYDTTM

#define _CTRYDTTM

Definition at line 39 of file ctrydttm.c.

◆ DAYS_PER_WEEK

#define DAYS_PER_WEEK   7

Definition at line 50 of file ctrydttm.c.

Referenced by snprint_ctry_wday().

Function Documentation

◆ snprint_02u()

int snprint_02u ( char *  s,
size_t  max_len,
unsigned int  uc 
)

Definition at line 68 of file ctrydttm.c.

References snprintf_safe().

Referenced by snprint_ctry_dt_short(), snprint_ctry_tm(), and snprint_ctry_tm_short().

◆ snprint_04u()

int snprint_04u ( char *  s,
size_t  max_len,
unsigned int  us 
)

Definition at line 77 of file ctrydttm.c.

References snprintf_safe().

Referenced by snprint_ctry_dt().

◆ snprint_ctry_dt()

int snprint_ctry_dt ( char *  s,
size_t  max_len,
int  mday,
int  month,
int  year 
)

◆ snprint_ctry_dt_short()

int snprint_ctry_dt_short ( char *  s,
size_t  max_len,
int  mday,
int  month 
)

◆ snprint_ctry_tm()

int snprint_ctry_tm ( char *  s,
size_t  max_len,
uchar  hour,
uchar  minute,
uchar  second 
)

◆ snprint_ctry_tm_long()

int snprint_ctry_tm_long ( char *  s,
size_t  max_len,
uchar  hour,
uchar  minute,
uchar  second,
long  frac,
ushort  frac_digits 
)

Definition at line 182 of file ctrydttm.c.

References _int_from_size_t, sn_cpy_char_safe(), snprint_ctry_tm(), and snprintf_safe().

◆ snprint_ctry_tm_short()

int snprint_ctry_tm_short ( char *  s,
size_t  max_len,
uchar  hour,
uchar  minute 
)

Definition at line 156 of file ctrydttm.c.

References _int_from_size_t, sn_cpy_char_safe(), snprint_02u(), and CTRY::tm_sep.

Referenced by snprint_ctry_tm().

◆ snprint_ctry_wday()

int snprint_ctry_wday ( char *  s,
size_t  max_len,
int  wday,
LANGUAGE  language 
)

Definition at line 86 of file ctrydttm.c.

References DAYS_PER_WEEK, LNG_ENGLISH, lstrs_wday, N_LNG, and snprintf_safe().

Referenced by pcps_str_tm_gps_date_time().

Variable Documentation

◆ ctry

CTRY ctry

Definition at line 126 of file mbgstatus.c.

◆ language

LANGUAGE language

Definition at line 125 of file mbgstatus.c.

Referenced by main().

◆ lstrs_wday

const char* lstrs_wday[N_LNG][7]
static
Initial value:
=
{
{ "Su", "Mo", "Tu", "We", "Th", "Fr", "Sa" },
{ "So", "Mo", "Di", "Mi", "Do", "Fr", "Sa" }
}

Definition at line 56 of file ctrydttm.c.

Referenced by snprint_ctry_wday().