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 string external_path_list(string const & p)
72 string internal_path_list(string const & p)
78 string latex_path(string const & p)
84 bool is_absolute_path(string const & p)
86 return !p.empty() && p[0] == '/';
90 char const * popen_read_mode()
96 string const & nulldev()
98 static string const nulldev_ = "/dev/null";
109 char path_separator()
115 void cygwin_path_fix(bool)
118 bool canAutoOpenFile(string const & /*ext*/, auto_open_mode const /*mode*/)
120 // currently, no default viewer is tried for non-windows system
121 // support for KDE/Gnome/Macintosh may be added later
126 bool autoOpenFile(string const & /*filename*/, auto_open_mode const /*mode*/)
128 // currently, no default viewer is tried for non-windows system
129 // support for KDE/Gnome/Macintosh may be added later
134 } // namespace support