diff options
author | Hans Hagen <pragma@wxs.nl> | 2022-09-16 15:53:42 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg@phi-gamma.net> | 2022-09-16 15:53:42 +0200 |
commit | c161b7d6fe142231346cc1844e6e27c0ab7718c1 (patch) | |
tree | 3fd877b8986137703e987e4651a2db8e946a0f72 /source/luametatex/source/lua/lmttokenlib.h | |
parent | e94fa4dc30ec28a6727aa85e17aaac18b76aeadb (diff) | |
download | context-c161b7d6fe142231346cc1844e6e27c0ab7718c1.tar.gz |
2022-09-16 14:41:00
Diffstat (limited to 'source/luametatex/source/lua/lmttokenlib.h')
-rw-r--r-- | source/luametatex/source/lua/lmttokenlib.h | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/source/luametatex/source/lua/lmttokenlib.h b/source/luametatex/source/lua/lmttokenlib.h new file mode 100644 index 000000000..5339a80fe --- /dev/null +++ b/source/luametatex/source/lua/lmttokenlib.h @@ -0,0 +1,52 @@ +/* + See license.txt in the root of this project. +*/ + +# ifndef LMT_LTOKENLIB_H +# define LMT_LTOKENLIB_H + +typedef enum token_origins { + token_origin_lua, + token_origin_tex, +} token_origins; + +typedef struct lua_token { + int token; + token_origins origin; +} lua_token; + +typedef enum command_item_types { + unused_command_item, + regular_command_item, + character_command_item, + register_command_item, + internal_command_item, + reference_command_item, + data_command_item, + token_command_item, + node_command_item, +} command_item_types; + +extern void lmt_token_list_to_lua (lua_State *L, halfword p); +extern void lmt_token_list_to_luastring (lua_State *L, halfword p, int nospace, int strip); +extern halfword lmt_token_list_from_lua (lua_State *L, int slot); +extern halfword lmt_token_code_from_lua (lua_State *L, int slot); + +extern void lmt_function_call (int slot, int prefix); +extern int lmt_function_call_by_class (int slot, int property, halfword *value); +extern void lmt_token_call (int p); +extern void lmt_local_call (int slot); + +extern char *lmt_get_expansion (halfword head, int *len); + +extern void lmt_token_register_to_lua (lua_State *L, halfword t); + +extern void lmt_tokenlib_initialize (void); + +extern int lmt_push_specification (lua_State *L, halfword ptr, int onlycount); + +extern void lmt_push_cmd_name (lua_State *L, int cmd); + +extern halfword lmt_macro_to_tok (lua_State* L, int slot, halfword *tail); + +# endif |