Lines Matching refs:local

35 local lfs = require("lfs")
36 local unistd = require("posix.unistd")
38 local savesyscall = -1
39 local maxsyscall = -1
40 local generated_tag = "@" .. "generated"
44 local config = {
66 local config_modified = {}
67 local cleantmp = true
68 local tmpspace = "/tmp/sysent." .. unistd.getpid() .. "/"
70 local output_files = {
80 local temp_files = {
94 local files = {}
96 local function cleanup()
116 local function abort(status, msg)
126 local known_abi_flags = {
144 local known_flags = {
168 local compat_options = {
184 local function trim(s, char)
196 local function exec(cmd)
199 local shcmd = "/bin/sh -c \"" .. cmd .. "\""
200 local fh = io.popen(shcmd)
201 local output = fh:read("a")
210 local function process_config(file)
211 local cfg = {}
212 local comment_line_expr = "^%s*#.*"
218 local line_expr = "^([%w%p]+%s*)=(%s*[`\"]?[^\"`]+[`\"]?)"
224 local fh = io.open(file)
233 local key, value = nextline:match(line_expr)
235 local kvp = key .. "=" .. value
238 local delim = value:sub(1,1)
240 local trailing_context
296 local function grab_capenabled(file, open_fail_ok)
297 local capentries = {}
298 local commentExpr = "#.*"
305 local fh = io.open(file)
325 local function process_compat()
326 local nval = 0
336 local stdcompat = v["stdcompat"]
344 local tmpname = "sys" .. v["flag"]:lower()
345 local dcltmpname = tmpname .. "dcl"
359 local function process_abi_flags()
360 local flags, mask = config["abi_flags"], 0
372 local function abi_changes(name)
380 local function strip_abi_prefix(funcname)
381 local abiprefix = config["abi_func_prefix"]
382 local stripped_name
392 local function read_file(tmpfile)
398 local fh = files[tmpfile]
403 local function write_line(tmpfile, line)
411 local function write_line_pfile(tmppat, line)
419 local function isptrtype(type)
424 local process_syscall_def
427 local pattern_table = {
464 local incomplete = line:find("\\$") ~= nil
487 local function process_sysfile(file)
488 local capentries = {}
489 local commentExpr = "^%s*;.*"
496 local fh = io.open(file)
502 local function do_match(nextline, prevline)
503 local pattern, handler, dump
521 local prevline
539 local function get_mask(flags)
540 local mask = 0
552 local function get_mask_pat(pflags)
553 local mask = 0
563 local function align_sysent_comment(col)
572 local function strip_arg_annotations(arg)
578 local function check_abi_changes(arg)
580 local expr = v["expr"]
589 local function process_args(args)
590 local funcargs = {}
593 local abi_change = not isptrtype(arg) or check_abi_changes(arg)
597 local argname = arg:match("([^* ]+)$")
600 local argtype = trim(arg:gsub(argname .. "$", ""), nil)
608 local abi_type_suffix = config["abi_type_suffix"]
626 local function handle_noncompat(sysnum, thr_flag, flags, sysflags, rettype,
628 local argssize
654 local argtype, argname
704 local nargflags = get_mask({"NOARGS", "NOPROTO", "NODEF"})
710 local argname, argtype = v["name"], v["type"]
724 local protoflags = get_mask({"NOPROTO", "NODEF"})
745 local column = 8 + 2 + #argssize + 15
784 local function handle_obsol(sysnum, funcname, comment)
799 local function handle_compat(sysnum, thr_flag, flags, sysflags, rettype,
801 local argssize, out, outdcl, wrap, prefix, descr
827 local dprotoflags = get_mask({"NOPROTO", "NODEF"})
828 local nargflags = dprotoflags | known_flags["NOARGS"]
832 local argname, argtype = v["name"], v["type"]
875 local nosymflags = get_mask({"COMPAT", "COMPAT4", "COMPAT6"})
888 local function handle_unimpl(sysnum, sysstart, sysend, comment)
909 local sysstart, sysend, flags, funcname, sysflags
910 local thr_flag, syscallret
911 local orig = line
916 local initialExpr = "^([^%s]+)%s+([^%s]+)%s+([^%s]+)%s*"
917 local sysnum, auditev, allflags = line:match(initialExpr)
963 local decl_fnd = line:find("^{") ~= nil
968 local decl, alt
980 local funcalias, funcomment, argalias, rettype, args
988 local NF = 0
1008 local altExpr = "^([^%s]+)%s+([^%s]+)%s+([^%s]+)"
1055 local stripped_name = strip_abi_prefix(funcname)
1062 local funcargs = {}
1067 local argprefix = ''
1088 local mask = v["mask"]
1101 local ncompatflags = get_mask({"STD", "NODEF", "NOARGS", "NOPROTO",
1103 local compatflags = get_mask_pat("COMPAT.*")
1136 local sysfile, configfile = arg[1], arg[2]
1141 local res, msg = process_config(configfile)
1164 local capenabled = {}
1179 local tmpname = tmpspace .. v
1184 local tmpname = tmpspace .. v
1381 local target = config[v]
1383 local fh = io.open(target, "w+")