]> git.jsancho.org Git - dungeon-master.git/blobdiff - src/paths.cpp
misc
[dungeon-master.git] / src / paths.cpp
index a1752328abcd5a736c76ad8f54e7b9397f6705df..02aee3f28264a1be1ceac9849dd5238ba6a676f2 100644 (file)
 #include <unistd.h>
 #include "paths.h"
 
-std::string get_exec_path()
+std::string get_exec_path ()
 {
   char pBuf[256];
-  size_t len = sizeof(pBuf);
+  size_t len = sizeof (pBuf);
   char szTmp[32];
 
-  sprintf(szTmp, "/proc/%d/exe", getpid());
-  int bytes = readlink(szTmp, pBuf, len);
+  sprintf (szTmp, "/proc/%d/exe", getpid ());
+  int bytes = readlink (szTmp, pBuf, len);
   if (bytes > len - 1)
     bytes = len - 1;
   if (bytes >= 0)
     pBuf[bytes] = '\0';
 
   std::string exec_path = pBuf;
-  return exec_path.substr(0, exec_path.rfind(PATH_DELIM) + 1);
+  return exec_path.substr (0, exec_path.rfind (PATH_DELIM) + 1);
 }
 
-std::string get_home_path()
+std::string get_home_path ()
 {
-  return (std::string)getenv("HOME") + PATH_DELIM + "." + PROGRAM_NAME;
+  return (std::string) getenv ("HOME") + PATH_DELIM + "." + PROGRAM_NAME;
 }
 
-std::set<std::string> get_data_paths() {
+std::set<std::string> get_dmaster_paths () {
   std::set<std::string> paths;
-  paths.insert(get_exec_path());
-  paths.insert(DATA_PATH);
-  paths.insert(get_home_path());
+  paths.insert (get_exec_path ());
+  paths.insert (DATA_PATH);
+  paths.insert (get_home_path ());
   return paths;
 }