• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ CL_Shutdown函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中CL_Shutdown函数的典型用法代码示例。如果您正苦于以下问题:C++ CL_Shutdown函数的具体用法?C++ CL_Shutdown怎么用?C++ CL_Shutdown使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了CL_Shutdown函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: signal_handler

static void signal_handler( int sig )
{
	static int try = 0;

	switch( try++ )
	{
	case 0:
		if( sig == SIGINT || sig == SIGTERM )
		{
			Com_Printf( "Received signal %d, exiting...\n", sig );
			Com_Quit();
		}
		else
		{
			Com_Error( ERR_FATAL, "Received signal %d\n", sig );
		}
		break;
	case 1:
#ifndef DEDICATED_ONLY
		printf( "Received signal %d, exiting...\n", sig );
		CL_Shutdown();
		_exit( 1 );
		break;
	case 2:
#endif
		printf( "Received signal %d, exiting...\n", sig );
		_exit( 1 );
		break;

	default:
		_exit( 1 );
		break;
	}
}
开发者ID:ewirch,项目名称:qfusion,代码行数:34,代码来源:unix_sys.c


示例2: Sys_Error

void Sys_Error(char *error, ...)
{
  va_list argptr;
  char text[1024];

#ifndef DEDICATED_ONLY
  CL_Shutdown();
#endif

  Qcommon_Shutdown();

  va_start(argptr, error);
  vsprintf(text, error, argptr);
  va_end(argptr);
  fprintf(stderr, "Error: %s\n", text);

  MessageBox(NULL, text, "Error", 0 /* MB_OK */);

  if (qwclsemaphore) {
    CloseHandle(qwclsemaphore);
  }

  /* Close stdout and stderr */
#ifndef DEDICATED_ONLY
  fclose(stdout);
  fclose(stderr);
#endif

  exit(1);
}
开发者ID:greck2908,项目名称:qengine,代码行数:30,代码来源:system.c


示例3: Sys_Quit

void
Sys_Quit(void)
{
	timeEndPeriod(1);

#ifndef DEDICATED_ONLY
	CL_Shutdown();
#endif

	Qcommon_Shutdown();
	CloseHandle(qwclsemaphore);

	if (dedicated && dedicated->value)
	{
		FreeConsole();
	}

	/* Close stdout and stderr */
#ifndef DEDICATED_ONLY
	fclose(stdout);
	fclose(stderr);
#endif

	exit(0);
}
开发者ID:tomgreen66,项目名称:yquake2,代码行数:25,代码来源:system.c


示例4: Sys_SigHandler

/*
=================
Sys_SigHandler
=================
*/
void Sys_SigHandler( int signal )
{
	static qboolean signalcaught = qfalse;

	//Com_Printf("signal: %d\n", signal);
	if( signalcaught )
	{
		fprintf( stderr, "DOUBLE SIGNAL FAULT: Received signal %d, exiting...\n",
			signal );
	}
	else
	{
		signalcaught = qtrue;
		VM_Forced_Unload_Start();
		fprintf( stderr, "Received signal %d, exiting...\n", signal );

#ifndef DEDICATED
		CL_Shutdown();
#endif
		SV_Shutdown( "Signal caught" );
		VM_Forced_Unload_Done();
	}

	Sys_Exit( 0 ); // Exit with 0 to avoid recursive signals
}
开发者ID:yiHahoi,项目名称:wolfcamql,代码行数:30,代码来源:sys_main.c


示例5: Host_Shutdown

//FIXME: this is a callback from Sys_Quit and Sys_Error.  It would be better
//to run quit through here before the final handoff to the sys code.
void Host_Shutdown (void)
{
	static qbool isdown = false;

	if (isdown) {
		printf ("recursive shutdown\n");
		return;
	}
	isdown = true;

	// on low-end systems quit process may last long time (was about 1 minute for me on old compo),
	// at the same time may repeats repeats repeats some sounds, trying preventing this
	S_StopAllSounds (true);
	S_Update (vec3_origin, vec3_origin, vec3_origin, vec3_origin);

	SV_Shutdown ("Server quit\n");

#if (!defined WITH_PNG_STATIC && !defined WITH_JPEG_STATIC)
	QLib_Shutdown();
#endif

	CL_Shutdown ();
	NET_Shutdown ();
	Con_Shutdown();
#ifdef WITH_TCL
	TCL_Shutdown ();
#endif
	qtvlist_deinit();
}
开发者ID:kostya7,项目名称:ezquake-source,代码行数:31,代码来源:host.c


示例6: Com_Quit

/*
* Com_Quit
* 
* Both client and server can use this, and it will
* do the apropriate things.
*/
void Com_Quit( void )
{
	if( dynvars_initialized )
	{
		dynvar_t *quit = Dynvar_Lookup( "quit" );
		if( quit )
		{
			// wsw : aiwa : added "quit" event for pluggable clean-up (e.g. IRC shutdown)
			Dynvar_CallListeners( quit, NULL );
		}
		Dynvar_Destroy( quit );
	}

	SV_Shutdown( "Server quit\n" );
	CL_Shutdown();
	MM_Shutdown();

	if( log_file )
	{
		FS_FCloseFile( log_file );
		log_file = 0;
	}

	Sys_Quit();
}
开发者ID:ShaitanShootout,项目名称:BM,代码行数:31,代码来源:common.c


示例7: Sys_Quit

void Sys_Quit (void)
{
	CL_Shutdown ();
	Qcommon_Shutdown ();
    fcntl (0, F_SETFL, fcntl (0, F_GETFL, 0) & ~FNDELAY);
	_exit(0);
}
开发者ID:dschimmer,项目名称:omega-test,代码行数:7,代码来源:sys_solaris.c


示例8: 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


示例9: Sys_SigHandler

/*
=================
Sys_SigHandler
=================
*/
void Sys_SigHandler( int signal )
{
	static qboolean signalcaught = qfalse;

	if( signalcaught )
	{
		fprintf( stderr, "DOUBLE SIGNAL FAULT: Received signal %d, exiting...\n",
			signal );
	}
	else
	{
		signalcaught = qtrue;
		VM_Forced_Unload_Start();
#ifndef DEDICATED
		CL_Shutdown(va("Received signal %d", signal), qtrue, qtrue);
#endif
		SV_Shutdown(va("Received signal %d", signal) );
		VM_Forced_Unload_Done();
	}

	if( signal == SIGTERM || signal == SIGINT )
		Sys_Exit( 1 );
	else
		Sys_Exit( 2 );
}
开发者ID:Hasimir,项目名称:ioq3,代码行数:30,代码来源:sys_main.c


示例10: Sys_Quit

void Sys_Quit (void) {
	CL_Shutdown ();
//	int on = 1;
//	setsockopt(0, SOL_SOCKET, SO_NONBLOCK, &on, sizeof(int));

//jens	fcntl (0, F_SETFL, fcntl (0, F_GETFL, 0) & ~FNDELAY);
	Sys_Exit(0);
}
开发者ID:kallisti5,项目名称:quake3,代码行数:8,代码来源:beos_main.cpp


示例11: Com_Quit_f

/*
=============
Com_Quit_f

Both client and server can use this, and it will
do the apropriate things.
=============
*/
void Com_Quit_f( void ) {
	// don't try to shutdown if we are in a recursive error
	if ( !com_errorEntered ) {
		SV_Shutdown ("Server quit\n");
		CL_Shutdown ();
		Com_Shutdown ();
	}
	Sys_Quit ();
}
开发者ID:CairnTrenor,项目名称:OpenJK,代码行数:17,代码来源:common.cpp


示例12: main

int main(int argc, char *argv[] )
{
  CL_SimplexSolver solver;
  CLV frameWidth;
  CLV frameHeight;
  CLV x;
  CLV y;
  CL_Constraint cn;

  CL_Init();

  CL_SetVarMap(CL_VarMapNew());
  solver = CL_SimplexSolverNew();
  frameWidth = CL_vNew("frameWidth",577,solver);
  frameHeight = CL_vNew("frameHeight",651,solver);
  CL_SimplexSolverAddStrongStay(solver,frameWidth,10);
  CL_SimplexSolverAddStrongStay(solver,frameHeight,10);
  x = CL_vNew("x",0,solver);
#ifdef CL_BUILD_FD_SOLVER 
  y = CL_dvNew("y",4,6,9,15,20,FDN_EOL);
#else
  y = CL_vNew("y",4, solver);
#endif  
  CL_vPrint(x,stdout);
  printf("\n");
  CL_vPrint(y,stdout);
  printf("\n");
 
  printf("x = %g, frameWidth = %g\n",CL_vValue(x),CL_vValue(frameWidth));

  cn = CL_ParseConstraint("x = frameWidth/3", "strong");
  printf("x = %g, frameWidth = %g\n",CL_vValue(x),CL_vValue(frameWidth));

  CL_AddConstraint(solver,cn);
  printf("x = %g, frameWidth = %g\n",CL_vValue(x),CL_vValue(frameWidth));

  CL_Solve(solver);
  printf("x = %g, frameWidth = %g\n",CL_vValue(x),CL_vValue(frameWidth));

  printf("\"x\" has Value %g\n", CL_vValue(CL_vLookup("x")));

  CL_SolverPrint(solver,stderr);

  CL_SimplexSolverSetEditedValue(solver,frameWidth,620);
  printf("x = %g, frameWidth = %g\n",CL_vValue(x),CL_vValue(frameWidth));

  CL_SolverPrint(solver,stderr);

  printf("x = %g, frameWidth = %g\n",CL_vValue(x),CL_vValue(frameWidth));

  CL_SimplexSolverSetEditedValue(solver,frameWidth,700);
  printf("x = %g, frameWidth = %g\n",CL_vValue(x),CL_vValue(frameWidth));

  CL_TableauPrintExternalVariables(solver,stderr);
  CL_Shutdown();
  return 0;
}
开发者ID:svilendobrev,项目名称:cassowarypy,代码行数:57,代码来源:CTest.c


示例13: Com_Error

/*
 * Both client and server can use this, and it will
 * do the apropriate things.
 */
void
Com_Error(int code, char *fmt, ...)
{
	va_list argptr;
	static char msg[MAXPRINTMSG];
	static qboolean recursive;

	if (recursive)
	{
		Sys_Error("recursive error after: %s", msg);
	}

	recursive = true;

	va_start(argptr, fmt);
	vsnprintf(msg, MAXPRINTMSG, fmt, argptr);
	va_end(argptr);

	if (code == ERR_DISCONNECT)
	{
#ifndef DEDICATED_ONLY
		CL_Drop();
#endif
		recursive = false;
		longjmp(abortframe, -1);
	}

	else if (code == ERR_DROP)
	{
		Com_Printf("********************\nERROR: %s\n********************\n",
				msg);
		SV_Shutdown(va("Server crashed: %s\n", msg), false);
#ifndef DEDICATED_ONLY
		CL_Drop();
#endif
		recursive = false;
		longjmp(abortframe, -1);
	}

	else
	{
		SV_Shutdown(va("Server fatal crashed: %s\n", msg), false);
#ifndef DEDICATED_ONLY
		CL_Shutdown();
#endif
	}

	if (logfile)
	{
		fclose(logfile);
		logfile = NULL;
	}

	Sys_Error("%s", msg);
	recursive = false;
}
开发者ID:tomgreen66,项目名称:yquake2,代码行数:60,代码来源:clientserver.c


示例14: Com_Error

void QDECL Com_Error( int code, const char *fmt, ... ) {
	va_list		argptr;

	// when we are running automated scripts, make sure we
	// know if anything failed
	if ( com_buildScript && com_buildScript->integer ) {
		code = ERR_FATAL;
	}

	if ( com_errorEntered ) {
		Sys_Error( "recursive error after: %s", com_errorMessage );
	}
	
	com_errorEntered = qtrue;

	//reset some game stuff here
//	SCR_UnprecacheScreenshot();

	va_start (argptr,fmt);
	Q_vsnprintf (com_errorMessage, sizeof(com_errorMessage), fmt, argptr);
	va_end (argptr);	

	if ( code != ERR_DISCONNECT ) {
		Cvar_Get("com_errorMessage", "", CVAR_ROM);	//give com_errorMessage a default so it won't come back to life after a resetDefaults
		Cvar_Set("com_errorMessage", com_errorMessage);
	}

	SG_Shutdown();				// close any file pointers
	if ( code == ERR_DISCONNECT ) {
		SV_Shutdown("Disconnect", qtrue);
		CL_Disconnect();
		CL_FlushMemory();
		CL_StartHunkUsers();
		com_errorEntered = qfalse;
		throw ("DISCONNECTED\n");
	} else if ( code == ERR_DROP ) {
		// If loading/saving caused the crash/error - delete the temp file
		SG_WipeSavegame("current");	// delete file

		SV_Shutdown (va("Server crashed: %s\n",  com_errorMessage), qtrue);
		CL_Disconnect();
		CL_FlushMemory();
		CL_StartHunkUsers();
		Com_Printf (S_COLOR_RED"********************\n"S_COLOR_MAGENTA"ERROR: %s\n"S_COLOR_RED"********************\n", com_errorMessage);
		com_errorEntered = qfalse;
		throw ("DROPPED\n");
	} else {
		CL_Shutdown ();
		SV_Shutdown (va(S_COLOR_RED"Server fatal crashed: %s\n", com_errorMessage), qtrue);
	}

	Com_Shutdown ();

	Sys_Error ("%s", com_errorMessage);
}
开发者ID:CairnTrenor,项目名称:OpenJK,代码行数:55,代码来源:common.cpp


示例15: Java_com_jeyries_quake2_Quake2_Quake2Quit

jint EXPORT_ME
Java_com_jeyries_quake2_Quake2_Quake2Quit( JNIEnv* env,
                                                  jobject thiz )
{
	//Sys_Quit();
	CL_Shutdown ();
	Qcommon_Shutdown ();
	//fcntl (0, F_SETFL, fcntl (0, F_GETFL, 0) & ~FNDELAY);
	// 	_exit(0);
	return 0;
}
开发者ID:FeltonLyndon,项目名称:quake2android,代码行数:11,代码来源:quake2-jni.c


示例16: Com_Error

void NORETURN QDECL Com_Error( int code, const char *fmt, ... ) {
	va_list		argptr;
	static int	lastErrorTime;
	static int	errorCount;
	int			currentTime;

	if ( com_errorEntered ) {
		Sys_Error( "recursive error after: %s", com_errorMessage );
	}
	com_errorEntered = qtrue;

	// when we are running automated scripts, make sure we
	// know if anything failed
	if ( com_buildScript && com_buildScript->integer ) {
		code = ERR_FATAL;
	}

	// if we are getting a solid stream of ERR_DROP, do an ERR_FATAL
	currentTime = Sys_Milliseconds();
	if ( currentTime - lastErrorTime < 100 ) {
		if ( ++errorCount > 3 ) {
			code = ERR_FATAL;
		}
	} else {
		errorCount = 0;
	}
	lastErrorTime = currentTime;

#ifdef JK2_MODE
	SCR_UnprecacheScreenshot();
#endif
	
	va_start (argptr,fmt);
	Q_vsnprintf (com_errorMessage, sizeof(com_errorMessage), fmt, argptr);
	va_end (argptr);	

	if ( code != ERR_DISCONNECT ) {
		Cvar_Get("com_errorMessage", "", CVAR_ROM);	//give com_errorMessage a default so it won't come back to life after a resetDefaults
		Cvar_Set("com_errorMessage", com_errorMessage);
	}

	SG_Shutdown();	// close any file pointers
	if ( code == ERR_DISCONNECT || code == ERR_DROP ) {
		throw code;
	} else {
		SV_Shutdown (va("Server fatal crashed: %s\n", com_errorMessage));
		CL_Shutdown ();
	}

	Com_Shutdown ();

	Sys_Error ("%s", com_errorMessage);
}
开发者ID:Aura15,项目名称:OpenJK,代码行数:53,代码来源:common.cpp


示例17: Sys_Quit

void Sys_Quit (void)
{
	timeEndPeriod( 1 );

	CL_Shutdown();
	Qcommon_Shutdown ();
	CloseHandle (qwclsemaphore);
	if (dedicated && dedicated->value)
		FreeConsole ();

	exit (0);
}
开发者ID:basecq,项目名称:q2dos,代码行数:12,代码来源:sys_win.c


示例18: Sys_Quit

void Sys_Quit (void)
{
	timeEndPeriod( 1 );

	CL_Shutdown();

	Qcommon_Shutdown();

	Sys_DestroyConsole();

	exit (0);
}
开发者ID:chrisnew,项目名称:quake2,代码行数:12,代码来源:sys_win.c


示例19: Com_Quit

/*
=============
Com_Quit

Both client and server can use this, and it will
do the apropriate things.
=============
*/
void Com_Quit (void)
{
	SV_Shutdown ("Server quit\n", false);
	CL_Shutdown ();

	if (logfile) {
		fclose (logfile);
		logfile = NULL;
	}

	Sys_Quit ();
}
开发者ID:chrisnew,项目名称:quake2,代码行数:20,代码来源:common.c


示例20: Sys_Quit

/**
 * @brief
 * @sa Qcommon_Shutdown
 */
void Sys_Quit (void)
{
#ifdef COMPILE_UFO
	CL_Shutdown();
	Qcommon_Shutdown();
	Sys_ConsoleShutdown();
#elif COMPILE_MAP
	Mem_Shutdown();
#endif

	fcntl(STDIN_FILENO, F_SETFL, fcntl(STDIN_FILENO, F_GETFL, 0) & ~FNDELAY);
	exit(0);
}
开发者ID:stavrossk,项目名称:ufoai,代码行数:17,代码来源:unix_main.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ CL_TRUEP函数代码示例发布时间:2022-05-30
下一篇:
C++ CL_SET_VARG函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap