Freeciv21
Develop your civilization from humble roots to a global empire
console.cpp File Reference
#include <fc_config.h>
#include <cstdarg>
#include <cstdio>
#include "fcbacktrace.h"
#include "fciconv.h"
#include "fcintl.h"
#include "log.h"
#include "support.h"
#include <readline/readline.h>
#include "game.h"
#include "console.h"
#include "notify.h"
+ Include dependency graph for console.cpp:

Go to the source code of this file.

Functions

static void con_update_prompt ()
 Print the prompt if it is not the last thing printed. More...
 
void con_log_init (const QString &log_filename)
 Initialize logging via console. More...
 
void con_log_close ()
 Deinitialize logging. More...
 
void con_set_color (const char *col)
 
void con_write (enum rfc_status rfc_status, const char *message,...)
 Write to console and add line-break, and show prompt if required. More...
 
void con_puts (enum rfc_status rfc_status, const char *str)
 Write to console and add line-break, and show prompt if required. More...
 
void con_flush ()
 Ensure timely update. More...
 
void con_set_style (bool i)
 Set style. More...
 
bool con_get_style ()
 Returns rfc-style. More...
 
void con_prompt_init ()
 Initialize prompt; display initial message. More...
 
void con_prompt_off ()
 Do not print a prompt after log messages. More...
 
void con_prompt_enter ()
 User pressed enter: will need a new prompt. More...
 

Variables

static bool console_show_prompt = false
 
static bool console_prompt_is_showing = false
 
static bool console_rfcstyle = false
 
static bool readline_received_enter = true
 

Function Documentation

◆ con_flush()

void con_flush ( )

Ensure timely update.

Definition at line 183 of file console.cpp.

Referenced by metaserver_failed().

◆ con_get_style()

bool con_get_style ( )

Returns rfc-style.

Definition at line 201 of file console.cpp.

Referenced by handle_stdin_input_real(), show_help_command_list(), and show_help_option_list().

◆ con_log_close()

void con_log_close ( )

Deinitialize logging.

Definition at line 123 of file console.cpp.

Referenced by main(), and server_quit().

◆ con_log_init()

void con_log_init ( const QString &  log_filename)

Initialize logging via console.

Definition at line 111 of file console.cpp.

Referenced by main().

◆ con_prompt_enter()

void con_prompt_enter ( )

User pressed enter: will need a new prompt.

Definition at line 225 of file console.cpp.

◆ con_prompt_init()

void con_prompt_init ( )

Initialize prompt; display initial message.

Definition at line 206 of file console.cpp.

Referenced by freeciv::server::server().

◆ con_prompt_off()

void con_prompt_off ( )

Do not print a prompt after log messages.

Definition at line 220 of file console.cpp.

Referenced by freeciv::server::pulse().

◆ con_puts()

void con_puts ( enum rfc_status rfc_status rfc_status  ,
const char *  str 
)

Write to console and add line-break, and show prompt if required.

Same as con_write, but without the format string stuff. The real reason for this is because attribute complained with con_write(C_COMMENT,"") of "warning: zero-length format string"; this allows con_puts(C_COMMENT,"");

Definition at line 162 of file console.cpp.

Referenced by con_prompt_init(), con_set_style(), con_write(), metaserver_failed(), and start_game().

◆ con_set_color()

void con_set_color ( const char *  col)

Definition at line 130 of file console.cpp.

Referenced by con_puts().

◆ con_set_style()

void con_set_style ( bool  i)

Set style.

Definition at line 188 of file console.cpp.

Referenced by handle_stdin_input_real().

◆ con_update_prompt()

static void con_update_prompt ( )
static

Print the prompt if it is not the last thing printed.

Definition at line 81 of file console.cpp.

Referenced by con_puts(), and con_set_color().

◆ con_write()

void con_write ( enum rfc_status rfc_status  ,
const char *  message,
  ... 
)

Write to console and add line-break, and show prompt if required.

Definition at line 139 of file console.cpp.

Referenced by chat_msg_to_all(), cmd_reply_line(), handle_stdin_input_real(), main(), save_thread_run(), and set_command().

Variable Documentation

◆ console_prompt_is_showing

bool console_prompt_is_showing = false
static

Definition at line 36 of file console.cpp.

Referenced by con_prompt_enter(), con_puts(), con_set_color(), and con_update_prompt().

◆ console_rfcstyle

bool console_rfcstyle = false
static

Definition at line 37 of file console.cpp.

Referenced by con_get_style(), con_puts(), and con_set_style().

◆ console_show_prompt

bool console_show_prompt = false
static

Definition at line 35 of file console.cpp.

Referenced by con_prompt_off(), and con_update_prompt().

◆ readline_received_enter

bool readline_received_enter = true
static

Definition at line 38 of file console.cpp.

Referenced by con_prompt_enter(), and con_update_prompt().