Freeciv-3.1
Loading...
Searching...
No Matches
stdinhand.h
Go to the documentation of this file.
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
25void stdinhand_init(void);
26void stdinhand_turn(void);
27void stdinhand_free(void);
28
29void 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
33bool handle_stdin_input(struct connection *caller, char *str);
34bool handle_stdin_input_free(struct connection *caller, char *str);
35void set_ai_level_direct(struct player *pplayer, enum ai_level level);
36bool read_init_script(struct connection *caller, char *script_filename,
37 bool from_cmdline, bool check);
39void show_players(struct connection *caller);
40
42 const char *ai,
43 bool check,
44 struct nation_type *pnation,
45 struct player **newplayer,
46 char *buf, size_t buflen);
48 const char *ai,
49 bool check,
50 struct player **newplayer,
51 char *buf, size_t buflen);
52
53bool load_command(struct connection *caller,
54 const char *filename, bool check, bool cmdline_load);
55bool start_command(struct connection *caller, bool check, bool notify);
56
57void toggle_ai_player_direct(struct connection *caller,
58 struct player *pplayer);
59
60/* for sernet.c in initing a new connection */
61enum cmdlevel access_level_for_next_connection(void);
62
64
65bool conn_is_kicked(struct connection *pconn, int *time_remaining);
66
68
69#ifdef FREECIV_HAVE_LIBREADLINE
70char **freeciv_completion(const char *text, int start, int end);
71#endif
72
73#endif /* FC__STDINHAND_H */
#define str
Definition astring.c:76
command_id
Definition commands.h:34
rfc_status
Definition console.h:35
const char * name
Definition inputfile.c:127
struct setting_list * level[OLEVELS_NUM]
Definition settings.c:183
bool read_init_script(struct connection *caller, char *script_filename, bool from_cmdline, bool check)
Definition stdinhand.c:1167
void set_running_game_access_level(void)
Definition stdinhand.c:1633
void notify_if_first_access_level_is_available(void)
Definition stdinhand.c:1449
void stdinhand_turn(void)
Definition stdinhand.c:254
bool conn_is_kicked(struct connection *pconn, int *time_remaining)
Definition stdinhand.c:6210
enum rfc_status create_command_newcomer(const char *name, const char *ai, bool check, struct nation_type *pnation, struct player **newplayer, char *buf, size_t buflen)
Definition stdinhand.c:810
void cmd_reply(enum command_id cmd, struct connection *caller, enum rfc_status rfc_status, const char *format,...) fc__attribute((__format__(__printf__
void stdinhand_init(void)
Definition stdinhand.c:241
void show_players(struct connection *caller)
Definition stdinhand.c:6682
enum rfc_status create_command_pregame(const char *name, const char *ai, bool check, struct player **newplayer, char *buf, size_t buflen)
Definition stdinhand.c:994
enum cmdlevel access_level_for_next_connection(void)
Definition stdinhand.c:1435
bool handle_stdin_input_free(struct connection *caller, char *str)
Definition stdinhand.c:4370
void set_ai_level_direct(struct player *pplayer, enum ai_level level)
Definition stdinhand.c:2003
void stdinhand_free(void)
Definition stdinhand.c:262
bool load_command(struct connection *caller, const char *filename, bool check, bool cmdline_load)
Definition stdinhand.c:3733
bool start_command(struct connection *caller, bool check, bool notify)
Definition stdinhand.c:6044
struct strvec * get_init_script_choices(void)
Definition stdinhand.c:1268
void bool handle_stdin_input(struct connection *caller, char *str)
Definition stdinhand.c:4362
void toggle_ai_player_direct(struct connection *caller, struct player *pplayer)
Definition stdinhand.c:704
#define fc__attribute(x)
Definition support.h:89