-uint64_t
-thread_id ()
-{
- return (uint64_t) pthread_self ();
-}
-
-int
-avio_open_boost (AVIOContext** s, boost::filesystem::path file, int flags)
-{
- return avio_open (s, file.c_str(), flags);
-}
-
-
-boost::filesystem::path
-home_directory ()
-{
- 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 ()
-{
- /* I'm assuming nobody does this on Linux */
- return false;
-}
-
-