本文整理汇总了C++中Q_vsnprintfz函数的典型用法代码示例。如果您正苦于以下问题:C++ Q_vsnprintfz函数的具体用法?C++ Q_vsnprintfz怎么用?C++ Q_vsnprintfz使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Q_vsnprintfz函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TV_Downstream_SendServerCommand
/*
* TV_Downstream_SendServerCommand
*
* Sends a reliable command string to be interpreted by
* the client: "cs", "changing", "disconnect", etc
* A NULL client will broadcast to all clients
*/
void TV_Downstream_SendServerCommand( client_t *cl, const char *format, ... )
{
va_list argptr;
char message[MAX_MSGLEN];
client_t *client;
int i;
va_start( argptr, format );
Q_vsnprintfz( message, sizeof( message ), format, argptr );
va_end( argptr );
if( cl != NULL )
{
if( cl->state < CS_CONNECTING )
return;
TV_Downstream_AddServerCommand( cl, message );
return;
}
// send the data to all relevant clients
for( i = 0, client = tvs.clients; i < tv_maxclients->integer; i++, client++ )
{
if( client->state < CS_CONNECTING ) // wsw: Medar: or connected?
continue;
TV_Downstream_AddServerCommand( client, message );
}
}
示例2: SV_SendServerCommand
/*
* SV_SendServerCommand
*
* Sends a reliable command string to be interpreted by
* the client: "cs", "changing", "disconnect", etc
* A NULL client will broadcast to all clients
*/
void SV_SendServerCommand( client_t *cl, const char *format, ... )
{
va_list argptr;
char message[MAX_MSGLEN];
client_t *client;
int i;
va_start( argptr, format );
Q_vsnprintfz( message, sizeof( message ), format, argptr );
va_end( argptr );
if( cl != NULL )
{
if( cl->state < CS_CONNECTING )
return;
SV_AddServerCommand( cl, message );
return;
}
// send the data to all relevant clients
for( i = 0, client = svs.clients; i < sv_maxclients->integer; i++, client++ )
{
if( client->state < CS_CONNECTING )
continue;
SV_AddServerCommand( client, message );
}
// add to demo
if( svs.demo.file )
SV_AddServerCommand( &svs.demo.client, message );
}
示例3: Sys_Error
/*
* Sys_Error
*/
void Sys_Error( const char *format, ... )
{
static qboolean recursive = qfalse;
va_list argptr;
char string[1024];
// change stdin to non blocking
fcntl( 0, F_SETFL, fcntl( 0, F_GETFL, 0 ) & ~FNDELAY );
va_start( argptr, format );
Q_vsnprintfz( string, sizeof( string ), format, argptr );
va_end( argptr );
if( recursive )
{
fprintf( stderr, "Recursive Sys_Error: %s\n", string );
_exit( 1 );
}
recursive = qtrue;
fprintf( stderr, "Error: %s\n", string );
CL_Shutdown();
Qcommon_Shutdown();
_exit( 1 );
}
示例4: TVM_Error
/*
* TVM_Error
*/
void TVM_Error( const char *format, ... ) {
va_list argptr;
char msg[1024];
va_start( argptr, format );
Q_vsnprintfz( msg, sizeof( msg ), format, argptr );
va_end( argptr );
trap_Error( msg );
}
示例5: Com_Printf
void Com_Printf( const char *format, ... ) {
va_list argptr;
char msg[3072];
va_start( argptr, format );
Q_vsnprintfz( msg, sizeof( msg ), format, argptr );
va_end( argptr );
trap_Print( msg );
}
示例6: Sys_Error
// this is only here so the functions in q_shared.c and q_math.c can link
void Sys_Error( const char *format, ... ) {
va_list argptr;
char msg[3072];
va_start( argptr, format );
Q_vsnprintfz( msg, sizeof( msg ), format, argptr );
va_end( argptr );
trap::Error( msg );
}
示例7: Com_Printf
void Com_Printf( const char *format, ... )
{
va_list argptr;
char msg[1024];
va_start( argptr, format );
Q_vsnprintfz( msg, sizeof( msg ), format, argptr );
va_end( argptr );
G_Printf( "%s", msg );
}
示例8: Sys_Error
// this is only here so the functions in q_shared.c and q_math.c can link
void Sys_Error( const char *format, ... )
{
va_list argptr;
char msg[3072];
va_start( argptr, format );
Q_vsnprintfz( msg, sizeof( msg ), format, argptr );
va_end( argptr );
ri.Com_Error( ERR_FATAL, "%s", msg );
}
示例9: CG_SC_PrintStatsToFile
void CG_SC_PrintStatsToFile( const char *format, ... )
{
va_list argptr;
char msg[1024];
va_start( argptr, format );
Q_vsnprintfz( msg, sizeof( msg ), format, argptr );
va_end( argptr );
trap_FS_Print( cg_statsFileHandle, msg );
}
示例10: UI_Printf
void UI_Printf( const char *format, ... )
{
va_list argptr;
char msg[1024];
va_start( argptr, format );
Q_vsnprintfz( msg, sizeof(msg), format, argptr );
va_end ( argptr );
Trap::Print ( msg );
}
示例11: va_start
static asstring_t *objectString_AddAssignPattern( asstring_t *self, const char *pattern, ... )
{
va_list argptr;
static char buf[4096];
va_start( argptr, pattern );
Q_vsnprintfz( buf, sizeof( buf ), pattern, argptr );
va_end( argptr );
return objectString_AddAssignString( self, buf, strlen( buf ) );
}
示例12: Netchan_OutOfBandPrint
/*
* Netchan_OutOfBandPrint
*
* Sends a text message in an out-of-band datagram
*/
void Netchan_OutOfBandPrint( const socket_t *socket, const netadr_t *address, const char *format, ... )
{
va_list argptr;
static char string[MAX_PACKETLEN - 4];
va_start( argptr, format );
Q_vsnprintfz( string, sizeof( string ), format, argptr );
va_end( argptr );
Netchan_OutOfBand( socket, address, sizeof( char ) * (int)strlen( string ), (uint8_t *)string );
}
示例13: TVM_RelayError
/*
* TVM_RelayError
*/
void TVM_RelayError( tvm_relay_t *relay, const char *format, ... ) {
va_list argptr;
char msg[1024];
assert( relay );
va_start( argptr, format );
Q_vsnprintfz( msg, sizeof( msg ), format, argptr );
va_end( argptr );
trap_RelayError( relay, msg );
}
示例14: AI_Debugv
void AI_Debugv(const char *nick, const char *format, va_list va)
{
char concatBuffer[1024];
int prefixLen = sprintf(concatBuffer, "t=%09d %s: ", level.time, nick);
Q_vsnprintfz(concatBuffer + prefixLen, 1024 - prefixLen, format, va);
// concatBuffer may contain player names such as "%APPDATA%"
char outputBuffer[2048];
EscapePercent(concatBuffer, outputBuffer, 2048);
G_Printf(outputBuffer);
}
示例15: int
static asstring_t *QAS_FormatStringHelper( const char *format, ... )
{
char buf[256];
va_list args;
const int buf_size = int(sizeof( buf ));
va_start( args, format );
int ret = Q_vsnprintfz( buf, buf_size, format, args );
if( ret < 0 ) {
return objectString_FactoryBuffer( "", 0 );
}
if( ret < buf_size ) {
va_end( args );
return objectString_FactoryBuffer( buf, strlen( buf ) );
}
asstring_t *formatted = objectString_FactoryBuffer( NULL, ret );
Q_vsnprintfz( formatted->buffer, formatted->size, format, args );
return formatted;
}