mpw/toolbox/toolbox.h

41 lines
758 B
C
Raw Normal View History

2013-02-06 23:44:12 -05:00
#ifndef __mpw_toolbox_h__
#define __mpw_toolbox_h__
2013-02-12 22:35:15 -05:00
#include <string>
2013-02-16 18:51:28 -05:00
#include <cstdint>
#include <cstdio>
2013-02-07 19:21:47 -05:00
namespace ToolBox
{
2013-02-16 18:51:28 -05:00
extern bool Trace;
template<typename... Args>
inline void Log(const char *format, Args... args)
{
if (Trace) fprintf(stderr, format, args...);
}
2013-03-27 23:54:47 -04:00
inline void Log(const char *format)
{
if (Trace) fputs(format, stderr);
}
2013-02-16 18:51:28 -05:00
2013-02-07 19:21:47 -05:00
void dispatch(uint16_t trap);
2013-02-12 22:35:15 -05:00
std::string ReadCString(uint32_t address, bool fname = false);
std::string ReadPString(uint32_t address, bool fname = false);
std::string ReadString(uint32_t address, uint32_t length);
2013-02-13 22:16:05 -05:00
bool WritePString(uint32_t address, const std::string &s);
2013-03-06 19:17:55 -05:00
std::string UnixToMac(const std::string &path);
std::string MacToUnix(const std::string &path);
2013-02-07 19:21:47 -05:00
}
2013-02-06 23:44:12 -05:00
#endif