From 8459432067055759bd1d9b04f0e7943f1cf35d2d Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Thu, 10 Nov 2011 20:22:54 -0800 Subject: usrp: basically working iq cal on tx --- host/lib/utils/paths.cpp | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'host/lib/utils/paths.cpp') diff --git a/host/lib/utils/paths.cpp b/host/lib/utils/paths.cpp index a3dd377e5..4fc877d5d 100644 --- a/host/lib/utils/paths.cpp +++ b/host/lib/utils/paths.cpp @@ -16,6 +16,7 @@ // #include +#include #include #include #include @@ -23,6 +24,8 @@ #include #include #include +#include //getenv +#include //P_tmpdir namespace fs = boost::filesystem; @@ -79,3 +82,27 @@ std::vector get_module_paths(void){ paths.push_back(get_uhd_pkg_data_path() / "modules"); return paths; } + +/*********************************************************************** + * Implement the functions in paths.hpp + **********************************************************************/ +std::string uhd::get_tmp_path(void){ + const char *tmp_path = std::getenv("TMP"); + if (tmp_path != NULL) return tmp_path; + + #ifdef P_tmpdir + if (P_tmpdir != NULL) return P_tmpdir; + #endif + + return "/tmp"; +} + +std::string uhd::get_app_path(void){ + const char *appdata_path = std::getenv("APPDATA"); + if (appdata_path != NULL) return appdata_path; + + const char *home_path = std::getenv("HOME"); + if (home_path != NULL) return home_path; + + return uhd::get_tmp_path(); +} -- cgit v1.2.3