]> git.lyx.org Git - lyx.git/blobdiff - src/support/os_unix.C
tostr -> convert and some bformat work
[lyx.git] / src / support / os_unix.C
index 8c556da25303c6b1b516125a97619530dfbe2ae7..53594714e35622b369963910b150cf1b78d6f448 100644 (file)
@@ -25,6 +25,8 @@ namespace {
 string binpath_;
 string binname_;
 string tmpdir_;
+string homepath_;
+string nulldev_;
 
 }
 
@@ -32,14 +34,14 @@ 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)) {
@@ -55,6 +57,10 @@ void init(int * /*argc*/, char ** argv[])
        if (suffixIs(tmp, "/.libs/"))
                tmp.erase(tmp.length() - 6, string::npos);
        binpath_ = tmp;
+
+       tmpdir_ = "/tmp";
+       homepath_ = GetEnvPath("HOME");
+       nulldev_ = "/dev/null";
 }
 
 
@@ -90,12 +96,6 @@ string::size_type common_path(string const & p1, string const & p2)
 }
 
 
-string slashify_path(string const & p)
-{
-       return p;
-}
-
-
 string external_path(string const & p)
 {
        return p;
@@ -120,13 +120,13 @@ char const * popen_read_mode()
 }
 
 
-string binpath()
+string const & binpath()
 {
        return binpath_;
 }
 
 
-string binname()
+string const & binname()
 {
        return binname_;
 }
@@ -138,12 +138,24 @@ void setTmpDir(string const & p)
 }
 
 
-string getTmpDir()
+string const & getTmpDir()
 {
        return tmpdir_;
 }
 
 
+string const & homepath()
+{
+       return homepath_;
+}
+
+
+string const & nulldev()
+{
+       return nulldev_;
+}
+
+
 shell_type shell()
 {
        return UNIX;