3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Ruurd A. Reitsma
8 * Full author contact details are available in file CREDITS.
10 * Various OS specific functions
15 #include "support/os.h"
24 void init(int, char *[])
34 string::size_type common_path(string const & p1, string const & p2)
36 string::size_type i = 0;
37 string::size_type p1_len = p1.length();
38 string::size_type p2_len = p2.length();
39 while (i < p1_len && i < p2_len && p1[i] == p2[i])
41 if ((i < p1_len && i < p2_len)
42 || (i < p1_len && p1[i] != '/' && i == p2_len)
43 || (i < p2_len && p2[i] != '/' && i == p1_len))
46 --i; // here was the last match
47 while (i && p1[i] != '/')
54 string external_path(string const & p)
60 string internal_path(string const & p)
66 bool is_absolute_path(string const & p)
68 return !p.empty() && p[0] == '/';
72 char const * popen_read_mode()
78 string const & nulldev()
80 static string const nulldev_ = "/dev/null";
97 void cygwin_path_fix(bool)
101 } // namespace support