Haka
user.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_USER_H
6 #define LUADEBUG_USER_H
7 
8 #include <haka/types.h>
9 #include <haka/thread.h>
10 
11 typedef char *generator_callback(const char *text, int state);
12 
13 struct luadebug_user {
14  atomic_t refcount;
15  generator_callback *(*completion)(const char *line, int start);
16 
17  /* User functions */
18  bool (*start)(struct luadebug_user *data, const char *name);
19  char *(*readline)(struct luadebug_user *data, const char *prompt);
20  void (*addhistory)(struct luadebug_user *data, const char *line);
21  bool (*stop)(struct luadebug_user *data);
22  void (*print)(struct luadebug_user *data, const char *format, ...);
23  bool (*check)(struct luadebug_user *data);
24  void (*destroy)(struct luadebug_user *data);
25 };
26 
27 void luadebug_user_init(struct luadebug_user *user);
28 void luadebug_user_addref(struct luadebug_user *user);
29 void luadebug_user_release(struct luadebug_user **user);
30 
31 struct luadebug_user *luadebug_user_readline();
32 
33 struct luadebug_user *luadebug_user_remote(int fd);
34 void luadebug_user_remote_server(int fd, struct luadebug_user *user);
35 
36 #endif /* LUADEBUG_USER_H */
unsigned char bool
Definition: types.h:17
volatile uint32 atomic_t
Definition: thread.h:267