当前位置: 首页>>代码示例>>C++>>正文


C++ Q_vsnprintfz函数代码示例

本文整理汇总了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 );
	}
}
开发者ID:Kaperstone,项目名称:warsow,代码行数:34,代码来源:tv_downstream.c

示例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 );
}
开发者ID:Clever-Boy,项目名称:qfusion,代码行数:38,代码来源:sv_send.c

示例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 );
}
开发者ID:ewirch,项目名称:qfusion,代码行数:31,代码来源:unix_sys.c

示例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 );
}
开发者ID:Picmip,项目名称:qfusion,代码行数:13,代码来源:tvm_main.c

示例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 );
}
开发者ID:Picmip,项目名称:qfusion,代码行数:10,代码来源:tvm_main.c

示例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 );
}
开发者ID:adem4ik,项目名称:qfusion,代码行数:11,代码来源:ui_public.cpp

示例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 );
}
开发者ID:TyounanMOTI,项目名称:warsow_mac,代码行数:11,代码来源:g_main.c

示例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 );
}
开发者ID:Turupawn,项目名称:DogeWarsow,代码行数:12,代码来源:r_public.c

示例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 );
}
开发者ID:hettoo,项目名称:racesow,代码行数:11,代码来源:cg_cmds.c

示例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 );
	}
开发者ID:Kaperstone,项目名称:warsow,代码行数:11,代码来源:uiwsw_Utils.cpp

示例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 ) );
}
开发者ID:Kaperstone,项目名称:warsow,代码行数:11,代码来源:addon_string.cpp

示例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 );
}
开发者ID:tenght,项目名称:qfusion,代码行数:16,代码来源:net_chan.c

示例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 );
}
开发者ID:Picmip,项目名称:qfusion,代码行数:15,代码来源:tvm_main.c

示例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);
}
开发者ID:DenMSC,项目名称:qfusion,代码行数:13,代码来源:ai.cpp

示例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;
}
开发者ID:Clever-Boy,项目名称:qfusion,代码行数:22,代码来源:addon_stringutils.cpp


注:本文中的Q_vsnprintfz函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。