$INCLUDE UNIVERSE.INCLUDE MTF.INCL.H $INCLUDE UNIVERSE.INCLUDE FILENAMES.H $INCLUDE UNIVERSE.INCLUDE MACHINE.NAME $INCLUDE UNIVERSE.INCLUDE TLOG.H ****************************************************************************** * * System Admin Transaction Logging - Restored logs * * Module %M% Version %I% Date %H% * * (c) Copyright 1998 Ardent Software Inc. - All Rights Reserved * This is unpublished proprietary source code of Ardent Software Inc. * The copyright notice above does not evidence any actual or intended * publication of such source code. * ******************************************************************************* * * Maintenence log - insert most recent change descriptions at top * * Date.... GTAR# WHO Description........................................ * 10/14/98 23801 SAP Change copyrights. * 08/26/96 18966 GMH Correct device field * 03/25/96 18212 LAG Windows NT port * 03/09/95 15857 DTM Changed default log # * 10/21/94 15162 DTM Changed messages * 10/12/94 15101 DTM Changed length of log number field * 05/15/94 13286 DTM Initial Programming * ******************************************************************************* id = "%W%" ******************************************************************************* ****************** ** Windows NT port ** DEFFUN IS.FULLPATH(FILESPEC) CALLING "*IS.FULLPATH" ** ****************** ******************************************************************************* * Call initialization routines ******************************************************************************* TPRINT @(-1) temp = NULL CALL *ISUSER.B(0, temp) IF temp = 0 THEN TPRINT UVREADMSG(071000,"") SLEEP 3 STOP END GOSUB init.form CALL *DRAW.SCRN.B( "Restore Log Files", 1 ) GOSUB init.menu CALL *MNU.BAR.PR.B(Menu.Bar,1) ******************************************************************************* * Begin processing ******************************************************************************* CALL *HELP.PRINT.B(UVREADMSG(073009,""),2) CALL *PUT.FORM.B(form.size,form,temp.form,PRMPT,1) help.loop: CALL *HELP.PRINT.B(form,1) input.loop: TPRINT form: temp=temp.form CALL *CINPUT.B(SEC.PRMPT,temp,special,form,0) IF special # 0 THEN BEGIN CASE CASE special = UP.ARROW TPRINT form:PRMPT: IF temp.form # NULL THEN TPRINT temp.form: TPRINT STR(SPACE,27-len(temp.form)): END ELSE TPRINT group.defaults: TPRINT STR(SPACE,27-len(group.defaults)): END form.line -=1 IF form.line < 1 THEN form.line = form.size END GOTO help.loop CASE special = DOWN.ARROW TPRINT form:PRMPT: IF temp.form # NULL THEN TPRINT temp.form: TPRINT STR(SPACE,27-LEN(temp.form)): END ELSE TPRINT group.defaults: TPRINT STR(SPACE,27-LEN(group.defaults)): END form.line +=1 IF form.line > form.size THEN form.line = 1 END GOTO help.loop CASE special = F.1 CALL *HELP.PRINT.B(form< form.line,5>,3) GOTO input.loop CASE special = ESCAPE STOP @(-1) CASE special = F.4 temp = "*" GOTO new.enter CASE special = F.10 action.value=1 CALL *DO.MNU.BAR.B(Menu.Bar,action.value,form.size,form,temp.form) BEGIN CASE CASE action.value = 1 STOP @(-1) CASE action.value = 2 STOP @(-1) CASE action.value = 3 message=UVREADMSG(073634,"") CONVERT @FM TO " " IN message CALL *HELP.BOX.B(3,10,60,message) CASE action.value = 4 message=UVREADMSG(076001,"") CONVERT @FM TO " " IN message CALL *HELP.BOX.B(3,10,60,message) CASE action.value = 5 CALL *HELP.BOX.B(3,10,45,UVREADMSG(076000,"")) END CASE CALL *PUT.FORM.B(form.size,form,temp.form,PRMPT,1) GOTO help.loop CASE 1 GOTO input.loop END CASE END ELSE BEGIN CASE CASE form.line = 1 new.enter: IF temp = "*" THEN CALL *HELP.PRINT.B(UVREADMSG(073058,""),2) help.message = CONVERT(@FM, " ", UVREADMSG(073644,"")) CALL *HELP.PRINT.B(help.message, 2) sel.val = 1 CALL *PTBCODE(device.file,2,sel.val) IF sel.val = -1 THEN temp = NULL CALL *PUT.FORM.B(form.size, form, temp.form, PRMPT,1) GOTO help.loop END ELSE temp = sel.val temp.form=temp END CALL *PUT.FORM.B(form.size, form, temp.form, PRMPT, 1) END IF temp = NULL THEN CALL *HELP.PRINT.B( NULL, 3 ) CALL *HELP.BOX.B( 11, 5, 30, "Must Enter Device" ) temp.form< form.line > = NULL TPRINT form:PRMPT:temp.form: TPRINT STR(SPACE,16-LEN(temp.form)): GOTO help.loop END tmpdev = temp temp.form< form.line > = temp CASE form.line = 2 IF temp = NULL THEN CALL *HELP.PRINT.B( NULL, 3 ) CALL *HELP.BOX.B( 17, 5, 30, "Must Enter First Log" ) temp.form< form.line > = NULL TPRINT form:PRMPT:temp.form: TPRINT STR(SPACE,16-LEN(temp.form)): GOTO help.loop END FirstLog = temp temp.form< form.line > = temp CASE form.line = 3 IF temp = NULL THEN CALL *HELP.PRINT.B( NULL, 3 ) CALL *HELP.BOX.B( 17, 5, 30, "Must Enter Last Log" ) temp.form< form.line > = NULL TPRINT form:PRMPT:temp.form: TPRINT STR(SPACE,16-LEN(temp.form)): GOTO help.loop END LastLog = temp temp.form< form.line > = temp CASE form.line = 4 PATH = temp temp.form< form.line > = temp END CASE TPRINT form:PRMPT:temp.form: TPRINT STR(SPACE,16-LEN(temp.form)): form.line+=1 IF form.line <= form.size THEN GOTO help.loop END ELSE GOSUB restore.file END END STOP @(-1) ************************************************************************* * restore.file ************************************************************************* restore.file: ****************** ** Windows NT port ** IF IS.FULLPATH(tmpdev) THEN DeviceName = tmpdev END ELSE READ tmpREC FROM device.file, tmpdev THEN DeviceName = tmpREC<6> END ELSE DeviceName = tmpdev END END ** ****************** reply = 1 CALL *YES.NO.BOX.B( 11 ,"Are you sure you want to restore files", reply ) IF reply THEN PRINT @(-1) Exec.Sentence = "LOG.RESTORE ":FirstLog:" ":LastLog:" ":PATH:" ":DeviceName EXECUTE Exec.Sentence SLEEP 5 END CLOSE device.file RETURN ************************************************************************* * Init.form * This routine is used TO initialize the form TO be printed on the * screen for data input. It also sets up the default answers, if * any * ************************************************************************* init.form: form = NULL temp.form = NULL path = "" RECIO( path, RECIO$PATH ) temp.form<1> = "MT0" temp.form<2> = "1" temp.form<3> = "1" temp.form<4> = path form.size = 4 form.line = 1 form<1,1> = @(5,4) form<1,2> = @(40,4) form<1,3> = "Name of Device" form<1,4> = "Enter the name of the Device to restore from" form<1,5> = form<1,4> form<1,6> = 30 form<2,1> = @(5,6) form<2,2> = @(40,6) form<2,3> = "Number of First Log File to Restore" form<2,4> = "Enter the number of the First Log File to Restore from Logging Directory" form<2,5> = form<2,4> form<2,6> = 9 form<3,1> = @(5,8) form<3,2> = @(40,8) form<3,3> = "Number of Last Log File to Restore" form<3,4> = "Enter the number of the Last Log File to Restore from Logging Directory" form<3,5> = form<3,4> form<3,6> = 9 form<4,1> = @(5,10) form<4,2> = @(40,10) form<4,3> = "Name of Directory " form<4,4> = "Enter the name of directory where you wish to restore the files, or hit return to take the currently defined logging directory" form<4,5> = form<4,4> form<4,6> = 35 group.defaults = NULL group.defaults<1> = NULL group.defaults<2> = NULL group.defaults<3> = NULL group.defaults<4> = NULL OPEN "", "&DEVICE&" TO device.file ELSE CALL *HELP.BOX.B( 5, 5, 50, "Cannot open &DEVICE& file!" ) STOP @(-1) END RETURN *************************************************************************** * init.menu - initializes menu bar *************************************************************************** init.menu: scratch=UVREADMSG(073087,"") Menu.Bar = NULL Menu.Bar<1,1> = 3 ;* Number of Items in Menu.Bar Menu.Bar<1,2> = 1 ;* Line # on which to print the Menu Bar * First Item Menu.Bar<2,1,1>=scratch<1> ;* SubMenu Title Menu.Bar<2,1,2>=1 ;* # of items in SubMenu * SubMenu #1 Menu.Bar<2,2,1>=scratch<6> ;* SubMenu Item Menu.Bar<2,2,2>=1 ;* Action Code (Returned to calling process) Menu.Bar<2,2,3>=scratch<7> * Second Item Menu.Bar<3,1,1>=scratch<8> ;* SubMenu Title Menu.Bar<3,1,2>=1 ;* # of items in SubMenu * SubMenu #1 Menu.Bar<3,2,1>=scratch<6> ;* SubMenu Item Menu.Bar<3,2,2>=2 ;* Action Code Menu.Bar<3,2,3>=scratch<7> scratch=UVREADMSG(073089,"") Menu.Bar<4,1,1>=scratch<1> Menu.Bar<4,1,2>=3 Menu.Bar<4,2,1>=scratch<2> Menu.Bar<4,2,2>=3 Menu.Bar<4,2,3>=scratch<3> Menu.Bar<4,3,1>=scratch<4> Menu.Bar<4,3,2>=4 Menu.Bar<4,3,3>=scratch<5> Menu.Bar<4,4,1>=scratch<6> Menu.Bar<4,4,2>=5 Menu.Bar<4,4,3>=scratch<7> RETURN STOP @(-1) END