Freeciv-3.2: /fast/freeciv/nightly/S3_2/server/console.h File Reference

Freeciv-3.2

Loading...
Searching...
No Matches
Macros | Enumerations | Functions
console.h File Reference
`#include "support.h"`

Go to the source code of this file.

## Macros

#define | MAX_LEN_CONSOLE_LINE 1024 /* closing '\0' included */

## Enumerations

enum

rfc_status {
C_IGNORE = -1 , C_COMMENT = 0 , C_VERSION = 1 , C_DEBUG = 2 ,
C_LOG_BASE = 10 , C_OK = 100 , C_CONNECTION = 101 , C_DISCONNECTED = 102 ,
C_REJECTED = 103 , C_FAIL = 200 , C_METAERROR = 201 , C_SYNTAX = 300 ,
C_BOUNCE = 301 , C_GENFAIL = 400 , C_WARNING = 500 , C_READY = 999
}

## Functions

void | con_log_init (const char *log_filename, enum log_level level, int fatal_assertions)
void | con_log_close (void)
void | con_write (enum rfc_status rfc_status, const char *message,...) fc__attribute((__format__(__printf__
void void | con_puts (enum rfc_status rfc_status, const char *str)
void | con_flush (void)
void | con_prompt_init (void)
void | con_prompt_on (void)
void | con_prompt_off (void)
void | con_prompt_enter (void)
void | con_prompt_enter_clear (void)
void | con_set_style (bool i)
bool | con_get_style (void)

## Macro Definition Documentation

## ◆ MAX_LEN_CONSOLE_LINE

#define MAX_LEN_CONSOLE_LINE 1024 /* closing '\0' included */

Definition at line 19 of file console.h.

## Enumeration Type Documentation

## ◆ rfc_status

enum rfc_status

Enumerator
C_IGNORE |
C_COMMENT |
C_VERSION |
C_DEBUG |
C_LOG_BASE |
C_OK |
C_CONNECTION |
C_DISCONNECTED |
C_REJECTED |
C_FAIL |
C_METAERROR |
C_SYNTAX |
C_BOUNCE |
C_GENFAIL |
C_WARNING |
C_READY |

Definition at line 35 of file console.h.

## Function Documentation

## ◆ con_flush()

void con_flush | ( | void |  | ) |

Ensure timely update.

Definition at line 243 of file console.c.

Referenced by con_update_prompt(), and srv_prepare().

## ◆ con_get_style()

bool con_get_style | ( | void |  | ) |

Returns rfc-style.

Definition at line 264 of file console.c.

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

## ◆ con_log_close()

void con_log_close | ( | void |  | ) |

Deinitialize logging

Definition at line 167 of file console.c.

Referenced by main(), and server_quit().

## ◆ con_log_init()

void con_log_init | ( | const char * | log_filename,
|  | enum log_level | level,
|  | int | fatal_assertions
| ) |  |

Initialize logging via console.

Definition at line 150 of file console.c.

Referenced by main(), and srv_prepare().

## ◆ con_prompt_enter()

void con_prompt_enter | ( | void |  | ) |

User pressed enter: will need a new prompt

Definition at line 303 of file console.c.

Referenced by server_sniff_all_input().

## ◆ con_prompt_enter_clear()

void con_prompt_enter_clear | ( | void |  | ) |

Clear "user pressed enter" state (used in special cases).

Definition at line 314 of file console.c.

Referenced by server_sniff_all_input().

## ◆ con_prompt_init()

void con_prompt_init | ( | void |  | ) |

Initialize prompt; display initial message.

Definition at line 272 of file console.c.

Referenced by server_sniff_all_input().

## ◆ con_prompt_off()

void con_prompt_off | ( | void |  | ) |

Do not print a prompt after log messages.

Definition at line 295 of file console.c.

Referenced by server_sniff_all_input().

## ◆ con_prompt_on()

void con_prompt_on | ( | void |  | ) |

Make sure a prompt is printed, and re-printed after every message.

Definition at line 286 of file console.c.

Referenced by server_sniff_all_input().

## ◆ con_puts()

void void con_puts | ( | enum 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 226 of file console.c.

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

## ◆ con_set_style()

void con_set_style | ( | bool | i | ) |

Set style.

Definition at line 251 of file console.c.

Referenced by handle_stdin_input_real().

## ◆ con_write()

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