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