#include "support/os.h"
#include "support/FileName.h"
+#include "support/lassert.h"
#include "support/lstrings.h"
#include "support/debug.h"
namespace {
+int argc_ = 0;
+char ** argv_ = 0;
+
bool windows_style_tex_paths_ = false;
// In both is_posix_path() and is_windows_path() it is assumed that
} // namespace anon
-void init(int, char *[])
+void init(int argc, char * argv[])
{
+ argc_ = argc;
+ argv_ = argv;
+
// Make sure that the TEMP variable is set
// and sync the Windows environment.
setenv("TEMP", "/tmp", false);
}
+string utf8_argv(int i)
+{
+ LASSERT(i < argc_, /**/);
+ return to_utf8(from_local8bit(argv_[i]));
+}
+
+
+void remove_internal_args(int, int)
+{}
+
+
string current_root()
{
return string("/");
}
-string safe_internal_path(string const & p)
+string safe_internal_path(string const & p, file_access)
{
return convert_path(p, PathStyle(posix));
}
}
-bool is_terminal(io_channel channel)
-{
- return isatty(channel);
-}
-
-
shell_type shell()
{
return UNIX;
{
char rpath[PATH_MAX + 1];
char * result = realpath(path.c_str(), rpath);
- return FileName::fromFilesystemEncoding(result ? rpath : path).absFilename();
+ return FileName::fromFilesystemEncoding(result ? rpath : path).absFileName();
}
} // namespace os