]> git.lyx.org Git - lyx.git/blobdiff - src/support/os_unix.C
make "make distcheck" work
[lyx.git] / src / support / os_unix.C
index d46eaffe3c1079528dfd0abf13f19edab78f704f..28235773133e77f33720950e0d7e651b420f485f 100644 (file)
@@ -1,53 +1,28 @@
-// os_unix.C
+/**
+ * \file os_unix.C
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
+ *
+ * \author Ruurd A. Reitsma
+ *
+ * Full author contact details are available in file CREDITS.
+ *
+ * Various OS specific functions
+ */
 
-// Various OS specific functions
 #include <config.h>
 
-#include "os.h"
-#include "support/filetools.h"
-#include "support/lstrings.h"
+#include "support/os.h"
 
-namespace {
-
-string binpath_;
-string binname_;
-string tmpdir_;
-
-}
+using std::string;
 
 
+namespace lyx {
+namespace support {
 namespace os {
 
-void init(int * /*argc*/, char ** argv[])
-{
-       static bool initialized = false;
-       if (initialized)
-               return;
-       initialized = true;
-
-       string tmp = *argv[0];
-       binname_ = OnlyFilename(tmp);
-       tmp = ExpandPath(tmp); // This expands ./ and ~/
-       if (!is_absolute_path(tmp)) {
-               string binsearchpath = GetEnvPath("PATH");
-               // This will make "src/lyx" work always :-)
-               binsearchpath += ";.";
-               tmp = FileOpenSearch(binsearchpath, tmp);
-       }
-
-       tmp = MakeAbsPath(OnlyPath(tmp));
-
-       // In case we are running in place and compiled with shared libraries
-       if (suffixIs(tmp, "/.libs/"))
-               tmp.erase(tmp.length() - 6, string::npos);
-       binpath_ = tmp;
-}
-
-
-void warn(string const & /*mesg*/)
-{
-       return;
-}
+void init(int, char *[])
+{}
 
 
 string current_root()
@@ -76,12 +51,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;
@@ -106,33 +75,28 @@ char const * popen_read_mode()
 }
 
 
-string binpath()
-{
-       return binpath_;
-}
-
-
-string binname()
+string const & nulldev()
 {
-       return binname_;
+       static string const nulldev_ = "/dev/null";
+       return nulldev_;
 }
 
 
-void setTmpDir(string const & p)
+shell_type shell()
 {
-       tmpdir_ = p;
+       return UNIX;
 }
 
 
-string getTmpDir()
+char path_separator()
 {
-       return tmpdir_;
+       return ':';
 }
 
 
-shell_type shell()
-{
-       return UNIX;
-}
+void cygwin_path_fix(bool)
+{}
 
-} // end namespace os
+} // namespace os
+} // namespace support
+} // namespace lyx