Skip to content

Commit 7b23ac5

Browse files
lnetoclaude
andcommitted
lunatik_core: trim verbose LDoc to concise descriptions
Remove boilerplate prose from module, _ENV, resume, stop, and runtime docblocks. Fix spaces-to-tab indent in lunatik_init. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent e85f86f commit 7b23ac5

1 file changed

Lines changed: 9 additions & 37 deletions

File tree

lunatik_core.c

Lines changed: 9 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,7 @@
44
*/
55

66
/***
7-
* Core Lunatik module.
8-
* Provides functionalities to create and manage Lunatik runtimes,
9-
* which are isolated Lua environments running within the Linux kernel.
10-
* This module exposes the `lunatik` global table in Lua, which can be
11-
* used to create new runtimes. Runtime objects themselves have methods
12-
* to control their execution (e.g., `resume`, `stop`).
13-
*
14-
* If a global Lunatik environment (`lunatik_env`) is configured at the C level,
15-
* it can be exposed to Lua scripts as `lunatik._ENV`. This allows for a shared
16-
* environment across multiple scripts or runtimes.
17-
*
7+
* Manages Lunatik runtimes — isolated Lua states running in the kernel.
188
* @module lunatik
199
*/
2010

@@ -30,9 +20,8 @@
3020
#include "lunatik_sym.h"
3121

3222
/***
33-
* Shared environment
34-
* @field _ENV points to a shared global Lunatik runtime object. Scripts can
35-
* share RCU tables or other Lunatik objects through this mechanism.
23+
* Shared global environment; scripts exchange objects (e.g. RCU tables) through it.
24+
* @field _ENV
3625
* @within lunatik
3726
*/
3827

@@ -143,18 +132,11 @@ static inline int lunatik_resume(lua_State *Lto, lua_State *Lfrom, int nargs)
143132
}
144133

145134
/***
146-
* Resumes a Lunatik runtime that has yielded.
147-
* This function is used to continue the execution of a Lua script within a
148-
* Lunatik runtime from the point where it last yielded. It's analogous to
149-
* Lua's `coroutine.resume`.
150-
* The `resume` method is called on a Lunatik runtime object.
135+
* Resumes a yielded runtime, analogous to `coroutine.resume`.
151136
* @function resume
152-
* @param ... Arguments to pass to the Lua script upon resumption. These arguments will be received by the `coroutine.yield()` call that suspended the script.
153-
* @treturn vararg Values returned by the `coroutine.yield()` call if the script yielded again, or values returned by the script if it completed.
154-
* @raise Error if the runtime cannot be resumed or if an error occurs within the resumed script. The error message will be propagated from the Lua C API error.
155-
* @usage
156-
* -- Assuming 'rt' is a Lunatik runtime object that has yielded.
157-
* local success, res_or_err = pcall(function() return rt:resume("arg_to_script") end)
137+
* @param ... values delivered to the script as return values of `coroutine.yield()`
138+
* @treturn vararg values passed to the next `coroutine.yield()`, or returned by the script
139+
* @raise if the runtime errors on resumption
158140
*/
159141
static int lunatik_lresume(lua_State *L)
160142
{
@@ -185,18 +167,8 @@ static const luaL_Reg lunatik_stub_lib[] = {
185167
};
186168

187169
/***
188-
* Stops and releases a Lunatik runtime environment.
189-
* This method is called on a Lunatik runtime object. Once stopped, the runtime
190-
* cannot be resumed or used further. It ensures that the associated Lua state
191-
* is closed and all kernel resources are freed.
192-
*
193-
* This method provides an explicit way to release the runtime.
170+
* Stops the runtime and releases all associated kernel resources.
194171
* @function stop
195-
* @treturn nil Does not return any value to Lua.
196-
* @raise Error May raise an error if the underlying C function encounters a critical issue during cleanup and calls `lua_error`.
197-
* @usage
198-
* -- Assuming 'rt' is a Lunatik runtime object:
199-
* rt:stop()
200172
*/
201173
static const luaL_Reg lunatik_mt[] = {
202174
{"__gc", lunatik_deleteobject},
@@ -330,7 +302,7 @@ LUNATIK_NEWLIB(lunatik_stub, lunatik_stub_lib, NULL, NULL);
330302

331303
static int __init lunatik_init(void)
332304
{
333-
return 0;
305+
return 0;
334306
}
335307

336308
static void __exit lunatik_exit(void)

0 commit comments

Comments
 (0)