1 /***********************************************************************
2  Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
3    This program is free software; you can redistribute it and/or modify
4    it under the terms of the GNU General Public License as published by
5    the Free Software Foundation; either version 2, or (at your option)
6    any later version.
7 
8    This program is distributed in the hope that it will be useful,
9    but WITHOUT ANY WARRANTY; without even the implied warranty of
10    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11    GNU General Public License for more details.
12 ***********************************************************************/
13 #ifndef FC__STDINHAND_H
14 #define FC__STDINHAND_H
15 
16 /* common */
17 #include "chat.h"               /* SERVER_COMMAND_PREFIX */
18 #include "connection.h"         /* enum cmdlevel */
19 #include "fc_types.h"
20 
21 /* server */
22 #include "commands.h"
23 #include "console.h"
24 
25 void stdinhand_init(void);
26 void stdinhand_turn(void);
27 void stdinhand_free(void);
28 
29 void cmd_reply(enum command_id cmd, struct connection *caller,
30                enum rfc_status rfc_status, const char *format, ...)
31                fc__attribute((__format__ (__printf__, 4, 5)));
32 
33 bool handle_stdin_input(struct connection *caller, char *str);
34 void set_ai_level_direct(struct player *pplayer, enum ai_level level);
35 bool read_init_script(struct connection *caller, char *script_filename,
36                       bool from_cmdline, bool check);
37 struct strvec *get_init_script_choices(void);
38 void show_players(struct connection *caller);
39 
40 enum rfc_status create_command_newcomer(const char *name,
41                                         const char *ai,
42                                         bool check,
43                                         struct nation_type *pnation,
44                                         struct player **newplayer,
45                                         char *buf, size_t buflen);
46 enum rfc_status create_command_pregame(const char *name,
47                                        const char *ai,
48                                        bool check,
49                                        struct player **newplayer,
50                                        char *buf, size_t buflen);
51 
52 bool load_command(struct connection *caller,
53                   const char *filename, bool check, bool cmdline_load);
54 bool start_command(struct connection *caller, bool check, bool notify);
55 
56 void toggle_ai_player_direct(struct connection *caller,
57                              struct player *pplayer);
58 
59 /* for sernet.c in initing a new connection */
60 enum cmdlevel access_level_for_next_connection(void);
61 
62 void notify_if_first_access_level_is_available(void);
63 
64 bool conn_is_kicked(struct connection *pconn, int *time_remaining);
65 
66 void set_running_game_access_level(void);
67 
68 #ifdef FREECIV_HAVE_LIBREADLINE
69 char **freeciv_completion(const char *text, int start, int end);
70 #endif
71 
72 #endif /* FC__STDINHAND_H */
73