Lines Matching +full:gen +full:- +full:2
2 --
3 -- SPDX-License-Identifier: BSD-2-Clause
4 --
5 -- Copyright (c) 2024 SRI International
6 -- Copyright (c) 2024 Tyler Baxter <agge@FreeBSD.org>
7 -- Copyright (c) 2023 Warner Losh <imp@bsdimp.com>
8 -- Copyright (c) 2019 Kyle Evans <kevans@FreeBSD.org>
9 --
11 -- Setup to be a module, or ran as its own script.
13 local script = not pcall(debug.getlocal, 4, 1) -- TRUE if script.
15 -- Add library root to the package path.
20 local FreeBSDSyscall = require("core.freebsd-syscall")
24 -- File has not been decided yet; config will decide file. Default defined as
25 -- /dev/null.
29 -- Grab the master system calls table.
37 -- Bind the generator to the parameter file.
38 local gen = generator:new({}, fh)
40 -- Write the generated preamble.
41 gen:preamble("Public system call stubs provided by libsys.\n" ..
45 gen:write(string.format([[
61 gen:write(string.format("struct %s;\n", name))
63 gen:write("union semun;\n")
65 gen:write("\n__BEGIN_DECLS\n")
69 gen:write(string.format(
75 gen:write("\n")
79 gen:write(string.format("%s __sys_%s(%s);\n",
84 gen:write("__END_DECLS\n")
85 -- End
86 gen:write("\n#endif /* __LIBSYS_H_ */\n")
89 -- Entry of script:
93 if #arg < 1 or #arg > 2 then
97 local sysfile, configfile = arg[1], arg[2]
102 -- The parsed syscall table.
105 libsys_h.file = config.libsys_h -- change file here
109 -- Return the module.