ScummVM API documentation
textconsole.h
1/* ScummVM - Graphic Adventure Engine
2 *
3 * ScummVM is the legal property of its developers, whose names
4 * are too numerous to list here. Please refer to the COPYRIGHT
5 * file distributed with this source distribution.
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 *
20 */
21
22#ifndef COMMON_CONSOLE_H
23#define COMMON_CONSOLE_H
24
25#ifdef FORCE_TEXT_CONSOLE
26#undef DISABLE_TEXT_CONSOLE
27#endif
28
29#include "common/scummsys.h"
30
31namespace Common {
32
50typedef void (*OutputFormatter)(char *dst, const char *src, size_t dstSize);
51
56
57
64typedef bool (*ErrorHandler)(const char *msg);
65
74
77} // End of namespace Common
78
87void NORETURN_PRE error(MSVC_PRINTF const char *s, ...) GCC_PRINTF(1, 2) NORETURN_POST;
88
89#ifdef DISABLE_TEXT_CONSOLE
90
91static inline void GCC_PRINTF(1, 2) warning(MSVC_PRINTF const char *s, ...) {}
92
93#else
94
101void warning(MSVC_PRINTF const char *s, ...) GCC_PRINTF(1, 2);
102
103#endif
113#define scumm_assert(expr) \
114 if (expr) {} \
115 else \
116 error("Assertion \"%s\" failed: file \"%s\", line %d", #expr, __FILE__, __LINE__)
117
118#endif
int FORCEINLINE GCC_PRINTF(2, 0) int vsprintf_s(T(&dst)[N]
void setErrorOutputFormatter(OutputFormatter f)
void(* OutputFormatter)(char *dst, const char *src, size_t dstSize)
Definition: textconsole.h:50
void NORETURN_PRE error(MSVC_PRINTF const char *s,...) GCC_PRINTF(1
void warning(MSVC_PRINTF const char *s,...) GCC_PRINTF(1
void setErrorHandler(ErrorHandler handler)
bool(* ErrorHandler)(const char *msg)
Definition: textconsole.h:64
Definition: algorithm.h:29