From c068f22329d5cc722622a2183bbb22eef2093df7 Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Mon, 24 Aug 2026 11:16:07 +0200 Subject: initial import --- src/parsec_server/sl_util_sv.cpp | 106 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100755 src/parsec_server/sl_util_sv.cpp (limited to 'src/parsec_server/sl_util_sv.cpp') diff --git a/src/parsec_server/sl_util_sv.cpp b/src/parsec_server/sl_util_sv.cpp new file mode 100755 index 0000000..4f15746 --- /dev/null +++ b/src/parsec_server/sl_util_sv.cpp @@ -0,0 +1,106 @@ +/* + * PARSEC - Utils Module + * + * $Author: uberlinuxguy $ - $Date: 2004/09/15 12:26:07 $ + * + * Orginally written by: + * Copyright (c) Markus Hadwiger 1998-2000 + * + * 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 of the License, 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. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +// C library includes +#include +#include +#include +#include +#include + +// compilation flags/debug support +#include "config.h" +#include "debug.h" + +// general definitions +#include "general.h" +#include "objstruc.h" + +// local module header +#include "sl_util_sv.h" +#include "utl_logfile.h" + + +// emulate missing or differently named c library functions ------------------- +// +int stricmp( const char *s1, const char *s2 ) +{ + return strcasecmp( s1, s2 ); +} + + +int strnicmp( const char *s1, const char *s2, int len ) +{ + return strncasecmp( s1, s2, len ); +} + + +char *strlwr( char *str ) +{ + for ( char *scan = str; *scan; scan++ ) { + *scan = tolower( *scan ); + } + + return str; +} + + +char *strupr( char *str ) +{ + for ( char *scan = str; *scan; scan++ ) { + *scan = toupper( *scan ); + } + + return str; +} + + +// cleanup function ----------------------------------------------------------- +// +void SYSs_CleanUp() +{ + // flush all logfiles + UTL_FlushRegisteredLogfiles(); +} + + +// signal handler to ensure correct termination of server --------------------- +// +void SignalHandler(int signum) +{ + SYSs_CleanUp(); +} + + +// install the signal handlers ------------------------------------------------ +// +void SYSs_InstallSignalHandlers() +{ + signal(SIGINT, SignalHandler ); + signal(SIGTERM, SignalHandler ); +} + + + + + -- cgit v1.2.3