Lines Matching +full:gen +full:- +full:2
2 --
3 -- SPDX-License-Identifier: BSD-2-Clause
4 --
5 -- Copyright (c) 2024 Tyler Baxter <agge@FreeBSD.org>
6 -- Copyright (c) 2023 Warner Losh <imp@bsdimp.com>
7 -- Copyright (c) 2019 Kyle Evans <kevans@FreeBSD.org>
8 --
10 -- Setup to be a module, or ran as its own script.
12 local script = not pcall(debug.getlocal, 4, 1) -- TRUE if script.
14 -- Add library root to the package path.
19 local FreeBSDSyscall = require("core.freebsd-syscall")
22 -- File has not been decided yet; config will decide file. Default defined as
23 -- /dev/null.
27 -- Grab the master system calls table.
30 -- Bind the generator to the parameter file.
31 local gen = generator:new({}, fh)
33 -- Write the generated preamble.
34 gen:preamble("System call names.")
36 gen:write(string.format("const char *%s[] = {\n", config.namesname))
39 --print("num " .. v.num .. " name " .. v.name)
42 gen:write(v.prolog);
45 gen:write(string.format([[
50 -- Lookup the info for this specific compat option.
61 gen:write(string.format([[
67 gen:write(string.format([[
73 gen:write(string.format([[
79 gen:write(string.format([[
86 gen:write(tbl.epilog)
87 -- End
88 gen:write("};\n")
91 -- Entry of script:
95 if #arg < 1 or #arg > 2 then
99 local sysfile, configfile = arg[1], arg[2]
104 -- The parsed syscall table.
107 syscalls.file = config.sysnames -- change file here
111 -- Return the module.