File: console.h

package info (click to toggle)
freeciv 1.9.0-2.1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 11,004 kB
  • ctags: 6,284
  • sloc: ansic: 65,037; makefile: 634; sh: 418; sed: 93
file content (72 lines) | stat: -rw-r--r-- 2,736 bytes parent folder | download
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
/********************************************************************** 
 Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2, or (at your option)
   any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.
***********************************************************************/
#ifndef FC__CONSOLE_H
#define FC__CONSOLE_H

#include "attribute.h"

#define C_IGNORE -1		/* never print RFC-style number prefix */
#define C_COMMENT 0 		/* for human eyes only */
#define C_VERSION 1		/* version info */
#define C_DEBUG	2		/* debug info */
#define C_LOG_BASE 10		/* 10, 11, 12 depending on log level */
#define C_OK 100		/* success of requested operation */
#define C_CONNECTION 101	/* new client */
#define C_DISCONNECTED 102	/* client gone */
#define C_REJECTED 103		/* client rejected */
#define C_FAIL 200		/* failure of requested operation */ 
#define C_METAERROR 201		/* failure of meta server */
#define C_SYNTAX 300		/* syntax error or value out of range */
#define C_BOUNCE 301		/* option no longer available */
#define C_GENFAIL 400		/* failure not caused by a requested operation */
#define C_WARNING 500		/* something may be wrong */
#define C_READY 999		/* waiting for input */

/* initialize logging via console */
void con_log_init(char *log_message, int log_level);

/* write to console without line-break, don't print prompt */
int con_dump(int i, char *message, ...)
     fc__attribute((format (printf, 2, 3)));

/* write to console and add line-break, and show prompt if required. */
void con_write(int i, char *message, ...)
     fc__attribute((format (printf, 2, 3)));

/* write to console and add line-break, and show prompt if required.
   ie, same as con_write, but without the format string stuff. */
void con_puts(int i, char *str);
     
/* ensure timely update */
void con_flush(void);

/* make sure a prompt is printed, and re-printed after every message */
void con_prompt_on(void);

/* do not print a prompt after every message */
void con_prompt_off(void);

/* user pressed enter: will need a new prompt */
void con_prompt_enter(void);

/* set rfc-style */
void con_set_style(int i);

/* return rfc-style */
int con_get_style(void);

/* for rfc-specific information only */
void con_rfconly(int i, char *message, ...)
     fc__attribute((format (printf, 2, 3)));

#endif  /* FC__CONSOLE_H */