model_server/gala/src/dis_cmds.cxx
// dis_quit function now returns a value--it returns 0 if you can quit, or 1 if you can't
dis_quit function now returns a value--it returns 0 if you can quit, or 1 if you can't
dis_quit function now returns a value -- it returns 0 if you can quit or 1 if you can ' t
int dis_quit (ClientData, Tcl_Interp* interp , int argc , char *argv[]) 
{
	int nResult=prequit(interp);
	if (nResult<0)
			nResult=0;
	if (nResult==0) 
	{
		vbool shutdown_server=vTRUE;
		if (argc>=2)
			shutdown_server=(vbool) strcmp(argv[1], "NOSERVER");
		if (shutdown_server)
		{
			Application *app = Application::findApplication("DISmain");
			if(	app && app->mySession() && !Application::IsConnectionLost() ) {
				int server_status;    
				server_status = rcall_dis_shutdown_server( app );
			}
		}
		eval_StringResource(g_global_interp, (vchar*) "shutdownCode");
		while (Viewer::GetFirstViewer()) {
			delete Viewer::GetFirstViewer();
		}
		tipWindow::ResetTimer();
		vevent::StopProcessing();
	}
	else
		nResult=1;
	char pszResult[3];
	sprintf(pszResult, "%d", nResult);
	Tcl_SetResult(interp, pszResult, TCL_STATIC);
	return TCL_OK;
}
int dis_quit ( ClientData , Tcl_Interp * interp , int argc , char * argv [ ] ) { int nResult = prequit ( interp ) ; if ( nResult < 0 ) nResult = 0 ; if ( nResult == 0 ) { vbool shutdown_server = vTRUE ; if ( argc >= 2 ) shutdown_server = ( vbool ) strcmp ( argv [ 1 ] , " " ) ; if ( shutdown_server ) { Application * app = Application :: findApplication ( " " ) ; if ( app && app -> mySession ( ) && ! Application :: IsConnectionLost ( ) ) { int server_status ; server_status = rcall_dis_shutdown_server ( app ) ; } } eval_StringResource ( g_global_interp , ( vchar * ) " " ) ; while ( Viewer :: GetFirstViewer ( ) ) { delete Viewer :: GetFirstViewer ( ) ; } tipWindow :: ResetTimer ( ) ; vevent :: StopProcessing ( ) ; } else nResult = 1 ; char pszResult [ 3 ] ; sprintf ( pszResult , " " , nResult ) ; Tcl_SetResult ( interp , pszResult , TCL_STATIC ) ; return TCL_OK ; }
dis_quit function now returns a value--it returns 0 if you can quit, or 1 if you can't
dis_quit function now returns a value -- it returns 0 if you can quit or 1 if you can ' t
//the logic behind this is that a -1 denotes either a Tcl error or a layer that doesn't  // conform to my standard. So I try to conform to the previous behaviour.   // This is here to quiet down the HP compiler. // Now do the client side shutdown. // Run the shutdown tcl code. // Delete all of the active viewers. // Tell galaxy to stop running.