Debian Codegraph @

ddebug/lnxmono.cpp

raw symbols SCIP
1 /*
2 * Descent 3
3 * Copyright (C) 2024 Parallax Software
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
18 --- HISTORICAL COMMENTS FOLLOW ---
19
20 * $Logfile: /DescentIII/Main/linux/lnxmono.cpp $
21 * $Revision: 1.3 $
22 * $Date: 2004/02/23 03:03:48 $
23 * $Author: ryan $
24 *
25 * Linux monochrome routines
26 *
27 * $Log: lnxmono.cpp,v $
28 * Revision 1.3 2004/02/23 03:03:48 ryan
29 * Patched to compile with gcc3 and a modern linux distro...
30 *
31 * Revision 1.2 2000/05/29 05:39:59 icculus
32 * Changed some exit() calls to _exit().
33 *
34 * Revision 1.1.1.1 2000/04/18 00:00:39 icculus
35 * initial checkin
36 *
37 *
38 * 13 8/22/99 5:52a Jeff
39 * remote monochrome server code added
40 *
41 * 12 7/14/99 9:09p Jeff
42 * added comment header
43 *
44 * $NoKeywords: $
45 */
46
47 #include <cstdarg>
48 #include <cstdio>
49 #include <memory.h>
50
51 #include "debug.h"
52 #include "mono.h"
53
54 static char Mono_buffer[MAX_MONO_LENGTH];
55
56 void Debug_ConsolePrintf(int n, const char *format, ...) {
57 va_list marker;
58 va_start(marker, format);
59 std::vsnprintf(Mono_buffer, MAX_MONO_LENGTH, format, marker);
60 va_end(marker);
61
62 Debug_LogWrite(Mono_buffer);
63
64 if (n == 0) {
65 printf("%s", Mono_buffer);
66
67 int end = strlen(Mono_buffer) - 1;
68 if ((end > 1) && (Mono_buffer[end] != 0x0a) && (Mono_buffer[end] != 0x0d)) {
69 printf("\n");
70 Debug_LogWrite("\n");
71 }
72 }
73 }
74
75 void Debug_ConsolePrintfAt(int n, int row, int col, const char *format, ...) {}