#!/usr/sbin/perl #************************************************************************** #* * #* Copyright (c) 1996 Silicon Graphics, Inc. * #* All Rights Reserved * #* * #* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF SGI * #* * #* The copyright notice above does not evidence any actual of intended * #* publication of such source code, and is an unpublished work by Silicon * #* Graphics, Inc. This material contains CONFIDENTIAL INFORMATION that is * #* the property of Silicon Graphics, Inc. Any use, duplication or * #* disclosure not specifically authorized by Silicon Graphics is strictly * #* prohibited. * #* * #* RESTRICTED RIGHTS LEGEND: * #* * #* Use, duplication or disclosure by the Government is subject to * #* restrictions as set forth in subdivision (c)(1)(ii) of the Rights in * #* Technical Data and Computer Software clause at DFARS 52.227-7013, * #* and/or in similar or successor clauses in the FAR, DOD or NASA FAR * #* Supplement. Unpublished - rights reserved under the Copyright Laws of * #* the United States. Contractor is SILICON GRAPHICS, INC., 2011 N. * #* Shoreline Blvd., Mountain View, CA 94039-7311 * #************************************************************************** # DEMO_diag.pl # # Routines that run in diag frame 1; # Return true sub Generate_Diag_Page { if ($in{$CGI_PAINT_SWITCH}) { &Print_Blank_Diag_Page_NPH; } else { &Print_HTTP_No_Content; # &debugAlert("Super Secret: $ENV{'QUERY_STRING'}"); if ($in{$CGI_SUB_SWITCH}) { if ("$in{$CGI_SUB_SWITCH}" eq "$CGI_ABOUT_UI_FLAG") { &Pop("About this Interface", "$FILE_ABOUT_UI"); } elsif ("$in{$CGI_SUB_SWITCH}" eq "$CGI_EXECUTE_FLAG") { &Execute_Demo("$in{$CGI_TREE_SWITCH}", "$in{$CGI_DEMO_SWITCH}", "$in{$CGI_RELATED_DEMO_SWITCH}"); } elsif ("$in{$CGI_SUB_SWITCH}" eq "$CGI_UPDATE_FLAG") { &Update_Tables; &Notify_User if ($in{$CGI_NOTIFY_SWITCH}); } elsif ("$in{$CGI_SUB_SWITCH}" eq "$CGI_ERROR_POP_FLAG") { &Pop("$in{$CGI_ERROR_TITLE_SWITCH}", "$PATH_COMMON_DIR/$in{$CGI_ERROR_FILE_SWITCH}"); } } } } sub Print_Blank_Diag_Page_NPH { &Print_HTTP_Refresh_NPH; print "\n"; &Print_HTTP_Footer; } sub Print_Blank_Diag_Page { &Print_HTTP_Refresh; print "\n"; &Print_HTTP_Footer; } sub Display_Man_Page { local($demo_name, $no_man); $demo_name = shift; `$CMD_MAN $demo_name > $FILE_MAN_TMP`; open(TMP_FILE, "$FILE_MAN_TMP") || &Print_Error("$ERROR_NO_OPEN","$FILE_MAN_TMP","$STATUS_SERIOUS"); while () { $no_man = 1 if ( (/$NO_MAN_STRING/) || ($no_man) ); } close(TMP_FILE); `$CMD_RM $FILE_MAN_TMP`; if ($no_man) { `$CMD_XCONFIRM -t "No manual for $demo_name" -icon error $CMD_NULLIFY$CMD_BACKGROUND`; } else { `$CMD_REDIRECT $CMD_WSH -e "$CMD_MANWSH $demo_name" $CMD_NULLIFY $CMD_BACKGROUND`; } } # Takes tree_name, dir_name (demo name), [command] sub Execute_Demo { local($tree_name, $tree_path, $dir_name, $command); $tree_name = shift; $tree_path = &Tree_Path_From_Name("$tree_name"); $dir_name = shift; $command = $DEMOSRC_RUN; $command = shift if ($_[0]); chdir("$tree_path/$dir_name"); &Print_Error("$ERROR_INFO","Executing Demo $tree_path/$dir_name/$command","$STATUS_MINOR"); # &Background_Execute("$tree_path/$dir_name/$command"); `$tree_path/$dir_name/$command $CMD_NULLIFY $CMD_BACKGROUND`; }