Added snprintf/vsnprintf helpers to ISourceMod, finally (bug 3530, r=pred).
This commit is contained in:
+23
-1
@@ -43,7 +43,7 @@
|
||||
#include <time.h>
|
||||
|
||||
#define SMINTERFACE_SOURCEMOD_NAME "ISourceMod"
|
||||
#define SMINTERFACE_SOURCEMOD_VERSION 7
|
||||
#define SMINTERFACE_SOURCEMOD_VERSION 8
|
||||
|
||||
/**
|
||||
* @brief Forward declaration of the KeyValues class.
|
||||
@@ -248,6 +248,28 @@ namespace SourceMod
|
||||
* @param hook Hook function.
|
||||
*/
|
||||
virtual void RemoveGameFrameHook(GAME_FRAME_HOOK hook) =0;
|
||||
|
||||
/**
|
||||
* @brief Platform-safe wrapper around snprintf().
|
||||
*
|
||||
* @param buffer String buffer.
|
||||
* @param maxlength Maximum length of buffer.
|
||||
* @param fmt Format specifier string.
|
||||
* @param ... Format arguments.
|
||||
* @return Number of bytes (not including null terminator) written.
|
||||
*/
|
||||
virtual size_t Format(char *buffer, size_t maxlength, const char *fmt, ...) = 0;
|
||||
|
||||
/**
|
||||
* @brief Platform-safe wrapper around vsnprintf().
|
||||
*
|
||||
* @param buffer String buffer.
|
||||
* @param maxlength Maximum length of buffer.
|
||||
* @param fmt Format specifier string.
|
||||
* @param ap Format arguments.
|
||||
* @return Number of bytes (not including null terminator) written.
|
||||
*/
|
||||
virtual size_t FormatArgs(char *buffer, size_t maxlength, const char *fmt, va_list ap) = 0;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user