mbgtools-lx
4.2.8
|
#include <mbg_tgt.h>
#include <timeutil.h>
#include <use_pack.h>
#include <pcpsdefs.h>
#include <mbggeo.h>
#include <pci_asic.h>
#include <stdlib.h>
Go to the source code of this file.
Macros | |
#define | MBGUTIL_VERSION 0x0308 |
#define | MBGUTIL_COMPAT_VERSION 0x0110 |
#define | _ext extern |
#define | _mbg_strncpy(_s, _src) mbg_strncpy( _s, sizeof( _s ), _src ) |
Functions | |
int | mbgutil_get_version (void) |
Get the version number of the precompiled DLL/shared object library. More... | |
int | mbgutil_check_version (int header_version) |
Check if the DLL/shared library is compatible with a given version. More... | |
int | mbg_snprintf (char *s, size_t max_len, const char *fmt,...) |
A portable, safe implementation of snprintf() More... | |
int | mbg_strncpy (char *s, size_t max_len, const char *src) |
A portable, safe implementation of strncpy() More... | |
int | mbg_strchar (char *s, size_t max_len, char c, size_t n) |
Write a character multiple times to a string buffer. More... | |
int | mbg_str_date_short (char *s, int max_len, int mday, int month) |
Write a short date string "dd.mm." to a string buffer. More... | |
int | mbg_str_date (char *s, int max_len, int mday, int month, int year) |
Write a date string "dd.mm.yyyy" to a string buffer. More... | |
int | mbg_str_time_short (char *s, int max_len, int hour, int min) |
Write a short time string "hh:mm" to a string buffer. More... | |
int | mbg_str_time (char *s, int max_len, int hour, int min, int sec) |
Write a time string "hh:mm:ss" to a string buffer. More... | |
int | mbg_str_time_long (char *s, int max_len, int hour, int min, int sec, int sec100) |
Write a long time string "hh:mm:ss.cc" to a string buffer. More... | |
int | mbg_str_tm_gps_date_time (char *s, int max_len, const TM_GPS *pt) |
Write a full date and time string to a string buffer. More... | |
int | mbg_str_pcps_date_short (char *s, int max_len, const PCPS_TIME *pt) |
Write the short date given as PCPS_TIME structure to a string buffer. More... | |
int | mbg_str_pcps_date (char *s, int max_len, const PCPS_TIME *pt) |
Write the date given as PCPS_TIME structure to a string buffer. More... | |
int | mbg_str_pcps_time_short (char *s, int max_len, const PCPS_TIME *pt) |
Write the short time given as PCPS_TIME structure to a string buffer. More... | |
int | mbg_str_pcps_time (char *s, int max_len, const PCPS_TIME *pt) |
Write the time given as PCPS_TIME structure to a string buffer. More... | |
int | mbg_str_pcps_time_long (char *s, int max_len, const PCPS_TIME *pt) |
Write the time including sec100ths given as PCPS_TIME structure to a string buffer. More... | |
int | mbg_str_pcps_date_time (char *s, int max_len, const PCPS_TIME *pt, const char *tz_str) |
Write date and time given as PCPS_TIME structure to a string buffer. More... | |
int | mbg_str_pcps_hr_date (char *s, int max_len, uint32_t sec) |
Write date derived from seconds-since-epoch to a string buffer. More... | |
int | mbg_str_pcps_hr_time (char *s, int max_len, uint32_t sec) |
Write time derived from seconds-since-epoch to a string buffer. More... | |
int | mbg_str_pcps_hr_date_time_utc (char *s, int max_len, const PCPS_HR_TIME *pt) |
Write UTC date and time given as PCPS_HR_TIME structure to a string buffer. More... | |
int | mbg_str_pcps_hr_date_time_loc (char *s, int max_len, const PCPS_HR_TIME *pt) |
Write local date and time given as PCPS_HR_TIME structure to a string buffer. More... | |
int | mbg_str_pcps_hr_time_frac (char *s, int max_len, uint32_t frac) |
Print binary PCPS_FRAC_32 fractions in decimal to a string buffer. More... | |
int | mbg_str_pcps_hr_time_offs (char *s, int max_len, const PCPS_HR_TIME *pt, const char *info) |
Print the UTC offset from a PCPS_HR_TIME structure to a string buffer. More... | |
int | mbg_str_pcps_hr_tstamp_utc (char *s, int max_len, const PCPS_HR_TIME *pt) |
Write a high resolution UTC time stamp including fractions to a string buffer. More... | |
int | mbg_str_pcps_hr_tstamp_loc (char *s, int max_len, const PCPS_HR_TIME *pt) |
Write a high resolution local time stamp including fractions to a string buffer. More... | |
int | mbg_str_pcps_tstamp_raw (char *s, int max_len, const PCPS_TIME_STAMP *pt) |
Write a raw high resolution time stamp to a string buffer. More... | |
int | mbg_str_pcps_hr_time_raw (char *s, int max_len, const PCPS_HR_TIME *pt) |
Write a raw high resolution time stamp plus converted local time to a string buffer. More... | |
int | mbg_str_ucap (char *s, int max_len, const PCPS_HR_TIME *pt) |
Write time capture / user capture time stamp to a string buffer. More... | |
int | mbg_str_pos_dms (char *s, int max_len, const DMS *pdms, int prec) |
Write a geographic coordinate in degrees - minutes - seconds to a string buffer. More... | |
int | mbg_str_pos_alt (char *s, int max_len, double alt) |
Write a position's altitude parameter to a string buffer. More... | |
int | mbg_str_pos (char *s, int max_len, const POS *ppos, int prec) |
Write geographic coordinates to a string buffer. More... | |
int | mbg_str_dev_name (char *s, int max_len, const char *short_name, uint16_t fw_rev_num, PCI_ASIC_VERSION asic_ver_num) |
Write device info to a string buffer. More... | |
#define _mbg_strncpy | ( | _s, | |
_src | |||
) | mbg_strncpy( _s, sizeof( _s ), _src ) |
#define MBGUTIL_COMPAT_VERSION 0x0110 |
Definition at line 80 of file mbgutil.h.
Referenced by mbgutil_check_version().
#define MBGUTIL_VERSION 0x0308 |
Definition at line 78 of file mbgutil.h.
Referenced by mbgutil_get_version().
int mbg_snprintf | ( | char * | s, |
size_t | max_len, | ||
const char * | fmt, | ||
... | |||
) |
A portable, safe implementation of snprintf()
The output string buffer is in any case properly terminated by 0. For a detailed description see vsnprintf_safe
[out] | s | Pointer to the output buffer |
[in] | max_len | Size of the output buffer |
[in] | fmt | Format string according to subsequent parameters |
[in] | ... | Variable argument list according to the format string |
A portable, safe implementation of snprintf()
The output string buffer is in any case properly terminated by 0. For a detailed description see vsnprintf_safe.
[out] | s | Pointer to the output buffer |
[in] | max_len | Size of the output buffer |
[in] | fmt | Format string according to subsequent parameters |
[in] | ... | Variable argument list according to the format string |
Definition at line 157 of file mbgutil.c.
References vsnprintf_safe().
Referenced by mbg_snprint_hr_time_loc(), show_ext_stat_info(), show_utc_info(), snprint_hours_mins(), and str_raw_irig_utc_offs_hours().
int mbg_str_date | ( | char * | s, |
int | max_len, | ||
int | mday, | ||
int | month, | ||
int | year | ||
) |
Write a date string "dd.mm.yyyy" to a string buffer.
The output string buffer is in any case properly terminated by 0.
[out] | s | Pointer to the output buffer |
[in] | max_len | Size of the output buffer |
[in] | mday | Day-of-month number, 1..31 |
[in] | month | Month number, 1..12 |
[in] | year | Year number |
Definition at line 268 of file mbgutil.c.
References mbg_str_date_short(), mbg_year_lim, pcps_exp_year(), and snprintf_safe().
Referenced by do_str_pcps_hr_date_time(), mbg_str_pcps_date(), mbg_str_pcps_hr_date(), and mbg_str_tm_gps_date_time().
int mbg_str_date_short | ( | char * | s, |
int | max_len, | ||
int | mday, | ||
int | month | ||
) |
Write a short date string "dd.mm." to a string buffer.
The output string buffer is in any case properly terminated by 0.
[out] | s | Pointer to the output buffer |
[in] | max_len | Size of the output buffer |
[in] | mday | Day-of-month number, 1..31 |
[in] | month | Month number, 1..12 |
Definition at line 243 of file mbgutil.c.
References snprintf_safe().
Referenced by mbg_str_date(), and mbg_str_pcps_date_short().
int mbg_str_dev_name | ( | char * | s, |
int | max_len, | ||
const char * | short_name, | ||
uint16_t | fw_rev_num, | ||
PCI_ASIC_VERSION | asic_ver_num | ||
) |
Write device info to a string buffer.
The output string buffer is in any case properly terminated by 0.
[out] | s | Pointer to the output buffer |
[in] | max_len | Size of the output buffer |
[in] | short_name | Short device name, e.g. in MBG_DEV_NAME format |
[in] | fw_rev_num | The firmware revision number |
[in] | asic_ver_num | The ASIC version number |
Definition at line 963 of file mbgutil.c.
References _convert_asic_version_number, _int_from_size_t, _pcps_asic_version_major, _pcps_asic_version_minor, _pcps_fw_rev_num_major, _pcps_fw_rev_num_minor, dev_name, device_id_is_serial(), MBG_GRP_SERNUM_LEN, PCPS_ASIC_STR_FMT, PCPS_FW_STR_FMT, sn_cpy_str_safe(), snprintf_safe(), and strncpy_safe().
int mbg_str_pcps_date | ( | char * | s, |
int | max_len, | ||
const PCPS_TIME * | pt | ||
) |
Write the date given as PCPS_TIME structure to a string buffer.
The output string buffer is in any case properly terminated by 0.
[out] | s | Pointer to the output buffer |
[in] | max_len | Size of the output buffer |
[in] | pt | Pointer to a PCPS_TIME structure providing date and time |
Definition at line 421 of file mbgutil.c.
References mbg_str_date(), PCPS_TIME::mday, PCPS_TIME::month, and PCPS_TIME::year.
Referenced by mbg_str_pcps_date_time().
int mbg_str_pcps_date_short | ( | char * | s, |
int | max_len, | ||
const PCPS_TIME * | pt | ||
) |
Write the short date given as PCPS_TIME structure to a string buffer.
The output string buffer is in any case properly terminated by 0.
[out] | s | Pointer to the output buffer |
[in] | max_len | Size of the output buffer |
[in] | pt | Pointer to a PCPS_TIME structure providing date and time |
Definition at line 400 of file mbgutil.c.
References mbg_str_date_short(), PCPS_TIME::mday, and PCPS_TIME::month.
int mbg_str_pcps_date_time | ( | char * | s, |
int | max_len, | ||
const PCPS_TIME * | pt, | ||
const char * | tz_str | ||
) |
Write date and time given as PCPS_TIME structure to a string buffer.
The number of space characters between date and time is determined by the global variable mbg_date_time_dist.
The output string buffer is in any case properly terminated by 0.
[out] | s | Pointer to the output buffer |
[in] | max_len | Size of the output buffer |
[in] | pt | Pointer to a PCPS_TIME structure providing date and time |
[in] | tz_str | Optional time zone string to be appended, currently not used, may be NULL |
Definition at line 509 of file mbgutil.c.
References mbg_date_time_dist, mbg_str_pcps_date(), mbg_str_pcps_time(), and mbg_strchar().
int mbg_str_pcps_hr_date | ( | char * | s, |
int | max_len, | ||
uint32_t | sec | ||
) |
Write date derived from seconds-since-epoch to a string buffer.
The output string buffer is in any case properly terminated by 0.
[out] | s | Pointer to the output buffer |
[in] | max_len | Size of the output buffer |
[in] | sec | Number of seconds since the epoch to be converted to date and time |
Definition at line 536 of file mbgutil.c.
References cvt_to_time_t(), mbg_gmtime(), mbg_rc_is_success, mbg_str_date(), sn_cpy_str_safe(), and str_inv_cnv.
int mbg_str_pcps_hr_date_time_loc | ( | char * | s, |
int | max_len, | ||
const PCPS_HR_TIME * | pt | ||
) |
Write local date and time given as PCPS_HR_TIME structure to a string buffer.
The number of space characters between date and time is determined by the global variable mbg_date_time_dist.
The output string buffer is in any case properly terminated by 0.
[out] | s | Pointer to the output buffer |
[in] | max_len | Size of the output buffer |
[in] | pt | Pointer to a PCPS_HR_TIME structure providing date and time |
Definition at line 655 of file mbgutil.c.
References cvt_to_time_t(), do_str_pcps_hr_date_time(), PCPS_TIME_STAMP::sec, PCPS_HR_TIME::tstamp, and PCPS_HR_TIME::utc_offs.
Referenced by mbg_str_pcps_hr_tstamp_loc().
int mbg_str_pcps_hr_date_time_utc | ( | char * | s, |
int | max_len, | ||
const PCPS_HR_TIME * | pt | ||
) |
Write UTC date and time given as PCPS_HR_TIME structure to a string buffer.
The number of space characters between date and time is determined by the global variable mbg_date_time_dist.
The output string buffer is in any case properly terminated by 0.
[out] | s | Pointer to the output buffer |
[in] | max_len | Size of the output buffer |
[in] | pt | Pointer to a PCPS_HR_TIME structure providing date and time |
Definition at line 629 of file mbgutil.c.
References cvt_to_time_t(), do_str_pcps_hr_date_time(), PCPS_TIME_STAMP::sec, and PCPS_HR_TIME::tstamp.
Referenced by mbg_str_pcps_hr_tstamp_utc().
int mbg_str_pcps_hr_time | ( | char * | s, |
int | max_len, | ||
uint32_t | sec | ||
) |
Write time derived from seconds-since-epoch to a string buffer.
The output string buffer is in any case properly terminated by 0.
[out] | s | Pointer to the output buffer |
[in] | max_len | Size of the output buffer |
[in] | sec | Number of seconds since the epoch to be converted to date and time |
Definition at line 563 of file mbgutil.c.
References cvt_to_time_t(), mbg_gmtime(), mbg_rc_is_success, mbg_str_time(), sn_cpy_str_safe(), and str_inv_cnv.
int mbg_str_pcps_hr_time_frac | ( | char * | s, |
int | max_len, | ||
uint32_t | frac | ||
) |
Print binary PCPS_FRAC_32 fractions in decimal to a string buffer.
The output string buffer is in any case properly terminated by 0.
[out] | s | Pointer to the output buffer |
[in] | max_len | Size of the output buffer |
[in] | frac | Binary fractions of a second in PCPS_FRAC_32 format |
Definition at line 679 of file mbgutil.c.
References bin_frac_32_to_dec_frac(), PCPS_HRT_FRAC_SCALE, PCPS_HRT_FRAC_SCALE_FMT, and snprintf_safe().
Referenced by mbg_str_pcps_hr_tstamp_loc(), and mbg_str_pcps_hr_tstamp_utc().
int mbg_str_pcps_hr_time_offs | ( | char * | s, |
int | max_len, | ||
const PCPS_HR_TIME * | pt, | ||
const char * | info | ||
) |
Print the UTC offset from a PCPS_HR_TIME structure to a string buffer.
The output format is sign - hours - minutes, e.g. "+01:45h". The output string buffer is in any case properly terminated by 0.
[out] | s | Pointer to the output buffer |
[in] | max_len | Size of the output buffer |
[in] | pt | Pointer to a PCPS_HR_TIME structure providing date, and UTC offset |
[in] | info | An informational text to be prepended |
Definition at line 703 of file mbgutil.c.
References snprintf_safe(), and PCPS_HR_TIME::utc_offs.
Referenced by mbg_snprint_hr_time_loc(), mbg_str_pcps_hr_time_raw(), and mbg_str_pcps_hr_tstamp_loc().
int mbg_str_pcps_hr_time_raw | ( | char * | s, |
int | max_len, | ||
const PCPS_HR_TIME * | pt | ||
) |
Write a raw high resolution time stamp plus converted local time to a string buffer.
The output string also has the time status code appended as hex number.
The output string buffer is in any case properly terminated by 0.
[out] | s | Pointer to the output buffer |
[in] | max_len | Size of the output buffer |
[in] | pt | Pointer to a PCPS_HR_TIME structure providing date and time |
Definition at line 831 of file mbgutil.c.
References mbg_str_pcps_hr_time_offs(), mbg_str_pcps_tstamp_raw(), snprintf_safe(), PCPS_HR_TIME::status, and PCPS_HR_TIME::tstamp.
int mbg_str_pcps_hr_tstamp_loc | ( | char * | s, |
int | max_len, | ||
const PCPS_HR_TIME * | pt | ||
) |
Write a high resolution local time stamp including fractions to a string buffer.
The output string buffer is in any case properly terminated by 0.
[out] | s | Pointer to the output buffer |
[in] | max_len | Size of the output buffer |
[in] | pt | Pointer to a PCPS_HR_TIME structure providing date and time |
Definition at line 765 of file mbgutil.c.
References PCPS_TIME_STAMP::frac, mbg_str_pcps_hr_date_time_loc(), mbg_str_pcps_hr_time_frac(), mbg_str_pcps_hr_time_offs(), PCPS_SCALE_GPS, PCPS_SCALE_TAI, PCPS_HR_TIME::status, and PCPS_HR_TIME::tstamp.
Referenced by mbg_str_ucap().
int mbg_str_pcps_hr_tstamp_utc | ( | char * | s, |
int | max_len, | ||
const PCPS_HR_TIME * | pt | ||
) |
Write a high resolution UTC time stamp including fractions to a string buffer.
The output string buffer is in any case properly terminated by 0.
[out] | s | Pointer to the output buffer |
[in] | max_len | Size of the output buffer |
[in] | pt | Pointer to a PCPS_HR_TIME structure providing date and time |
Definition at line 736 of file mbgutil.c.
References PCPS_TIME_STAMP::frac, mbg_str_pcps_hr_date_time_utc(), mbg_str_pcps_hr_time_frac(), and PCPS_HR_TIME::tstamp.
int mbg_str_pcps_time | ( | char * | s, |
int | max_len, | ||
const PCPS_TIME * | pt | ||
) |
Write the time given as PCPS_TIME structure to a string buffer.
The output string buffer is in any case properly terminated by 0.
[out] | s | Pointer to the output buffer |
[in] | max_len | Size of the output buffer |
[in] | pt | Pointer to a PCPS_TIME structure providing date and time |
Definition at line 463 of file mbgutil.c.
References PCPS_TIME::hour, mbg_str_time(), PCPS_TIME::min, and PCPS_TIME::sec.
Referenced by mbg_str_pcps_date_time().
int mbg_str_pcps_time_long | ( | char * | s, |
int | max_len, | ||
const PCPS_TIME * | pt | ||
) |
Write the time including sec100ths given as PCPS_TIME structure to a string buffer.
The output string buffer is in any case properly terminated by 0.
[out] | s | Pointer to the output buffer |
[in] | max_len | Size of the output buffer |
[in] | pt | Pointer to a PCPS_TIME structure providing date and time |
Definition at line 484 of file mbgutil.c.
References PCPS_TIME::hour, mbg_str_time_long(), PCPS_TIME::min, PCPS_TIME::sec, and PCPS_TIME::sec100.
int mbg_str_pcps_time_short | ( | char * | s, |
int | max_len, | ||
const PCPS_TIME * | pt | ||
) |
Write the short time given as PCPS_TIME structure to a string buffer.
The output string buffer is in any case properly terminated by 0.
[out] | s | Pointer to the output buffer |
[in] | max_len | Size of the output buffer |
[in] | pt | Pointer to a PCPS_TIME structure providing date and time |
Definition at line 442 of file mbgutil.c.
References PCPS_TIME::hour, mbg_str_time_short(), and PCPS_TIME::min.
int mbg_str_pcps_tstamp_raw | ( | char * | s, |
int | max_len, | ||
const PCPS_TIME_STAMP * | pt | ||
) |
Write a raw high resolution time stamp to a string buffer.
The output string buffer is in any case properly terminated by 0.
[out] | s | Pointer to the output buffer |
[in] | max_len | Size of the output buffer |
[in] | pt | Pointer to a PCPS_HR_TIME structure providing date and time |
Definition at line 808 of file mbgutil.c.
References PCPS_TIME_STAMP::frac, PCPS_TIME_STAMP::sec, and snprintf_safe().
Referenced by mbg_str_pcps_hr_time_raw().
int mbg_str_pos | ( | char * | s, |
int | max_len, | ||
const POS * | ppos, | ||
int | prec | ||
) |
Write geographic coordinates to a string buffer.
The output string buffer is in any case properly terminated by 0.
[out] | s | Pointer to the output buffer |
[in] | max_len | Size of the output buffer |
[in] | ppos | Pointer to a POS structure containing the coordinates |
[in] | prec | Number of digits of the geographic seconds after the decimal separator |
Definition at line 925 of file mbgutil.c.
References ALT, LAT, POS::latitude, POS::lla, LON, POS::longitude, mbg_pos_dist, mbg_str_pos_alt(), mbg_str_pos_dms(), mbg_strchar(), mbg_strncpy(), and str_not_avail.
int mbg_str_pos_alt | ( | char * | s, |
int | max_len, | ||
double | alt | ||
) |
Write a position's altitude parameter to a string buffer.
The output string buffer is in any case properly terminated by 0.
[out] | s | Pointer to the output buffer |
[in] | max_len | Size of the output buffer |
[in] | alt | The altitude parameter, in meters |
Definition at line 904 of file mbgutil.c.
References snprintf_safe().
Referenced by mbg_str_pos().
int mbg_str_pos_dms | ( | char * | s, |
int | max_len, | ||
const DMS * | pdms, | ||
int | prec | ||
) |
Write a geographic coordinate in degrees - minutes - seconds to a string buffer.
The output string buffer is in any case properly terminated by 0.
[out] | s | Pointer to the output buffer |
[in] | max_len | Size of the output buffer |
[in] | pdms | Pointer to a DMS structure containing the coordinate |
[in] | prec | Number of digits of the geographic seconds after the decimal separator |
Definition at line 881 of file mbgutil.c.
References DMS::deg, DEG, DMS::min, DMS::prefix, DMS::sec, and snprintf_safe().
Referenced by mbg_str_pos().
int mbg_str_time | ( | char * | s, |
int | max_len, | ||
int | hour, | ||
int | min, | ||
int | sec | ||
) |
Write a time string "hh:mm:ss" to a string buffer.
The output string buffer is in any case properly terminated by 0.
[out] | s | Pointer to the output buffer |
[in] | max_len | Size of the output buffer |
[in] | hour | Hours number, 0..23 |
[in] | min | Minutes number, 0..59 |
[in] | sec | Seconds number, 0..59, or 60 in case of leap second |
Definition at line 320 of file mbgutil.c.
References mbg_str_time_short(), and snprintf_safe().
Referenced by do_str_pcps_hr_date_time(), mbg_str_pcps_hr_time(), mbg_str_pcps_time(), mbg_str_time_long(), and mbg_str_tm_gps_date_time().
int mbg_str_time_long | ( | char * | s, |
int | max_len, | ||
int | hour, | ||
int | min, | ||
int | sec, | ||
int | sec100 | ||
) |
Write a long time string "hh:mm:ss.cc" to a string buffer.
Include 100ths of seconds. The output string buffer is in any case properly terminated by 0.
[out] | s | Pointer to the output buffer |
[in] | max_len | Size of the output buffer |
[in] | hour | Hours number, 0..23 |
[in] | min | Minutes number, 0..59 |
[in] | sec | Seconds number, 0..59, or 60 in case of leap second |
[in] | sec100 | Hundreths of seconds, 0..99 |
Definition at line 348 of file mbgutil.c.
References mbg_str_time(), and snprintf_safe().
Referenced by mbg_str_pcps_time_long().
int mbg_str_time_short | ( | char * | s, |
int | max_len, | ||
int | hour, | ||
int | min | ||
) |
Write a short time string "hh:mm" to a string buffer.
The output string buffer is in any case properly terminated by 0.
[out] | s | Pointer to the output buffer |
[in] | max_len | Size of the output buffer |
[in] | hour | Hours number, 0..23 |
[in] | min | Minutes number, 0..59 |
Definition at line 297 of file mbgutil.c.
References snprintf_safe().
Referenced by mbg_str_pcps_time_short(), and mbg_str_time().
int mbg_str_tm_gps_date_time | ( | char * | s, |
int | max_len, | ||
const TM_GPS * | pt | ||
) |
Write a full date and time string to a string buffer.
The number of space characters between date and time is determined by the global variable mbg_date_time_dist.
The output string buffer is in any case properly terminated by 0.
[out] | s | Pointer to the output buffer |
[in] | max_len | Size of the output buffer |
[in] | pt | Pointer to a TM_GPS structure providing date and time |
Definition at line 375 of file mbgutil.c.
References TM_GPS::hour, mbg_date_time_dist, mbg_str_date(), mbg_str_time(), mbg_strchar(), TM_GPS::mday, TM_GPS::min, TM_GPS::month, TM_GPS::sec, and TM_GPS::year.
int mbg_str_ucap | ( | char * | s, |
int | max_len, | ||
const PCPS_HR_TIME * | pt | ||
) |
Write time capture / user capture time stamp to a string buffer.
The output string buffer is in any case properly terminated by 0.
[out] | s | Pointer to the output buffer |
[in] | max_len | Size of the output buffer |
[in] | pt | Pointer to a PCPS_HR_TIME structure containing a user capture event |
Definition at line 856 of file mbgutil.c.
References mbg_str_pcps_hr_tstamp_loc(), PCPS_HR_TIME::signal, and snprintf_safe().
int mbg_strchar | ( | char * | s, |
size_t | max_len, | ||
char | c, | ||
size_t | n | ||
) |
Write a character multiple times to a string buffer.
The output string buffer is in any case properly terminated by 0.
[out] | s | Pointer to the output buffer |
[in] | max_len | Size of the output buffer |
[in] | c | The character to write to the output buffer |
[in] | n | The number of characters to write to the output buffer |
Definition at line 205 of file mbgutil.c.
Referenced by do_str_pcps_hr_date_time(), mbg_str_pcps_date_time(), mbg_str_pos(), and mbg_str_tm_gps_date_time().
int mbg_strncpy | ( | char * | s, |
size_t | max_len, | ||
const char * | src | ||
) |
A portable, safe implementation of strncpy()
The output string buffer is in any case properly terminated by 0.
[out] | s | Pointer to the destination string buffer |
[in] | max_len | Size of the destination string buffer |
[in] | src | Pointer to the source string buffer |
Definition at line 184 of file mbgutil.c.
References sn_cpy_str_safe().
Referenced by mbg_str_pos().
int mbgutil_check_version | ( | int | header_version | ) |
Check if the DLL/shared library is compatible with a given version.
If this library is used as a DLL/shared object library then the version number can be checked to see if the header files which are actually used to build an application are compatible with the header files which have been used to build the library, and thus the API functions are called in the correct way.
[in] | header_version | Version number to be checked, should be MBGUTIL_VERSION from the mbgutil.h file version used to build the application |
Definition at line 128 of file mbgutil.c.
References MBG_ERR_LIB_NOT_COMPATIBLE, MBG_SUCCESS, and MBGUTIL_COMPAT_VERSION.
int mbgutil_get_version | ( | void | ) |
Get the version number of the precompiled DLL/shared object library.
If this library is used as a DLL/shared object library then the version number can be checked to see if the header files which are actually used to build an application are compatible with the header files which have been used to build the library, and thus the API function are called in the correct way.
Definition at line 102 of file mbgutil.c.
References MBGUTIL_VERSION.