lmttokenlib.h /size: 1658 b    last modification: 2024-01-16 10:22
1/*
2    See license.txt in the root of this project.
3*/
4
5# ifndef LMT_LTOKENLIB_H
6# define LMT_LTOKENLIB_H
7
8typedef enum token_origins {
9    token_origin_lua,
10    token_origin_tex,
11} token_origins;
12
13typedef struct lua_token {
14    int           token;
15    token_origins origin;
16} lua_token;
17
18typedef enum command_item_types {
19    unused_command_item,
20    regular_command_item,
21    character_command_item,
22    register_command_item,
23    internal_command_item,
24    reference_command_item,
25    data_command_item,
26    token_command_item,
27    node_command_item,
28} command_item_types;
29
30extern void     lmt_token_list_to_lua         (lua_State *L, halfword p);
31extern void     lmt_token_list_to_luastring   (lua_State *L, halfword p, int nospace, int strip, int wipe);
32extern halfword lmt_token_list_from_lua       (lua_State *L, int slot);
33extern halfword lmt_token_code_from_lua       (lua_State *L, int slot);
34
35extern void     lmt_function_call             (int slot, int prefix);
36extern int      lmt_function_call_by_category (int slot, int property, halfword *value);
37extern void     lmt_token_call                (int p);
38extern void     lmt_local_call                (int slot);
39
40extern char    *lmt_get_expansion             (halfword head, int *len);
41
42extern void     lmt_token_register_to_lua     (lua_State *L, halfword t, int originals);
43
44extern void     lmt_tokenlib_initialize       (void);
45
46extern int      lmt_push_specification        (lua_State *L, halfword ptr, int onlycount);
47
48extern void     lmt_push_cmd_name             (lua_State *L, int cmd);
49
50extern halfword lmt_macro_to_tok              (lua_State* L, int slot, halfword *tail);
51
52# endif
53