|
MRTKLIB 0.7.14
Modernized GNSS Positioning Library
|
MRTKLIB System Module — Implementation. More...
#include "mrtklib/mrtk_sys.h"#include <ctype.h>#include <dirent.h>#include <errno.h>#include <math.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include <sys/stat.h>#include <sys/types.h>#include "mrtklib/mrtk_trace.h"Go to the source code of this file.
Macros | |
| #define | _POSIX_C_SOURCE 199506 |
| #define | FILEPATHSEP '/' |
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. | |
| static int | mkdir_r (const char *dir) |
| void | createdir (const char *path) |
| Create directory if not exists (recursively). | |
| static int | repstr (char *str, const char *pat, const char *rep) |
| 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 — Implementation.
All functions and static data in this file are cut-and-paste extractions from the legacy rtkcmn.c with zero algorithmic changes.
Definition in file mrtk_sys.c.
| #define _POSIX_C_SOURCE 199506 |
Definition at line 24 of file mrtk_sys.c.
| #define FILEPATHSEP '/' |
Definition at line 48 of file mrtk_sys.c.
Referenced by createdir(), ftpthread(), mkdir_r(), readbnxt(), readrnxt(), and update_stat().
|
extern |
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().
|
extern |
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().
|
extern |
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().
|
static |
Definition at line 156 of file mrtk_sys.c.
References FILEPATHSEP, mkdir_r(), and trace().
Referenced by createdir(), and mkdir_r().
|
extern |
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().
|
extern |
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().
|
static |
Definition at line 201 of file mrtk_sys.c.
Referenced by reppath().
|
extern |
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().
|
extern |
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().