1 #ifndef _misc__hpp__included__
2 #define _misc__hpp__included__
7 #include "library/string.hpp"
14 void fatal_error() throw();
17 * \brief Get path to config directory.
19 * \return The config directory path.
20 * \throw std::bad_alloc Not enough memory.
22 std::string
get_config_path() throw(std::bad_alloc
);
25 * \brief Panic on OOM.
30 uint32_t gcd(uint32_t a
, uint32_t b
) throw();
33 * Return hexadecimal representation of address
35 std::string
format_address(void* addr
);
38 * Get state of running global ctors flag.
40 bool in_global_ctors();
42 * Clear the global ctors flag.
47 * Clean up filename from dangerous chars
49 std::string
safe_filename(const std::string
& str
);
52 * Mangle some characters ()|/
54 std::string
mangle_name(const std::string
& orig
);
57 * Return a new temporary file. The file will be created.
59 std::string
get_temp_file();