aboutsummaryrefslogtreecommitdiffstats
path: root/host/include
diff options
context:
space:
mode:
authorBen Hilburn <ben.hilburn@ettus.com>2015-01-28 13:23:42 -0800
committerBen Hilburn <ben.hilburn@ettus.com>2015-01-28 13:23:42 -0800
commitb92662d5780f3a2d872e5ab96efc0760cce1fe53 (patch)
tree2a4b03ad89ea68619010ecee0115c702fb2354d8 /host/include
parentebe7169dcecd1b6899734cefdf5771612067fd48 (diff)
parentdb3fac73beb30ceaaf6a275d9668a38af3b839f5 (diff)
downloaduhd-b92662d5780f3a2d872e5ab96efc0760cce1fe53.tar.gz
uhd-b92662d5780f3a2d872e5ab96efc0760cce1fe53.tar.bz2
uhd-b92662d5780f3a2d872e5ab96efc0760cce1fe53.zip
Merge branch 'maint' into master
Resolved Conflicts: host/docs/usrp_e3x0.dox host/include/uhd/utils/paths.hpp host/lib/transport/nirio/nifpga_lvbitx.cpp host/lib/usrp/b200/b200_impl.cpp host/lib/utils/paths.cpp
Diffstat (limited to 'host/include')
-rw-r--r--host/include/uhd/config.hpp12
-rw-r--r--host/include/uhd/transport/nirio/nifpga_lvbitx.h2
-rw-r--r--host/include/uhd/utils/paths.hpp49
3 files changed, 53 insertions, 10 deletions
diff --git a/host/include/uhd/config.hpp b/host/include/uhd/config.hpp
index 173845fea..23eb9cdb2 100644
--- a/host/include/uhd/config.hpp
+++ b/host/include/uhd/config.hpp
@@ -99,4 +99,16 @@ typedef ptrdiff_t ssize_t;
#define UHD_PLATFORM_BSD
#endif
+// Define 'stringize' preprocessor macros. The stringize macro, XSTR, takes
+// variable arguments so that it can deal with strings that contain commas.
+// There are two different versions because MSVC handles this syntax a bit
+// differently than other compilers.
+#if defined(BOOST_MSVC)
+ #define XSTR(x,...) #x
+#else
+ #define XSTR(x...) #x
+#endif
+
+#define STR(x) XSTR(x)
+
#endif /* INCLUDED_UHD_CONFIG_HPP */
diff --git a/host/include/uhd/transport/nirio/nifpga_lvbitx.h b/host/include/uhd/transport/nirio/nifpga_lvbitx.h
index 598f7fcbe..f037ffd47 100644
--- a/host/include/uhd/transport/nirio/nifpga_lvbitx.h
+++ b/host/include/uhd/transport/nirio/nifpga_lvbitx.h
@@ -51,8 +51,8 @@ public:
protected:
std::string _get_bitstream_checksum(const std::string& file_path);
- std::string _get_fpga_images_dir(const std::string search_paths);
};
+
}}
#endif /* INCLUDED_UHD_TRANSPORT_NIRIO_NIFPGA_LVBITX_H */
diff --git a/host/include/uhd/utils/paths.hpp b/host/include/uhd/utils/paths.hpp
index c1f32ba61..8edb87546 100644
--- a/host/include/uhd/utils/paths.hpp
+++ b/host/include/uhd/utils/paths.hpp
@@ -19,9 +19,15 @@
#define INCLUDED_UHD_UTILS_PATHS_HPP
#include <uhd/config.hpp>
+
+#include <boost/filesystem.hpp>
+
#include <string>
+#include <vector>
-namespace uhd{
+namespace fs = boost::filesystem;
+
+namespace uhd {
//! Get a string representing the system's temporary directory
UHD_API std::string get_tmp_path(void);
@@ -32,15 +38,41 @@ namespace uhd{
//! Get a string representing the system's pkg directory
UHD_API std::string get_pkg_path(void);
- /*!
- * Search for an image in the system image paths:
- * Search compiled-in paths and environment variable paths
- * for a specific image file with the provided file name.
- * \param image_name the name of the file
+ //! Get UHD library paths
+ std::vector<fs::path> get_module_paths(void);
+
+ /*! Return the UHD images directory path.
+ *
+ * This function returns the UHD images installation path on this system. The
+ * returned directory path is guaranteed to exist (assuming a valid path is
+ * found). This function will look for a directory that exists using this
+ * order of precedence:
+ *
+ * 1) `UHD_IMAGES_DIR` environment variable
+ * 2) Any paths passed to this function via `search_paths'
+ * 3) UHD package path / share / uhd / images
+ *
+ * The `search_paths` parameter may contain Windows registry keys. If no
+ * directory is found, an empty string is returned.
+ *
+ * \param search_paths A comma-separated list of hints for paths to include.
+ * \returns A path string if one is found, or an empty string on failure.
+ */
+ UHD_API std::string get_images_dir(const std::string search_paths);
+
+ /*! Return the full path to particular UHD binary image.
+ *
+ * This function searches for the passed image name, and returns an absolute
+ * path to it. The returned path is guaranteed to exist. The caller can also
+ * provide a full path to the image in the argument, and this function will
+ * validate it and convert it to an absolute system path.
+ *
+ * \param image_name The name of the file to search for, or the full path.
+ * \param search_paths Hints / paths to use when calling `get_images_dir`
* \return the full system path to the file
- * \throw exception if the image was not found
+ * \throw exception uhd::io_error if the file was not found.
*/
- UHD_API std::string find_image_path(const std::string &image_name);
+ UHD_API std::string find_image_path(const std::string &image_name, const std::string search_paths = "");
/*!
* Search for the location of a particular UHD utility.
@@ -56,7 +88,6 @@ namespace uhd{
* \return the message suggesting the use of the named utility.
*/
UHD_API std::string print_utility_error(std::string name);
-
} //namespace uhd
#endif /* INCLUDED_UHD_UTILS_PATHS_HPP */