*
* \author Ruurd A. Reitsma
*
- * Full author contact details are available in file CREDITS
+ * Full author contact details are available in file CREDITS.
*
* Various OS specific functions
*/
#include <config.h>
-#include "os.h"
+#include "support/os.h"
#include "support/filetools.h"
#include "support/lstrings.h"
+
+using std::string;
+
+
namespace {
string binpath_;
string binname_;
string tmpdir_;
+string homepath_;
+string nulldev_;
}
-
+namespace lyx {
+namespace support {
namespace os {
-void init(int * /*argc*/, char ** argv[])
+void init(int /*argc*/, char * argv[])
{
static bool initialized = false;
if (initialized)
return;
initialized = true;
- string tmp = *argv[0];
+ string tmp = argv[0];
binname_ = OnlyFilename(tmp);
tmp = ExpandPath(tmp); // This expands ./ and ~/
if (!is_absolute_path(tmp)) {
if (suffixIs(tmp, "/.libs/"))
tmp.erase(tmp.length() - 6, string::npos);
binpath_ = tmp;
+
+ tmpdir_ = "/tmp";
+ homepath_ = GetEnvPath("HOME");
+ nulldev_ = "/dev/null";
}
}
-string slashify_path(string const & p)
-{
- return p;
-}
-
-
string external_path(string const & p)
{
return p;
}
-string binpath()
+string const & binpath()
{
return binpath_;
}
-string binname()
+string const & binname()
{
return binname_;
}
}
-string getTmpDir()
+string const & getTmpDir()
{
return tmpdir_;
}
+string const & homepath()
+{
+ return homepath_;
+}
+
+
+string const & nulldev()
+{
+ return nulldev_;
+}
+
+
shell_type shell()
{
return UNIX;
}
-} // end namespace os
+} // namespace os
+} // namespace support
+} // namespace lyx