2013-02-12 17:32:31 -05:00
|
|
|
#ifndef __mpw_os_h__
|
|
|
|
#define __mpw_os_h__
|
|
|
|
|
|
|
|
#include <cstdint>
|
2013-02-16 13:32:47 -05:00
|
|
|
#include <string>
|
2013-02-17 23:00:28 -05:00
|
|
|
#include <ctime>
|
2013-02-12 17:32:31 -05:00
|
|
|
|
|
|
|
namespace OS
|
|
|
|
{
|
|
|
|
|
2013-02-24 23:22:31 -05:00
|
|
|
enum {
|
|
|
|
fsCurPerm = 0,
|
|
|
|
fsRdPerm = 1,
|
|
|
|
fsWrPerm = 2,
|
|
|
|
fsRdWrPerm = 3,
|
|
|
|
fsRdWrShPerm = 4,
|
|
|
|
};
|
|
|
|
|
|
|
|
enum {
|
|
|
|
fsAtMark = 0,
|
|
|
|
fsFromStart = 1,
|
|
|
|
fsFromLEOF = 2,
|
|
|
|
fsFromMark = 3,
|
|
|
|
};
|
|
|
|
|
2013-02-12 17:32:31 -05:00
|
|
|
|
|
|
|
|
2013-02-17 23:00:28 -05:00
|
|
|
bool Init();
|
|
|
|
|
2013-02-16 13:32:47 -05:00
|
|
|
bool IsTextFile(const std::string &s);
|
|
|
|
bool IsBinaryFile(const std::string &s);
|
|
|
|
|
2013-02-17 23:00:28 -05:00
|
|
|
time_t UnixToMac(time_t);
|
|
|
|
time_t MacToUnix(time_t);
|
|
|
|
|
2013-02-16 13:32:47 -05:00
|
|
|
|
2013-02-17 23:00:28 -05:00
|
|
|
#pragma mark FS Utilities
|
2013-02-25 17:34:25 -05:00
|
|
|
uint16_t Close(uint16_t trap);
|
2013-02-13 22:16:26 -05:00
|
|
|
uint16_t Create(uint16_t trap);
|
2013-02-13 22:38:34 -05:00
|
|
|
uint16_t Delete(uint16_t trap);
|
2013-03-27 00:00:47 -04:00
|
|
|
uint16_t FlushVol(uint16_t trap);
|
2013-02-13 22:16:26 -05:00
|
|
|
|
2013-02-12 17:32:31 -05:00
|
|
|
uint16_t GetFileInfo(uint16_t trap);
|
2013-05-23 21:44:36 -04:00
|
|
|
uint16_t HGetFileInfo(uint16_t trap);
|
2013-02-12 22:35:15 -05:00
|
|
|
uint16_t SetFileInfo(uint16_t trap);
|
2013-02-13 22:16:26 -05:00
|
|
|
|
2013-02-16 16:11:10 -05:00
|
|
|
uint16_t GetEOF(uint16_t trap);
|
2013-03-03 22:07:25 -05:00
|
|
|
uint16_t SetEOF(uint16_t trap);
|
|
|
|
|
2013-05-18 00:00:47 -04:00
|
|
|
uint16_t GetFPos(uint16_t trap);
|
2013-03-03 22:07:25 -05:00
|
|
|
uint16_t SetFPos(uint16_t trap);
|
|
|
|
|
2013-02-13 22:16:26 -05:00
|
|
|
uint16_t GetVol(uint16_t trap);
|
2013-05-17 20:14:30 -04:00
|
|
|
uint16_t HGetVol(uint16_t trap);
|
2013-02-17 18:08:39 -05:00
|
|
|
|
2013-05-23 21:42:06 -04:00
|
|
|
uint16_t SetVol(uint16_t trap);
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-02-24 23:22:31 -05:00
|
|
|
uint16_t Open(uint16_t trap);
|
2013-05-18 22:11:42 -04:00
|
|
|
uint16_t OpenRF(uint16_t trap);
|
2013-05-18 21:24:49 -04:00
|
|
|
uint16_t HOpen(uint16_t trap);
|
2013-02-24 23:22:31 -05:00
|
|
|
uint16_t Read(uint16_t trap);
|
2013-03-03 22:07:25 -05:00
|
|
|
uint16_t Write(uint16_t trap);
|
2013-02-24 23:22:31 -05:00
|
|
|
|
2013-02-17 23:00:28 -05:00
|
|
|
#pragma mark String Utilities
|
2013-02-17 18:08:39 -05:00
|
|
|
uint16_t CmpString(uint16_t trap);
|
|
|
|
|
2013-02-17 23:00:28 -05:00
|
|
|
|
|
|
|
#pragma mark - Time Utilities
|
|
|
|
uint16_t ReadDateTime(uint16_t trap);
|
|
|
|
uint16_t SecondsToDate(uint16_t trap);
|
2013-02-24 23:21:48 -05:00
|
|
|
uint16_t Pack6(uint16_t trap);
|
2013-02-17 23:00:28 -05:00
|
|
|
|
|
|
|
uint16_t TickCount(uint16_t trap);
|
|
|
|
|
2013-05-17 23:49:59 -04:00
|
|
|
uint16_t FSDispatch(uint16_t trap);
|
2013-03-02 17:39:54 -05:00
|
|
|
uint16_t HFSDispatch(uint16_t trap);
|
2013-02-24 23:22:31 -05:00
|
|
|
uint16_t HighLevelHFSDispatch(uint16_t trap);
|
2013-05-16 22:39:52 -04:00
|
|
|
|
|
|
|
#pragma mark - Trap Manager
|
|
|
|
|
|
|
|
uint16_t GetToolTrapAddress(uint16_t trap);
|
|
|
|
uint16_t GetOSTrapAddress(uint16_t trap);
|
2013-05-17 20:14:30 -04:00
|
|
|
|
|
|
|
#pragma mark - Alias Manager
|
|
|
|
|
|
|
|
uint16_t ResolveAliasFile();
|
|
|
|
uint16_t AliasDispatch(uint16_t trap);
|
|
|
|
|
2013-02-12 17:32:31 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|