1 #ifndef _misc__hpp__included__
2 #define _misc__hpp__included__
7 #include "library/string.hpp"
8 #include "library/memtracker.hpp"
15 void fatal_error() throw();
18 * \brief Get path to config directory.
20 * \return The config directory path.
21 * \throw std::bad_alloc Not enough memory.
23 std::string
get_config_path() throw(std::bad_alloc
);
26 * \brief Panic on OOM.
31 uint32_t gcd(uint32_t a
, uint32_t b
) throw();
34 * Return hexadecimal representation of address
36 std::string
format_address(void* addr
);
39 * Get state of running global ctors flag.
41 bool in_global_ctors();
43 * Clear the global ctors flag.
48 * Clean up filename from dangerous chars
50 std::string
safe_filename(const std::string
& str
);
53 * Mangle some characters ()|/
55 std::string
mangle_name(const std::string
& orig
);
58 * Return a new temporary file. The file will be created.
60 std::string
get_temp_file();