]> git.lyx.org Git - lyx.git/blob - src/support/os.h
330e9a801f283b82f8204c2b7687f56a28c06b6a
[lyx.git] / src / support / os.h
1 // os.h copyright "Ruurd A. Reitsma" <R.A.Reitsma@wbmt.tudelft.nl>
2
3 #ifndef OS_H
4 #define OS_H
5
6 #include "LString.h"
7
8 /// wrap OS specific stuff
9 namespace os {
10         //
11         enum shell_type {
12                 UNIX,   // Do we have to distinguish sh and csh?
13                 CMD_EXE
14         };
15
16         // do some work just once
17         void init(int * argc, char ** argv[]);
18         // returns path of LyX binary
19         string binpath();
20         // returns name of LyX binary
21         string binname();
22         // system_tempdir actually doesn't belong here
23         // I put it here only to avoid a global variable.
24         void setTmpDir(string const & p);
25         // 
26         string getTmpDir();
27         //
28         string current_root();
29         //
30         shell_type shell();
31         // DBCS aware!
32         string::size_type common_path(string const & p1, string const & p2);
33         // no-op on UNIX, '\\'->'/' on OS/2 and Win32, ':'->'/' on MacOS, etc.
34         string slashify_path(string const & p);
35         // converts a host OS path to unix style
36         string external_path(string const & p);
37         // converts a unix path to host OS style
38         string internal_path(string const & p);
39         // is path absolute?
40         bool is_absolute_path(string const & p);
41         // returns a string suitable to be passed to popen when
42         // same for popen().
43         char const * popen_read_mode();
44         //
45         void warn(string const & mesg);
46 }
47
48 #endif