public/mms_sample_ext/stub_util.h
author David Anderson <dvander@alliedmods.net>
Wed Feb 25 20:07:12 2009 -0500 (2009-02-25)
changeset 2607 f3b8bbe17f85
parent 1990 de135d1f05b1
permissions -rw-r--r--
Backed out changeset fa286305bd3f
     1 /**
     2  * vim: set ts=4 :
     3  * ======================================================
     4  * Metamod:Source Stub Plugin
     5  * Written by AlliedModders LLC.
     6  * ======================================================
     7  *
     8  * This software is provided 'as-is', without any express or implied warranty.
     9  * In no event will the authors be held liable for any damages arising from 
    10  * the use of this software.
    11  *
    12  * This stub plugin is public domain.
    13  *
    14  * Version: $Id$
    15  */
    16 
    17 #ifndef _INCLUDE_STUB_UTIL_FUNCTIONS_H_
    18 #define _INCLUDE_STUB_UTIL_FUNCTIONS_H_
    19 
    20 #include <stddef.h>
    21 
    22 /**
    23  * This is a platform-safe function which fixes weird idiosyncracies 
    24  * in the null-termination and return value of snprintf().  It guarantees 
    25  * the terminator on overflow cases, and never returns -1 or a value 
    26  * not equal to the number of non-terminating bytes written.
    27  */
    28 size_t UTIL_Format(char *buffer, size_t maxlength, const char *fmt, ...);
    29 
    30 #endif //_INCLUDE_STUB_UTIL_FUNCTIONS_H_
    31