Debian Codegraph @

sndlib/ssl_lib.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 * $Source: $
21 * $Revision: 3 $
22 * $Author: Chris $
23 * $Date: 10/08/99 4:28p $
24 *
25 * This takes care of any code not exclusive to Win32 Ds3dlib.cpp but part of library
26 *
27 * $Log: /DescentIII/Main/dd_sndlib/ssl_lib.cpp $
28 *
29 * 3 10/08/99 4:28p Chris
30 * Added the forcefield and glass breaking override options
31 *
32 * 2 4/06/99 8:29p Samir
33 * added error check system.
34 *
35 * 1 4/06/99 8:16p Samir
36 * Initial rev.
37 *
38 */
39
40 #include <cstdarg>
41 #include <cstdio>
42 #include <cstring>
43
44 #include "ssl_lib.h"cxx . . $ `<file>/sndlib/ssl_lib.h`/
45
46 llsSystemcxx . . $ llsSystem#::llsSystemcxx . . $ llsSystem#llsSystem(49f6e7a06ebc5aa8).() {
47 m_lib_error_codecxx . . $ llsSystem#m_lib_error_code. = SSL_OKcxx . . $ `sndlib/ssl_lib.h:410:9`!;
48 m_geometrycxx . . $ llsSystem#m_geometry. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
49 }
50
51 void llsSystemcxx . . $ llsSystem#::CheckForErrorscxx . . $ llsSystem#CheckForErrors(49f6e7a06ebc5aa8).() {
52 // if a fatal error occurred, quit and display an error
53 // non fatal errors should be put inside a logfile, or just mprinted out.
54
55 strcpy(m_error_textcxx . . $ llsSystem#m_error_text., "Internal Sound Error: ");
56 m_lib_error_codecxx . . $ llsSystem#m_lib_error_code. = SSL_OKcxx . . $ `sndlib/ssl_lib.h:410:9`!;
57 }
58
59 void llsSystemcxx . . $ llsSystem#::ErrorTextcxx . . $ llsSystem#ErrorText(326aeb464d16410c).(const char *fmt, ...) {
60 stdcxx . . $ std/::va_listcxx . . $ std/va_list# arglist;
61 char buf[128];
62 int len, slen;
63
64 slen = strlen(m_error_textcxx . . $ llsSystem#m_error_text.);
65
66 if ((slen + 2) > sizeof(m_error_textcxx . . $ llsSystem#m_error_text.)) {
67 return;
68 }
69
70 strcat(m_error_textcxx . . $ llsSystem#m_error_text., "\n");
71 va_startcxx . . $ `<external>/8105065126723003039/stdarg.h:50:9`!(arglist, fmt);
72 len = stdcxx . . $ std/::vsnprintfcxx . . $ std/vsnprintf(348eb892742d8727).(buf, 128, fmt, arglist);
73 va_endcxx . . $ `<external>/8105065126723003039/stdarg.h:52:9`!(arglist);
74 if (len < 0)
75 return;
76
77 if ((slen + strlen(buf) + 1) > sizeof(m_error_textcxx . . $ llsSystem#m_error_text.)) {
78 return;
79 }
80 strcat(m_error_textcxx . . $ llsSystem#m_error_text., buf);
81 }