diff options
Diffstat (limited to 'src/sys/sys.h')
-rw-r--r-- | src/sys/sys.h | 47 |
1 files changed, 31 insertions, 16 deletions
diff --git a/src/sys/sys.h b/src/sys/sys.h index 99c9291..575d02d 100644 --- a/src/sys/sys.h +++ b/src/sys/sys.h @@ -14,40 +14,55 @@ /// maximum line size throught the game #define MAXCMDSIZE 1024 -/// contains operating system dependent functions -/** sys is a core subsystem - */ +/** + * @brief platform dependent functions + * */ namespace sys { + +/** + * @brief type definition for a signal handler function pointer + * */ typedef void(* signalfunc)(int signum); -/// returns true if a path exists and it is a directory +/** + * @brief returns true if a path exists and is a directory + * */ bool directory_exists(const std::string &path); -/// returns true if a file exists +/** + * @brief returns true if a file exists + * */ bool file_exists(const std::string &filename); -/// create a directory +/** + * @brief create a directory + * */ void mkdir(const std::string &path); -/// intercept OS signals +/** + * @brief install an OS signal handler + * */ void signal(int signum, signalfunc handler); - /** * @brief operation system exit() application - * @param status return value */ void quit(int status); -/// suspend process for a number of seconds -void sleep(float seconds); +/** + * @brief suspend the current process for a number of milliseconds + * 1 second is 1000 milliseconds + * */ +void sleep(long milliseconds); + +/** + * @brief get the local system date and time + * */ +void get_localtime(int & hours, int & minutes, int & seconds); -/// return the current system time of day, in seconds after midnight -unsigned long time(); +void get_localtime(int &year, int & month, int & day, int & hours, int & minutes, int & seconds, int & milliseconds); -/// get the current system date and time -void get_datetime(int &year, int & month, int & day, int & hours, int & minutes, int &seconds); -} +} // namespace sys #include "sys/consoleinterface.h" |