Path: blob/main/sys/tools/syscalls/core/scret.lua
102292 views
--1-- SPDX-License-Identifier: BSD-2-Clause2--3-- Copyright (c) 2024 Tyler Baxter <[email protected]>4-- Copyright (c) 2023 Warner Losh <[email protected]>5-- Copyright (c) 2019 Kyle Evans <[email protected]>6--78local util = require("tools.util")910local scret = {}1112scret.__index = scret1314-- Processes this return type.15function scret:process()16local words = util.split(self.scret, "%S+")17self.scret = words[1]18-- Pointer incoming.19if words[2]:sub(1,1) == "*" then20self.scret = self.scret .. " "21end22while words[2]:sub(1,1) == "*" do23words[2] = words[2]:sub(2)24self.scret = self.scret .. "*"25end26end2728-- To add this return type to the system call.29function scret:add()30self:process()31return self.scret32end3334function scret:new(obj, line)35obj = obj or { }36setmetatable(obj, self)37self.__index = self3839self.scret = line4041return obj42end4344return scret454647