Haka
complete.h
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2  * License, v. 2.0. If a copy of the MPL was not distributed with this
3  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4 
5 #ifndef LUADEBUG_COMPLETE_H
6 #define LUADEBUG_COMPLETE_H
7 
8 #include <haka/types.h>
9 
10 
11 struct lua_State;
12 
13 struct luadebug_complete {
14  int stack_top;
15  int stack_env;
16  int state;
17  const char **keyword;
18  int index;
19  const char *token;
20  int operator;
21 };
22 
23 bool complete_push_table_context(struct lua_State *L, struct luadebug_complete *context,
24  const char *text);
25 
26 char *complete_table(struct lua_State *L, struct luadebug_complete *context,
27  const char *text, int state, bool (*hidden)(const char *text));
28 
29 char *complete_keyword(struct luadebug_complete *context, const char *keywords[],
30  const char *text, int state);
31 
32 bool complete_underscore_hidden(const char *text);
33 
34 typedef char *(*complete_callback)(struct lua_State *L, struct luadebug_complete *context,
35  const char *text, int state);
36 
37 char *complete_generator(struct lua_State *L, struct luadebug_complete *context,
38  const complete_callback callbacks[], const char *text, int state);
39 
40 char *complete_callback_lua_keyword(struct lua_State *L, struct luadebug_complete *context,
41  const char *text, int state);
42 char *complete_callback_table(struct lua_State *L, struct luadebug_complete *context,
43  const char *text, int state);
44 char *complete_callback_swig_get(struct lua_State *L, struct luadebug_complete *context,
45  const char *text, int state);
46 char *complete_callback_swig_fn(struct lua_State *L, struct luadebug_complete *context,
47  const char *text, int state);
48 char *complete_callback_global(struct lua_State *L, struct luadebug_complete *context,
49  const char *text, int state);
50 char *complete_callback_fenv(struct lua_State *L, struct luadebug_complete *context,
51  const char *text, int state);
52 
53 char *complete_addchar(const char *str, char c);
54 
55 #endif /* LUADEBUG_COMPLETE_H */