Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
path: root/src/sys
diff options
context:
space:
mode:
Diffstat (limited to 'src/sys')
-rw-r--r--src/sys/sys.cc10
-rw-r--r--src/sys/sys.h21
2 files changed, 21 insertions, 10 deletions
diff --git a/src/sys/sys.cc b/src/sys/sys.cc
index 9957408..508756d 100644
--- a/src/sys/sys.cc
+++ b/src/sys/sys.cc
@@ -25,17 +25,21 @@
namespace sys {
-bool mkdir(const char *path)
+void mkdir(const char *path)
{
#ifdef _WIN32
::mkdir(path);
- // FIXME check return value
return true;
#else
- return (::mkdir(path, 0777) == 0);
+ ::mkdir(path, 0777);
#endif
}
+void mkdir(const std::string &path)
+{
+ mkdir(path.c_str());
+}
+
void signal(int signum, signalfunc handler)
{
#ifndef _WIN32
diff --git a/src/sys/sys.h b/src/sys/sys.h
index 4769832..178fe60 100644
--- a/src/sys/sys.h
+++ b/src/sys/sys.h
@@ -9,6 +9,8 @@
#include "config.h"
+#include <string>
+
/// maximum line size throught the game
#define MAXCMDSIZE 1024
@@ -20,19 +22,24 @@ namespace sys
typedef void (* signalfunc)(int signum);
/// create a directory
-extern bool mkdir(const char *path);
+void mkdir(const char *path);
+
+void mkdir(const std::string &path);
+
/// intercept OS signals
-extern void signal(int signum, signalfunc handler);
-/// quit
-/** @param status return value
+void signal(int signum, signalfunc handler);
+
+/**
+ * @brief operation system exit() application
+ * @param status return value
*/
-extern void quit(int status);
+void quit(int status);
/// suspend process for a number of seconds
-extern void sleep(float seconds);
+void sleep(float seconds);
/// return the current system time of day, in seconds after midnight
-extern unsigned long time();
+unsigned long time();
}