summary refs log tree commit diff stats
path: root/src/common/util.c
diff options
context:
space:
mode:
authorBerke Viktor <berkeviktor@aol.com>2011-12-11 17:34:02 +0100
committerBerke Viktor <berkeviktor@aol.com>2011-12-11 17:34:02 +0100
commit132ef6cb50201cb6ab8ab0609a88ccce62aa6a21 (patch)
tree0d47c10fa3b9789592c6513286d57a0c010b071f /src/common/util.c
parent2012320d0eed36e0461e44ac9be8cc162c135bf5 (diff)
initial patches for linux compatibility
Diffstat (limited to 'src/common/util.c')
-rw-r--r--src/common/util.c42
1 files changed, 40 insertions, 2 deletions
diff --git a/src/common/util.c b/src/common/util.c
index c16d41f5..ccc48657 100644
--- a/src/common/util.c
+++ b/src/common/util.c
@@ -27,17 +27,21 @@
 #include <stdlib.h>
 #include <sys/types.h>
 #include <sys/stat.h>
+
 #ifdef WIN32
 #include <sys/timeb.h>
 #include <process.h>
+#include <io.h>
+#include "dirent.h"
 #else
-#include <sys/types.h>
+#include <unistd.h>
 #include <pwd.h>
 #include <sys/time.h>
 #include <sys/utsname.h>
+#include <dirent.h>
 #endif
+
 #include <fcntl.h>
-#include "dirent.h"
 #include <errno.h>
 #include "xchat.h"
 #include "xchatc.h"
@@ -1848,3 +1852,37 @@ canonalize_key (char *key)
 		}
 	}
 }
+
+int
+portable_mode ()
+{
+#ifdef WIN32
+	if ((_access( "portable-mode", 0 )) != -1)
+	{
+		return 1;
+	}
+	else
+	{
+		return 0;
+	}
+#else
+	return 0;
+#endif
+}
+
+int
+xtray_mode ()
+{
+#ifdef WIN32
+	if ((_access( "plugins/xtray.dll", 0 )) != -1)
+	{
+		return 1;
+	}
+	else
+	{
+		return 0;
+	}
+#else
+	return 0;
+#endif
+}