mpw/toolbox/os.h

122 lines
2.4 KiB
C
Raw Normal View History

2013-02-12 22:32:31 +00:00
#ifndef __mpw_os_h__
#define __mpw_os_h__
#include <cstdint>
2013-02-16 18:32:47 +00:00
#include <string>
#include <ctime>
2013-02-12 22:32:31 +00:00
namespace OS
{
2013-02-25 04:22:31 +00:00
enum {
2014-12-20 14:14:31 +00:00
fsCurPerm = 0x00,
fsRdPerm = 0x01,
fsWrPerm = 0x02,
fsRdWrPerm = 0x03,
fsRdWrShPerm = 0x04,
fsRdDenyPerm = 0x10,
fsWrDenyPerm = 0x20
2013-02-25 04:22:31 +00:00
};
enum {
fsAtMark = 0,
fsFromStart = 1,
fsFromLEOF = 2,
fsFromMark = 3,
};
2013-02-12 22:32:31 +00:00
bool Init();
/*
2013-02-16 18:32:47 +00:00
bool IsTextFile(const std::string &s);
bool IsBinaryFile(const std::string &s);
*/
time_t UnixToMac(time_t);
time_t MacToUnix(time_t);
uint16_t OpenCommon(uint32_t parm, bool fsspec, bool resource);
2013-02-16 18:32:47 +00:00
#pragma mark FS Utilities
2013-02-25 22:34:25 +00:00
uint16_t Close(uint16_t trap);
2013-02-14 03:16:26 +00:00
uint16_t Create(uint16_t trap);
2013-02-14 03:38:34 +00:00
uint16_t Delete(uint16_t trap);
2013-03-27 04:00:47 +00:00
uint16_t FlushVol(uint16_t trap);
2013-02-12 22:32:31 +00:00
uint16_t GetFileInfo(uint16_t trap);
2013-05-24 01:44:36 +00:00
uint16_t HGetFileInfo(uint16_t trap);
2013-02-13 03:35:15 +00:00
uint16_t SetFileInfo(uint16_t trap);
2013-02-14 03:16:26 +00:00
2013-02-16 21:11:10 +00:00
uint16_t GetEOF(uint16_t trap);
2013-03-04 03:07:25 +00:00
uint16_t SetEOF(uint16_t trap);
2013-05-18 04:00:47 +00:00
uint16_t GetFPos(uint16_t trap);
2013-03-04 03:07:25 +00:00
uint16_t SetFPos(uint16_t trap);
2013-02-14 03:16:26 +00:00
uint16_t GetVol(uint16_t trap);
2013-05-18 00:14:30 +00:00
uint16_t HGetVol(uint16_t trap);
2015-01-06 01:11:10 +00:00
uint16_t HGetVInfo(uint16_t trap);
2013-05-24 01:42:06 +00:00
uint16_t SetVol(uint16_t trap);
uint16_t HSetVol(uint16_t trap);
2013-05-24 01:42:06 +00:00
2013-02-25 04:22:31 +00:00
uint16_t Open(uint16_t trap);
2013-05-19 02:11:42 +00:00
uint16_t OpenRF(uint16_t trap);
2013-02-25 04:22:31 +00:00
uint16_t Read(uint16_t trap);
2013-03-04 03:07:25 +00:00
uint16_t Write(uint16_t trap);
2013-02-25 04:22:31 +00:00
#pragma mark String Utilities
uint16_t CmpString(uint16_t trap);
#pragma mark - Time Utilities
uint16_t ReadDateTime(uint16_t trap);
uint16_t SecondsToDate(uint16_t trap);
2013-02-25 04:21:48 +00:00
uint16_t Pack6(uint16_t trap);
uint16_t TickCount(uint16_t trap);
uint16_t Microseconds(uint16_t trap);
2013-05-18 03:49:59 +00:00
uint16_t FSDispatch(uint16_t trap);
2013-03-02 22:39:54 +00:00
uint16_t HFSDispatch(uint16_t trap);
2013-02-25 04:22:31 +00:00
uint16_t HighLevelHFSDispatch(uint16_t trap);
#pragma mark - Trap Manager
uint16_t GetToolTrapAddress(uint16_t trap);
2013-08-04 18:34:34 +00:00
uint16_t SetToolTrapAddress(uint16_t trap);
uint16_t GetOSTrapAddress(uint16_t trap);
uint16_t SetOSTrapAddress(uint16_t trap);
2013-05-18 00:14:30 +00:00
#pragma mark - Alias Manager
uint16_t ResolveAliasFile();
uint16_t AliasDispatch(uint16_t trap);
2014-07-24 17:40:57 +00:00
#pragma mark - Gestalt Manager
uint16_t Gestalt(uint16_t trap);
2015-01-20 19:07:38 +00:00
uint16_t SysEnvirons(uint16_t trap);
2014-07-24 17:40:57 +00:00
2014-12-16 18:47:33 +00:00
#pragma mark - XP Ram
uint16_t ReadXPRam(uint16_t trap);
uint16_t WriteXPRam(uint16_t trap);
2014-12-18 19:29:20 +00:00
uint16_t InsTime(uint16_t trap);
uint16_t InsXTime(uint16_t trap);
uint16_t PrimeTime(uint16_t trap);
uint16_t RmvTime(uint16_t trap);
2015-01-23 15:26:40 +00:00
#pragma mark HWPriv
uint16_t HWPriv(uint16_t trap);
uint16_t FlushCodeCache(uint16_t trap);
2013-02-12 22:32:31 +00:00
}
#endif