|
MRTKLIB 0.7.14
Modernized GNSS Positioning Library
|
MRTKLIB System Module — OS/filesystem utility functions. More...
#include "mrtklib/mrtk_time.h"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). | |
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.
Definition in file mrtk_sys.h.
| void createdir | ( | const char * | path | ) |
Create directory if not exists (recursively).
| [in] | path | File 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().
| int execcmd | ( | const char * | cmd | ) |
Execute command line by operating system shell.
| [in] | cmd | Command line string |
Definition at line 83 of file mrtk_sys.c.
References trace().
Referenced by ftpthread(), and rtk_uncompress().
| int expath | ( | const char * | path, |
| char * | paths[], | ||
| int | nmax ) |
Expand file path with wild-card (*) in file.
| [in] | path | File path to expand (case insensitive) |
| [out] | paths | Expanded file paths |
| [in] | nmax | Max number of expanded file paths |
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().
| 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.
| [in] | path | File path with keywords (see notes) |
| [out] | rpath | File path with keywords replaced |
| [in] | time | Time (GPST) (time.time==0: not replaced) |
| [in] | rov | Rover id string ("": not replaced) |
| [in] | base | Base station id string ("": not replaced) |
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().
| 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.
| [in] | path | File path with keywords |
| [out] | rpath | File paths with keywords replaced |
| [in] | nmax | Max number of output file paths |
| [in] | ts | Time start (GPST) |
| [in] | te | Time end (GPST) |
| [in] | rov | Rover id string ("": not replaced) |
| [in] | base | Base station id string ("": not replaced) |
Definition at line 321 of file mrtk_sys.c.
References gpst2time(), reppath(), gtime_t::time, time2gpst(), timeadd(), timediff(), and trace().
Referenced by postpos().
| int rtk_uncompress | ( | const char * | file, |
| char * | uncfile ) |
Uncompress file (gzip/zip/tar/Hatanaka).
| [in] | file | Input file |
| [out] | uncfile | Uncompressed file path |
Definition at line 367 of file mrtk_sys.c.
References execcmd(), and trace().
Referenced by ftpthread(), readbnxfile(), and readrnxfile().
| double str2num | ( | const char * | s, |
| int | i, | ||
| int | n ) |
Convert substring in string to number.
| [in] | s | String ("... nnn.nnn ...") |
| [in] | i | Substring position |
| [in] | n | Substring width |
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().