MRTKLIB 0.7.14
Modernized GNSS Positioning Library
Loading...
Searching...
No Matches
mrtk_sys.h File Reference

MRTKLIB System Module — OS/filesystem utility functions. More...

Include dependency graph for mrtk_sys.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

double str2num (const char *s, int i, int n)
 Convert substring in string to number.
int execcmd (const char *cmd)
 Execute command line by operating system shell.
int expath (const char *path, char *paths[], int nmax)
 Expand file path with wild-card (*) in file.
void createdir (const char *path)
 Create directory if not exists (recursively).
int reppath (const char *path, char *rpath, gtime_t time, const char *rov, const char *base)
 Replace keywords in file path with date, time, rover and base station id.
int reppaths (const char *path, char *rpath[], int nmax, gtime_t ts, gtime_t te, const char *rov, const char *base)
 Replace keywords in file path and generate multiple paths.
int rtk_uncompress (const char *file, char *uncfile)
 Uncompress file (gzip/zip/tar/Hatanaka).

Detailed Description

MRTKLIB System Module — OS/filesystem utility functions.

This header provides system-level utility functions for command execution, file path expansion, directory creation, path keyword replacement, string-to-number conversion, and file decompression, extracted from rtkcmn.c with zero algorithmic changes.

Note
Functions declared here are implemented in mrtk_sys.c.

Definition in file mrtk_sys.h.

Function Documentation

◆ createdir()

void createdir ( const char * path)

Create directory if not exists (recursively).

Parameters
[in]pathFile path to be saved

Definition at line 187 of file mrtk_sys.c.

References FILEPATHSEP, mkdir_r(), and tracet().

Referenced by openfile(), openfile_(), and outhead().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ execcmd()

int execcmd ( const char * cmd)

Execute command line by operating system shell.

Parameters
[in]cmdCommand line string
Returns
Execution status (0:ok, >0:error)

Definition at line 83 of file mrtk_sys.c.

References trace().

Referenced by ftpthread(), and rtk_uncompress().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ expath()

int expath ( const char * path,
char * paths[],
int nmax )

Expand file path with wild-card (*) in file.

Parameters
[in]pathFile path to expand (case insensitive)
[out]pathsExpanded file paths
[in]nmaxMax number of expanded file paths
Returns
Number of expanded file paths
Note
The order of expanded files is alphabetical order

Definition at line 96 of file mrtk_sys.c.

References trace().

Referenced by convrnx_s(), readbnxt(), readdcb(), readfcb(), readisb(), readrnxc(), readrnxt(), readsp3(), readtec(), and sbsreadmsgt().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ reppath()

int reppath ( const char * path,
char * rpath,
gtime_t time,
const char * rov,
const char * base )

Replace keywords in file path with date, time, rover and base station id.

Parameters
[in]pathFile path with keywords (see notes)
[out]rpathFile path with keywords replaced
[in]timeTime (GPST) (time.time==0: not replaced)
[in]rovRover id string ("": not replaced)
[in]baseBase station id string ("": not replaced)
Returns
Status (1:keywords replaced, 0:no valid keyword, -1:no valid time)
Note
Keywords: Y(yyyy), y(yy), m(mm), d(dd), h(hh), M(mm), S(ss), n(ddd), W(wwww), D(d), H(h), ha(hh), hb(hh), hc(hh), t(mm), r(rover), b(base)

Definition at line 248 of file mrtk_sys.c.

References epoch2time(), repstr(), gtime_t::time, time2epoch(), time2gpst(), and timediff().

Referenced by convrnx_s(), execses(), execses_b(), execses_r(), ftpthread(), openfile_(), postpos(), readpreceph(), reppaths(), rtkopenstat(), swapfile(), swapsolstat(), traceopen(), udbiass(), update_clas(), update_gal_has(), update_qzssl6d(), update_qzssl6e(), update_rtcm(), and update_stat().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ reppaths()

int reppaths ( const char * path,
char * rpath[],
int nmax,
gtime_t ts,
gtime_t te,
const char * rov,
const char * base )

Replace keywords in file path and generate multiple paths.

Parameters
[in]pathFile path with keywords
[out]rpathFile paths with keywords replaced
[in]nmaxMax number of output file paths
[in]tsTime start (GPST)
[in]teTime end (GPST)
[in]rovRover id string ("": not replaced)
[in]baseBase station id string ("": not replaced)
Returns
Number of replaced file paths

Definition at line 321 of file mrtk_sys.c.

References gpst2time(), reppath(), gtime_t::time, time2gpst(), timeadd(), timediff(), and trace().

Referenced by postpos().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rtk_uncompress()

int rtk_uncompress ( const char * file,
char * uncfile )

Uncompress file (gzip/zip/tar/Hatanaka).

Parameters
[in]fileInput file
[out]uncfileUncompressed file path
Returns
Status (-1:error, 0:not compressed file, 1:uncompress completed)
Note
Creates uncompressed file in temporary directory. gzip, tar and crx2rnx commands must be installed.

Definition at line 367 of file mrtk_sys.c.

References execcmd(), and trace().

Referenced by ftpthread(), readbnxfile(), and readrnxfile().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ str2num()

double str2num ( const char * s,
int i,
int n )

Convert substring in string to number.

Parameters
[in]sString ("... nnn.nnn ...")
[in]iSubstring position
[in]nSubstring width
Returns
Converted number (0.0 on error)

Definition at line 60 of file mrtk_sys.c.

Referenced by decode_navh(), decode_obsdata(), decode_obsepoch(), decode_obsh(), readbsnx(), readdcbf(), readionexb(), readionexdcb(), readionexh(), readisbf(), readL2C(), readrnxclk(), readrnxh(), readrnxnavb(), readsp3b(), and readsp3h().

Here is the caller graph for this function: