extern uint64_t thread_id ();
extern int avio_open_boost (AVIOContext** s, boost::filesystem::path file, int flags);
extern boost::filesystem::path home_directory ();
-extern std::string command_and_read (std::string cmd);
extern bool running_32_on_64 ();
extern void unprivileged ();
extern boost::filesystem::path config_path ();
return getenv("HOME");
}
-string
-command_and_read (string cmd)
-{
- FILE* pipe = popen (cmd.c_str(), "r");
- if (!pipe) {
- throw runtime_error ("popen failed");
- }
-
- string result;
- char buffer[128];
- try {
- while (fgets(buffer, sizeof(buffer), pipe)) {
- result += buffer;
- }
- } catch (...) {
- pclose (pipe);
- throw;
- }
-
- pclose (pipe);
- return result;
-}
-
/** @return true if this process is a 32-bit one running on a 64-bit-capable OS */
bool
running_32_on_64 ()
return getenv("HOME");
}
-string
-command_and_read (string)
-{
- return "";
-}
-
/** @return true if this process is a 32-bit one running on a 64-bit-capable OS */
bool
running_32_on_64 ()
return boost::filesystem::path(getenv("HOMEDRIVE")) / boost::filesystem::path(getenv("HOMEPATH"));
}
-string
-command_and_read (string)
-{
- return "";
-}
-
/** @return true if this process is a 32-bit one running on a 64-bit-capable OS */
bool
running_32_on_64 ()