1bootstrap(3)          User Contributed Perl Documentation         bootstrap(3)
2
3
4
5   Bootstrapping the Lua API interface
6       The file protos contains C prototypes for Lua routines which may throw
7       errors via "lua_error()".  The Perl interface code for these is
8       generated from templates. All other Perl interfaces are hand crafted.
9
10       Lua API routines which can throw errors have to be sandboxed so that
11       the Perl runtime environment isn't corrupted. This is done by creating
12       C wrappers designed to be invoked via Lua's protected call mechanism.
13       If the API routine throws and error it is caught and translated into a
14       Perl exception.
15
16       The wrappers are generated in two steps.
17
18       utils/pproto parses the C prototypes in protos and generates a YAML
19       database containing the parsed result (protos.yml).  It also adds any
20       "hints" to the contained in proto_hints.yml.
21
22       utils/genxs reads protos.yml, wrap_xs.tpl, and xs_xs.tpl and generates
23       wrap.h and xs.h, which are included by API.xs.  wrap_xs.tpl and
24       xs_xs.tpl are Template::Toolkit formatted code templates.  xs.h
25       contains the Perl XS interface code, wrap.h contains the C wrappers for
26       the Lua API routines.
27
28       At present the above scripts are invoked manually.
29
30
31
32perl v5.36.0                      2022-10-14                      bootstrap(3)
Impressum