]> git.lyx.org Git - lyx.git/blobdiff - src/support/lyxlib.h
in addition to the changes mentioned in ChangeLog, there is the usual batch of whites...
[lyx.git] / src / support / lyxlib.h
index 87a5aaee80043f9170072a2cc42596dd3978b851..7fd7616275abcf269a95a2e77f032d0c44660fdc 100644 (file)
@@ -1,18 +1,20 @@
 // -*- C++ -*-
 /* This file is part of
- * ======================================================
+ * ====================================================== 
  * 
  *           LyX, The Document Processor
  *        
  *           Copyright (C) 1995 Matthias Ettrich
  *           Copyright (C) 1995-1999 The LyX Team.
  *
- * ======================================================*/
+ * ====================================================== */
 
 #ifndef LYX_LIB_H
 #define LYX_LIB_H
 
 #include <ctime>
+#include <unistd.h>
+
 #include "LString.h"
 #include "gettext.h"
 #include "support/filetools.h"
@@ -24,7 +26,7 @@ unsigned long lyxsum(char const * file);
 inline char * date() 
 {
        time_t tid;
-       if ((tid=time(0)) == (time_t)-1)
+       if ((tid= time(0)) == (time_t)-1)
                return (char*)0;
        else
                return (ctime(&tid));
@@ -44,4 +46,22 @@ inline string getUserName()
                userName = _("unknown");
        return userName;
 }
+
+// This should have been a namespace
+struct lyx {
+       static char * getcwd(char * buffer, size_t size) {
+#ifndef __EMX__
+               return ::getcwd(buffer, size);
+#else
+               return ::_getcwd2(buffer, size);
+#endif
+       };
+       static int chdir(char const * name) {
+#ifndef __EMX__
+               return ::chdir(name);
+#else
+               return ::_chdir2(name);
+#endif
+       };
+};
 #endif