forked from raduprv/Eternal-Lands
-
Notifications
You must be signed in to change notification settings - Fork 3
/
console.h
86 lines (68 loc) · 2.11 KB
/
console.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
/*!
* \file
* \ingroup commands
* \brief console related commands
*/
#ifndef __CONSOLE_H__
#define __CONSOLE_H__
#include "text.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef DEF_INFO
#ifdef OTHER_LIFE
#define DEF_INFO "16"
#else
#define DEF_INFO ""
#endif
#endif
typedef struct {
char command[64];
int (*callback)();
} command_t;
extern char auto_open_encyclopedia; /*!< flag, that indicates whether the encyclopedia window should be opened automatically upon startup of the client */
extern int time_warn_h; /*!< How many minutes before the new hour to give a warning */
extern int time_warn_s; /*!< How many minutes before sunrise/sunset to give a warning */
extern int time_warn_d; /*!< How many minutes before the new day to give a warning */
/*!
* \brief Print the Eternal Lands version number
*
* Print the Eternal Lands version in string \a str.
*
* \param str the character buffer in which the string is placed
* \param len the size of the buffer
* \callgraph
*/
void print_version_string (char *buf, size_t len);
/*!
* \brief checks whether a console command is waiting and executes it if necessary.
*
* Checks whether a console command is waiting in the que and executes it if necessary.
*
* \param text The input line
* \param len the length of the input line
* \callgraph
*/
int test_for_console_command (char *text, int len);
void command_cleanup(void);
void add_command(const char *command, int (*callback)());
void add_name_to_tablist(const char *name);
void init_commands(const char *filename);
void add_line_to_history(const char *line, int len);
char *history_get_line_up(void);
char *history_get_line_down(void);
void history_reset(void);
void history_destroy(void);
void do_tab_complete(text_message *input);
void reset_tab_completer(void);
void auto_save_local_and_server(void);
int save_local_data(char * text, int len);
int command_time(char *text, int len);
int command_date(char *text, int len);
int command_mark(char *text, int len);
int command_unmark_special(char *text, int len, int do_log);
void new_minute_console(void);
#ifdef __cplusplus
} // extern "C"
#endif
#endif