diff options
author | Stijn Buys <ingar@osirion.org> | 2008-02-08 19:24:12 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2008-02-08 19:24:12 +0000 |
commit | d3477eedc113a2c126f36f41384b8921d610906a (patch) | |
tree | 68df921c4acf03878ae244db8350e2e96936c494 /src/sys | |
parent | 598dba9d17838e92f89bcd3ec78c69cc4ce50044 (diff) |
updated filesystem, removed inifile, updated game and tga loader
minor cleanups
Diffstat (limited to 'src/sys')
-rw-r--r-- | src/sys/sys.cc | 10 | ||||
-rw-r--r-- | src/sys/sys.h | 21 |
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(); } |