diff options
author | Hans Hagen <pragma@wxs.nl> | 2023-05-27 12:37:50 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg@phi-gamma.net> | 2023-05-27 12:37:50 +0200 |
commit | 32381f97e98465953bfde24b4436093e70fbe70f (patch) | |
tree | 1f585cf7af509e76c64aca108cecd23acd6fb437 /source/luametatex/source/lua/lmtcallbacklib.c | |
parent | bb8ae12f4f94189fd1540b201e2aea78f485de97 (diff) | |
download | context-32381f97e98465953bfde24b4436093e70fbe70f.tar.gz |
2023-05-27 12:16:00
Diffstat (limited to 'source/luametatex/source/lua/lmtcallbacklib.c')
-rw-r--r-- | source/luametatex/source/lua/lmtcallbacklib.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/source/luametatex/source/lua/lmtcallbacklib.c b/source/luametatex/source/lua/lmtcallbacklib.c index a971b5e57..ec9788c13 100644 --- a/source/luametatex/source/lua/lmtcallbacklib.c +++ b/source/luametatex/source/lua/lmtcallbacklib.c @@ -54,6 +54,7 @@ static const char *callbacklib_names[total_callbacks] = { "show_warning_message", "hpack_quality", "vpack_quality", + "show_break", "insert_par", "append_line_filter", "build_page_insert", @@ -307,7 +308,7 @@ static int callbacklib_aux_run(lua_State *L, int id, int special, const char *va return tex_formatted_error("callback", "string expected, not: %s\n", lua_typename(L, t)); } break; - case callback_result_key: + case callback_result_s_key: switch (t) { case LUA_TNIL: *va_arg(vl, int *) = 0; @@ -342,6 +343,16 @@ static int callbacklib_aux_run(lua_State *L, int id, int special, const char *va return tex_formatted_error("callback", "string, false or nil expected, not: %s\n", lua_typename(L, t)); } break; + case callback_result_i_key: + switch (t) { + case LUA_TNUMBER: + *va_arg(vl, int *) = lmt_tointeger(L, nres); + break; + default: + /* *va_arg(vl, int *) = 0; */ /*tex We keep the value! */ + break; + } + break; default: return tex_formatted_error("callback", "invalid value type returned\n"); } |