From a97d8b08fe32d870f9557da556ff5c28538940c2 Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Mon, 2 Sep 2013 19:57:55 -0400 Subject: [PATCH] get/set tabs --- mpw/mpw_access.cpp | 37 +++++++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/mpw/mpw_access.cpp b/mpw/mpw_access.cpp index 1a981e5..4f9593c 100644 --- a/mpw/mpw_access.cpp +++ b/mpw/mpw_access.cpp @@ -61,6 +61,38 @@ namespace MPW { + uint32_t ftrap_get_tab_info(uint32_t name, uint32_t parm) + { + // get_tab_info(const char *name, uint32_t *tabSize) + + // hard code for now. + // Could check xattr for actual value. + // That would be rather pointless unless some editor respected + // it. + // Could check an environment variable. + + std::string sname = ToolBox::ReadCString(name, true); + + Log(" get_tab_info(%s)\n", sname.c_str()); + + + if (parm) memoryWriteLong(8, parm); + return 0; + } + + uint32_t ftrap_set_tab_info(uint32_t name, uint32_t parm) + { + // set_tab_info(const char *name, uint32_t tabSize) + + std::string sname = ToolBox::ReadCString(name, true); + uint32_t tabSize = parm; + + Log(" set_tab_info(%s, %04x)\n", sname.c_str(), tabSize); + + // setxattr? + return 0x40000000 | kEINVAL; + } + uint32_t ftrap_delete(uint32_t name) { @@ -193,10 +225,11 @@ namespace MPW break; case kF_GTABINFO: - d0 = 0x40000000 | kEINVAL; + d0 = ftrap_get_tab_info(name, parm); break; + case kF_STABINFO: - d0 = 0x40000000 | kEINVAL; + d0 = ftrap_set_tab_info(name, parm); break; default: