Actually call on_reset callback
[lsnes.git] / include / core / misc.hpp
blob2059db051347f33dbeddc7d14d5958919dd646c1
1 #ifndef _misc__hpp__included__
2 #define _misc__hpp__included__
4 #include <string>
5 #include <vector>
6 #include <stdexcept>
7 #include "library/string.hpp"
8 #include "library/memtracker.hpp"
10 /**
11 * \brief Fatal error.
13 * Fatal error.
15 void fatal_error() throw();
17 /**
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();
25 /**
26 * \brief Panic on OOM.
28 void OOM_panic();
31 uint32_t gcd(uint32_t a, uint32_t b) throw();
33 /**
34 * Return hexadecimal representation of address
36 std::string format_address(void* addr);
38 /**
39 * Get state of running global ctors flag.
41 bool in_global_ctors();
42 /**
43 * Clear the global ctors flag.
45 void reached_main();
47 /**
48 * Clean up filename from dangerous chars
50 std::string safe_filename(const std::string& str);
52 /**
53 * Mangle some characters ()|/
55 std::string mangle_name(const std::string& orig);
57 /**
58 * Return a new temporary file. The file will be created.
60 std::string get_temp_file();
62 #endif