stub_plugin/sdk_util.cpp
author Scott Ehlert <ds@alliedmods.net>
Thu Sep 26 17:00:32 2013 -0500 (2013-09-26)
changeset 284 ca90ccdb8d49
parent 265 9e61d0d70e9a
permissions -rw-r--r--
Fixed makefile error when issuing 'make clean' or 'make distclean'.
     1 // vi: set ts=4 sw=4 :
     2 // vim: set tw=75 :
     3 
     4 // Selected portions of dlls/util.cpp from SDK 2.1.
     5 // Functions copied from there as needed...
     6 // And modified to avoid buffer overflows (argh).
     7 
     8 /***
     9 *
    10 *	Copyright (c) 1999, 2000 Valve LLC. All rights reserved.
    11 *	
    12 *	This product contains software technology licensed from Id 
    13 *	Software, Inc. ("Id Technology").  Id Technology (c) 1996 Id Software, Inc. 
    14 *	All Rights Reserved.
    15 *
    16 *   Use, distribution, and modification of this source code and/or resulting
    17 *   object code is restricted to non-commercial enhancements to products from
    18 *   Valve LLC.  All other use, distribution, or modification is prohibited
    19 *   without written permission from Valve LLC.
    20 *
    21 ****/
    22 /*
    23 
    24 ===== util.cpp ========================================================
    25 
    26   Utility code.  Really not optional after all.
    27 
    28 */
    29 
    30 #include <extdll.h>
    31 #include <enginecallback.h>		// ALERT()
    32 
    33 #include "osdep.h"				// win32 vsnprintf, etc
    34 
    35 //=========================================================
    36 // UTIL_LogPrintf - Prints a logged message to console.
    37 // Preceded by LOG: ( timestamp ) < message >
    38 //=========================================================
    39 void UTIL_LogPrintf( const char *fmt, ... )
    40 {
    41 	va_list			argptr;
    42 	static char		string[1024];
    43 	
    44 	va_start ( argptr, fmt );
    45 	vsnprintf ( string, sizeof(string), fmt, argptr );
    46 	va_end   ( argptr );
    47 
    48 	// Print to server console
    49 	ALERT( at_logged, "%s", string );
    50 }