window:
	res:
		windowType	wstandard
	endres:
endwindow:
close:
	res:
		bitmapPath	$(bitmaps)
		bitmapFile	CLOSE::CBM
	endres:
endclose:
title:
	res:
		leftLabel	'Backup'
		leftKanjiFont	$(kanjiFont)
		leftFont	$(kanaFont)
		switch $(COLOR)
			case MONO:
				bitmapPath	$(bitmaps)
				backgroundFile	GRAY3
				transparent	false
				break
		endswitch
	endres:
endtitle:
dialog: dialogs
	res:
		defaultDistance		#(fWidth)
		dialogType		modeless
	endres:
	ditem: file_label
		res:
			itemType	bitmap
			label		'File'
			kanjiFont	$(kanjiFont)
			font		$(kanaFont)
			vertDistance	#(fWidth)
			horizDistance	#(fWidth)*2
		endres:
	endditem:
	ditem: system-00
		res:
			itemType	button
			fromVert	file_label
			label		'System_Administration_Files'
			kanjiFont	$(kanjiFont)
			font		$(kanaFont)
			vertDistance	#(fWidth)
			horizDistance	#(fWidth)
		endres:
		act:
			put 1 $(file)
			job file_select
		endact:
	endditem:
	ditem: user-00
		res:
			itemType	button
			fromVert	system-00
			label		'Specified_User'
			kanjiFont	$(kanjiFont)
			font		$(kanaFont)
			vertDistance	#(fWidth)
			horizDistance	#(fWidth)
		endres:
		act:
			put 2 $(file)
			job file_select
		endact:
	endditem:
	ditem: myall-00
		res:
			itemType	button
			fromVert	user-00
			label		'My_All_Files'
			kanjiFont	$(kanjiFont)
			font		$(kanaFont)
			vertDistance	#(fWidth)
			horizDistance	#(fWidth)
		endres:
		act:
			put 3 $(file)
			job file_select
		endact:
	endditem:
	ditem: file-00
		res:
			itemType	button
			fromVert	myall-00
			label		'Specified_Files'
			kanjiFont	$(kanjiFont)
			font		$(kanaFont)
			vertDistance	#(fWidth)
			horizDistance	#(fWidth)
		endres:
		act:
			put 4 $(file)
			job file_select
		endact:
	endditem:
	ditem: device_label
		res:
			itemType	bitmap
			fromHoriz	system-00
			label		'Device'
			kanjiFont	$(kanjiFont)
			font		$(kanaFont)
			vertDistance	#(fWidth)
			horizDistance	#(fWidth)*4
		endres:
	endditem:
	ditem: fd-01
		res:
			itemType	radio
			fromVert	device_label
			fromHoriz	system-00
			label		'Floppy Disk'
			kanjiFont	$(kanjiFont)
			font		$(kanaFont)
			vertDistance	#(fWidth)
			horizDistance	#(fWidth)*2
			shadowWidth	0
			switch $(COLOR)
				case MONO:
					background	white
					foreground	black
					highlightBack	white
					highlightFore	black
					selectedBack	white
					selectedFore	black
					selhighBack	white
					break
				default:
					background	#c5c5c5
					highlightBack	#c5c5c5
					selectedBack	#c5c5c5
					break
			endswitch
		endres:
		act:
			put $(value)
			switch #(value)
				case 1:
					put 1 $(device)
			endswitch
		endact:
	endditem:
	ditem: mt-01
		res:
			itemType	radio
			fromVert	fd-01
			fromHoriz	system-00
			label		'Streaming Tape'
			kanjiFont	$(kanjiFont)
			font		$(kanaFont)
			vertDistance	#(fWidth)
			horizDistance	#(fWidth)*2
			shadowWidth	0
			switch $(COLOR)
				case MONO:
					background	white
					foreground	black
					highlightBack	white
					highlightFore	black
					selectedBack	white
					selectedFore	black
					selhighBack	white
					break
				default:
					background	#c5c5c5
					highlightBack	#c5c5c5
					selectedBack	#c5c5c5
					break
			endswitch
		endres:
		act:
			put $(value)
			switch #(value)
				case 1:
					put 3 $(device)
			endswitch
		endact:
	endditem:
	ditem: mt-ch
		res:
			itemType	button
			fromVert	fd-01
			fromHoriz	mt-01
			label		tu00
			kanjiFont	$(kanjiFont)
			font		$(kanaFont)
			vertDistance	#(fWidth)
			horizDistance	#(fWidth)
		endres:
		act:
			shift $(tus)
			job mt-ch
		endact:
	endditem:
	ditem: rmt-01
		res:
			itemType	radio
			fromVert	mt-01
			fromHoriz	system-00
			label		'Streaming Tape(Remote)'
			kanjiFont	$(kanjiFont)
			font		$(kanaFont)
			vertDistance	#(fWidth)
			horizDistance	#(fWidth)*2
			shadowWidth	0
			switch $(COLOR)
				case MONO:
					background	white
					foreground	black
					highlightBack	white
					highlightFore	black
					selectedBack	white
					selectedFore	black
					selhighBack	white
					break
				default:
					background	#c5c5c5
					highlightBack	#c5c5c5
					selectedBack	#c5c5c5
					break
			endswitch
		endres:
		act:
			put $(value)
			switch #(value)
				case 1:
					put 4 $(device)
			endswitch
		endact:
	endditem:
	ditem: mo-01
		res:
			itemType	radio
			fromVert	rmt-01
			fromHoriz	system-00
			label		'MO Disk'
			kanjiFont	$(kanjiFont)
			font		$(kanaFont)
			vertDistance	#(fWidth)
			horizDistance	#(fWidth)*2
			shadowWidth	0
			switch $(COLOR)
				case MONO:
					background	white
					foreground	black
					highlightBack	white
					highlightFore	black
					selectedBack	white
					selectedFore	black
					selhighBack	white
					break
				default:
					background	#c5c5c5
					highlightBack	#c5c5c5
					selectedBack	#c5c5c5
					break
			endswitch
		endres:
		act:
			put $(value)
			switch #(value)
				case 1:
					put 5 $(device)
			endswitch
		endact:
	endditem:
	ditem: mo-ch
		res:
			itemType	button
			fromVert	rmt-01
			fromHoriz	mo-01
			label		od00
			kanjiFont	$(kanjiFont)
			font		$(kanaFont)
			vertDistance	#(fWidth)
			horizDistance	#(fWidth)
		endres:
		act:
			shift $(ods)
			job mo-ch
		endact:
	endditem:
	ditem: list_label
		res:
			itemType	bitmap
			fromVert	mo-01
			label		'    Selected files              Volume(KB)'
			kanjiFont	$(kanjiFont)
			font		$(kanaFont)
			vertDistance	#(fWidth)*2
			horizDistance	#(fWidth)
		endres:
	endditem:
	ditem: list
		res:
			itemType	scrtext
			fromVert	list_label
			vertDistance	4
			horizDistance	#(fWidth)
			width		#(fWidth)+1*40
			height		#(lHeight)*6+8
			kanjiFont	$(kanjiFont)
			font		$(kanaFont)
			bind1		delete1
			bind2		delete2
			file		/dev/null
			textOptions	1
		endres:
		act:
			put $(line)
			put $(line)@0 $(line_no)
		endact:
	endditem:
	ditem: total_volume
		res:
			itemType	bitmap
			fromVert	list
			rightLabel	1234567
			rightKanjiFont	$(kanjiFont)
			rightFont	$(kanaFont)
			vertDistance	2
			horizDistance	#(fWidth)*33
		endres:
	endditem:
	ditem: delete
		res:
			itemType	button
			fromVert	list
			label		' Delete '
			kanjiFont	$(kanjiFont)
			font		$(kanaFont)
			vertDistance	#(fWidth)
			horizDistance	#(fWidth)
		endres:
		act:
			job delete
		endact:
	endditem:
	ditem: exec
		res:
			itemType	button
			fromVert	list_label
			fromHoriz	list
			label		' Execute '
			kanjiFont	$(kanjiFont)
			font		$(kanaFont)
			vertDistance	4
			horizDistance	#(fWidth)*2
		endres:
		act:
			switch #(device)
				case 1:
				case 2:
					$(etc)/Backup/Smntchk.sh $(device)
					break
				case 5:
					$(etc)/Backup/Smntchk.sh $(device) $(odunit)
					break
			endswitch
			switch #(device)
				case 1:
				case 2:
				case 5:
					switch #(status)
						case 0:
							break
						default:
							put 2 $(menu_no)
							put 'Now, specified disk is being used.' $(confirm_msg1)
							$(confirm) = sub $(commonPath)/error1 ++48++48
							trap $(confirm) e_end
							buzzer
							quit
					endswitch
					test -d $(MNTDIR)
					switch #(status)
						case 0:
							break
						default:
							mkdir $(MNTDIR)
							break
					endswitch
					put 2 $(menu_no)
					put 'Set disk to drive.' $(confirm_msg1)
					put 'Backup after format' $(confirm_chk_msg)
					put $(format) $(confirm_chk_val)
					switch #(device)
						case 1:
						case 2:
							$(confirm) = sub $(menu)/fdconfirm ++48++48
							break
						case 5:
							$(confirm) = sub $(commonPath)/confirm2 ++48++48
							break
					endswitch
					break
				case 3:
					put 2 $(menu_no)
					put 'Set tape cartridge to drive.' $(confirm_msg1)
					$(confirm) = sub $(commonPath)/confirm1 ++48++48
					break
				case 4:
					put 1 $(menu_no)
					$(sub) = sub $(commonPath)/remote ++48++48
					trap $(sub) remote_end
					quit
			endswitch
			trap $(confirm) confirm
			buzzer
		endact:
	endditem:
enddialog:
proc: pre
	global $(device)
	global $(odunit)
	global $(tuunit)
	global $(form_stat)
	global $(back_stat)
	global $(pid)
	global $(stop)
	global $(onback)
	global $(sheet)
	global $(stopbtn)
	global $(DOTTMP)
	global $(MNTDIR)
	put 'Backup' $(cmdName)
	put $(menuPath)/Backup $(menu)
	put $(icons) $(okPath)
	put Backup $(okFile)
	$(TMP) = mktemp
	put /tmp/$(TMP) $(LIST_DISP)
	$(TMP) = mktemp
	put /tmp/$(TMP) $(LIST_INFO)
	$(TMP) = mktemp
	put /tmp/$(TMP) $(CNT_TMP)
	$(TMP) = mktemp
	put /tmp/$(TMP) $(LIST_TMP)
	$(TMP) = mktemp
	put /tmp/$(TMP) $(DOTTMP)
	$(TMP) = mktemp
	put /tmp/$(TMP) $(MNTDIR)
	put '' $(LOCKFILE)
	put on $(format)
	job clear
endproc:
proc: clear
	echo -n > $(LIST_DISP)
	echo -n > $(LIST_INFO)
	put 0 $(backup_cnt)
	put 0 $(total)
	job clear_var
endproc:
proc: clear_var
	put 0 $(menu_no)
	put on $(mapped)
	put off $(opened)
	put 0 $(form_stat)
	put 0 $(back_stat)
	put 1 $(sheet)
	put off $(stop)
	put off $(onback)
	put off $(cancel)
endproc:
proc: close
	switch $(ONRUN)
		case on:
			quit
	endswitch
	job off
	close
endproc:
proc: off
	switch #(menu_no)
		case 1:
			close $(sub)
			break
		case 2:
			close $(confirm)
			break
	endswitch
	$(etc)/Backup/Sbackuplist.sh clear $(LIST_DISP) $(LIST_INFO)
	local $(device)
	local $(odunit)
	local $(tuunit)
	local $(form_stat)
	local $(back_stat)
	local $(pid)
	local $(stop)
	local $(onback)
	local $(sheet)
	local $(stopbtn)
	local $(DOTTMP)
	local $(MNTDIR)
	rm -f $(LIST_DISP) $(LIST_INFO) $(CNT_TMP) $(LIST_TMP) $(DOTTMP)
	rm -fr $(MNTDIR)
endproc:
proc: open
	setval system-00 selected false
	setval user-00 selected false
	setval myall-00 selected false
	setval file-00 selected false
	setval fd-01 selected true
	setval mt-01 selected false
	setval rmt-01 selected false
	setval mo-01 selected false
	switch #(uid)
		case 0:
			setval system-00 sensitive true
			setval user-00 sensitive true
			setval myall-00 sensitive false
			setval file-00 sensitive true
			break
		default:
			setval system-00 sensitive false
			setval user-00 sensitive false
			switch $(HOME)
				case '':
				case /:
					setval myall-00 sensitive false
					break
				default:
					setval myall-00 sensitive true
					break
			endswitch
			setval file-00 sensitive true
			break
	endswitch
	test -s $(TULIST)
	switch #(status)
		case 0:
			put $(tulist) < $(TULIST)
			put $(tulist) $(tus)
			setval mt-01 sensitive true
			setval mt-ch sensitive true
			job mt-ch
			break
		default:
			setval mt-01 sensitive false
			setval mt-ch sensitive false
			setval mt-ch label ???
			break
	endswitch
	setval mo-01 sensitive false
	setval mo-ch sensitive false
	setval mo-ch label ???
	switch #(uid)
		case 0:
			test -s $(ODLIST)
			switch #(status)
				case 0:
					put $(odlist) < $(ODLIST)
					put $(odlist) $(ods)
					setval mo-01 sensitive true
					setval mo-ch sensitive true
					job mo-ch
					break
			endswitch
	endswitch
	job open1
endproc:
proc: mt-ch
	switch $(tus)
		case '':
			put $(tulist) $(tus)
			break
	endswitch
	setval mt-ch label $(tus)
	switch $(tus)@0
		case tu0:
		case st00:
			put 0 $(tuunit)
			break
		case tu1:
		case st01:
			put 1 $(tuunit)
			break
		case tu2:
		case st02:
			put 2 $(tuunit)
			break
		case tu3:
		case st03:
			put 3 $(tuunit)
			break
	endswitch
endproc:
proc: mo-ch
	switch $(ods)
		case '':
			put $(odlist) $(ods)
			break
	endswitch
	setval mo-ch label $(ods)
	switch $(ods)@0
		case sd00:
		case od0:
			put 0 $(odunit)
			break
		case sd01:
		case od1:
			put 1 $(odunit)
			break
		case sd02:
		case od2:
			put 2 $(odunit)
			break
		case sd03:
		case od3:
			put 3 $(odunit)
			break
		case sd04:
			put 4 $(odunit)
			break
		case sd05:
			put 5 $(odunit)
			break
		case sd06:
			put 6 $(odunit)
			break
		case sd07:
			put 7 $(odunit)
			break
	endswitch
endproc:
proc: open1
	setval delete sensitive false
	setval exec sensitive false
	setval total_volume rightLabel 0
	setval list file $(LIST_DISP)
endproc:
proc: file_select
	switch #(file)
		case 0:
			buzzer
			quit
		case 2:
			put 1 $(menu_no)
			$(sub) = sub $(commonPath)/user ++48++48
			trap $(sub) sub_end
			quit
		case 4:
			put 1 $(menu_no)
			switch $(HOME)
				case '':
					$(sub) = getany .
					break
				default:
					$(sub) = getany $(HOME)
					break
			endswitch
			trap $(sub) sub_end
			quit
	endswitch
	put on $(ONRUN)
	put 101 $(menu_no)
	$(onrun) = sub $(commonPath)/onrun ++48++48
	switch #(file)
		case 1:
			put #(backup_cnt)+1 $(backup_cnt)
			$(pid) = bg $(etc)/Backup/Sbackuplist.sh add $(LIST_DISP) $(LIST_INFO) 1 'System_Administration_Files' $(etc)/Backup/system.list $(total) > $(CNT_TMP)
			break
		case 3:
			put #(backup_cnt)+1 $(backup_cnt)
			echo '-C $(HOME) .' > $(LIST_TMP)
			$(pid) = bg $(etc)/Backup/Sbackuplist.sh add $(LIST_DISP) $(LIST_INFO) 3 'My_All_Files($(USER))' $(LIST_TMP) $(total) > $(CNT_TMP)
			break
	endswitch
	trap $(pid) list_end
endproc:
proc: list_end
	put $(total) < $(CNT_TMP)
	setval list file $(LIST_DISP)
	switch #(backup_cnt)
		case 0:
			setval exec sensitive false
			break
		default:
			setval exec sensitive true
			break
	endswitch
	setval total_volume rightLabel $(total)
	setval delete sensitive false
	close $(onrun)
	put off $(ONRUN)
	put 0 $(menu_no)
	buzzer $(main)
endproc:
proc: delete1
	switch $(line_no)
		case '':
			quit
	endswitch
	setval delete sensitive true
endproc:
proc: delete2
	switch $(line_no)
		case '':
			quit
	endswitch
	setval delete selected true
	job delete
	setval delete selected false
endproc:
proc: delete
	put on $(ONRUN)
	put 101 $(menu_no)
	$(onrun) = sub $(commonPath)/onrun ++48++48
	put #(backup_cnt)-1 $(backup_cnt)
	$(pid) = bg $(etc)/Backup/Sbackuplist.sh del $(LIST_DISP) $(LIST_INFO) $(line_no) $(total) > $(CNT_TMP)
	trap $(pid) list_end
endproc:
proc: unmap
	switch #(menu_no)
		case 1:
			unmap $(sub)
			break
		case 2:
			unmap $(confirm)
			break
		case 101:
			unmap $(onrun)
			break
		case 102:
			unmap $(n_end)
			break
	endswitch
	put off $(mapped)
endproc:
proc: map
	switch #(menu_no)
		case 1:
			raise $(sub)
			map $(sub)
			break
		case 2:
			move $(confirm)
			raise $(confirm)
			map $(confirm)
			break
		case 101:
			move $(onrun)
			raise $(onrun)
			map $(onrun)
			break
		case 102:
			switch $(opened)
				case on:
					job bgdone
					break
				case off:
					move $(n_end)
					raise $(n_end)
					map $(n_end)
					break
			endswitch
	endswitch
	put on $(mapped)
	put off $(opened)
endproc:
proc: title
	job move
	job up
endproc:
proc: raise
	job up
endproc:
proc: move
	switch #(menu_no)
		case 2:
			move $(confirm)
			break
		case 101:
			move $(onrun)
			break
		case 102:
			move $(n_end)
			break
	endswitch
endproc:
proc: up
	switch #(menu_no)
		case 2:
			raise $(confirm)
			break
		case 101:
			raise $(onrun)
			break
		case 102:
			raise $(n_end)
			break
	endswitch
endproc:
proc: n_end
	put off $(ONRUN)
	$(etc)/Backup/Sbackuplist.sh clear $(LIST_DISP) $(LIST_INFO)
	job clear
	job open1
endproc:
proc: e_end
	put off $(ONRUN)
	job clear_var
endproc:
proc: confirm
	switch $(answer)
		case cancel:
			put 0 $(menu_no)
			switch #(sheet)
				case 1:
					break
				default:
					put on $(stop)
					put on $(cancel)
					kill 2 $(pid)
					break
			endswitch
			quit
	endswitch
	put on $(ONRUN)
	put 101 $(menu_no)
	switch #(device)
		case 1:
		case 2:
		case 5:
			switch #(answer_chk)
				case 0:
					switch #(sheet)
						case 1:
							put off $(format)
							put on $(onback)
							$(TMP) = mktemp
							put /tmp/$(TMP) $(LOCKFILE)
							$(onrun) = sub $(menu)/on_backup ++48++48
							alarm 1000 alarm
							switch $(device)
								case 1:
								case 2:
									$(pid) = bg $(etc)/Backup/Sbackup.sh  $(LIST_DISP) $(LIST_INFO) $(total) $(device) $(MNTDIR) $(LOCKFILE)
									break
								case 5:
									$(pid) = bg $(etc)/Backup/Sbackup.sh  $(LIST_DISP) $(LIST_INFO) $(total) $(device) $(MNTDIR) $(LOCKFILE) $(odunit)
									break
							endswitch
							$(back_stat) = trap $(pid) backup_end
							break
						default:
							switch $(device)
								case 1:
								case 2:
									$(etc)/Backup/Schgfd.sh next $(device) $(MNTDIR) off on
									break
								case 5:
									$(etc)/Backup/Schgfd.sh next $(device) $(MNTDIR) off on $(odunit)
									break
							endswitch
							$(onrun) = sub $(menu)/on_backup ++48++48
							kill 19 $(tarpid)
							alarm 1000 alarm
							break
					endswitch
					break
				case 1:
					put on $(format)
					switch $(device)
						case 1:
						case 2:
							$(onrun) = sub $(menu)/on_format ++48++48
							break
						case 5:
							$(onrun) = sub $(menu)/on_format_od ++48++48
							break
					endswitch
					trap $(onrun) format_end
					break
			endswitch
			break
		default:
			put on $(onback)
			$(TMP) = mktemp
			put /tmp/$(TMP) $(LOCKFILE)
			$(onrun) = sub $(menu)/on_backup ++48++48
			alarm 1000 alarm
			switch $(device)
				case 3:
					$(pid) = bg $(etc)/Backup/Sbackup.sh  $(LIST_DISP) $(LIST_INFO) $(total) $(device) $(tuunit)
					break
				case 4:
					$(pid) = bg $(etc)/Backup/Sbackup.sh  $(LIST_DISP) $(LIST_INFO) $(total) $(device) $(remote_host)
					break
			endswitch
			$(back_stat) = trap $(pid) backup_end
			break
	endswitch
endproc:
proc: format_end
	switch #(form_stat)
		case 0:
			switch #(sheet)
				case 1:
					put on $(onback)
					$(TMP) = mktemp
					put /tmp/$(TMP) $(LOCKFILE)
					$(onrun) = sub $(menu)/on_backup ++48++48
					alarm 1000 alarm
					switch $(device)
						case 1:
						case 2:
							$(pid) = bg $(etc)/Backup/Sbackup.sh  $(LIST_DISP) $(LIST_INFO) $(total) $(device) $(MNTDIR) $(LOCKFILE)
							break
						case 5:
							$(pid) = bg $(etc)/Backup/Sbackup.sh  $(LIST_DISP) $(LIST_INFO) $(total) $(device) $(MNTDIR) $(LOCKFILE) $(odunit)
							break
					endswitch
					$(back_stat) = trap $(pid) backup_end
					break
				default:
					switch $(device)
						case 1:
						case 2:
							$(pid_chfd) = bg $(etc)/Backup/Schgfd.sh next $(device) $(MNTDIR) off on
							break
						case 5:
							$(pid_chfd) = bg $(etc)/Backup/Schgfd.sh next $(device) $(MNTDIR) off on $(odunit)
							break
					endswitch
					trap $(pid_chfd) chgfd_end
					break
			endswitch
			break
		case 1:
			put off $(ONRUN)
			put 0 $(menu_no)
			break
		case 2:
			put off $(ONRUN)
			put 2 $(menu_no)
			put 'Error happened in format !!' $(confirm_msg1)
			put 'Retry again ?' $(confirm_msg2)
			$(confirm) = sub $(commonPath)/error_yn2 ++48++48
			trap $(confirm) retry
			buzzer
			break
	endswitch
endproc:
proc: chgfd_end
	$(onrun) = sub $(menu)/on_backup ++48++48
	kill 19 $(tarpid)
	alarm 1000 alarm
endproc:
proc: retry
	switch $(answer)
		case cancel:
			put 0 $(menu_no)
			quit
		default:
			put on $(ONRUN)
			put 101 $(menu_no)
			switch $(device)
				case 1:
				case 2:
					$(onrun) = sub $(menu)/on_format ++48++48
					break
				case 5:
					$(onrun) = sub $(menu)/on_format_od ++48++48
					break
			endswitch
			trap $(onrun) format_end
			break
	endswitch
endproc:
proc: backup_end
	switch #(device)
		case 1:
		case 2:
			switch $(EJECT)
				case on:
					/bin/fe 1> /dev/null 2> /dev/null
					break
			endswitch
			break
	endswitch
	put off $(onback)
	switch $(stop)
		case on:
			switch $(cancel)
				case off:
					close $(onrun)
					break
			endswitch
			put off $(ONRUN)
			job clear_var
			quit
	endswitch
	close $(onrun)
	buzzer
	put 102 $(menu_no)
	switch $(mapped)
		case on:
			job bgdone
			break
		case off:
			put on $(opened)
			break
	endswitch
endproc:
proc: bgdone
	switch #(back_stat)
		case 0:
			$(n_end) = sub $(commonPath)/normalEnd ++48++48
			trap $(n_end) n_end
			break
		default:
			put 'Error happened in backup !!' $(confirm_msg1)
			$(n_end) = sub $(commonPath)/error1 ++48++48
			trap $(n_end) e_end
			break
	endswitch
endproc:
proc: alarm
	switch $(onback)
		case off:
			switch $(LOCKFILE)
				case '':
					break
				default:
					rm -f $(LOCKFILE)
					break
			endswitch
			quit
	endswitch
	put $(tarpid) < $(LOCKFILE)
	switch #(status)
		case 0:
			put off $(stopbtn)
			alarm 1000 getlock
			break
		default:
			alarm 1000 alarm
			break
	endswitch
endproc:
proc: getlock
	put $(tarpid) < $(LOCKFILE)
	rm -f $(LOCKFILE)
	$(chgpid) = bg $(etc)/Backup/Schgfd.sh prev $(device) $(MNTDIR)
	trap $(chgpid) setnext
endproc:
proc: setnext
	put off $(ONRUN)
	close $(onrun)
	put #(sheet)+1 #(sheet)
	put 'Set next disk(No. $(sheet)).' $(confirm_msg1)
	put 'Backup after format' $(confirm_chk_msg)
	put $(format) $(confirm_chk_val)
	put 2 $(menu_no)
	switch #(device)
		case 1:
		case 2:
			switch $(EJECT)
				case on:
					/bin/fe 1> /dev/null 2> /dev/null
					break
			endswitch
			$(confirm) = sub $(menu)/fdconfirm ++48++48
			break
		case 5:
			$(confirm) = sub $(commonPath)/confirm2 ++48++48
			break
	endswitch
	trap $(confirm) confirm
	buzzer
endproc:
proc: sub_end
	switch #(file)
		case 2:
			switch $(select_user)
				case '':
					put 0 $(menu_no)
					quit
			endswitch
			put on $(ONRUN)
			put 101 $(menu_no)
			$(onrun) = sub $(commonPath)/onrun ++48++48
			put #(backup_cnt)+1 $(backup_cnt)
			$(bin)/Spw_check -ud $(select_user)
			echo '-C $(stdout) .' > $(LIST_TMP)
			$(pid) = bg $(etc)/Backup/Sbackuplist.sh add $(LIST_DISP) $(LIST_INFO) 2 'Specified_User($(select_user))' $(LIST_TMP) $(total) $(select_user) > $(CNT_TMP)
			trap $(pid) list_end
			break
		case 4:
			switch #(pg_stat)
				case 0:
					break
				default:
					put 0 $(menu_no)
					quit
			endswitch
			put on $(ONRUN)
			put 101 $(menu_no)
			$(onrun) = sub $(commonPath)/onrun ++48++48
			put #(backup_cnt)+1 $(backup_cnt)
			put off $(fromroot)
			switch $(HOME)
				case '':
					echo '-C . $(pg_path)' > $(LIST_TMP)
					break
				case /:
					sh -c 'echo $(pg_path) | sed "s/^\///"'
					put $(stdout) $(pg_path)
					echo '-C / $(pg_path)' > $(LIST_TMP)
					break
				default:
					switch $(pg_path)
						case $(HOME):
							echo '-C $(HOME) .' > $(LIST_TMP)
							break
						case $(HOME)\*:
							sh -c 'echo $(pg_path) | sed "s?^$(HOME)/??"'
							put $(stdout) $(pg_path)
							echo '-C $(HOME) $(pg_path)' > $(LIST_TMP)
							break
						default:
							put on $(fromroot)
							sh -c 'echo $(pg_path) | sed "s/^\///"'
							put $(stdout) $(pg_path)
							echo '-C / $(pg_path)' > $(LIST_TMP)
							break
					endswitch
					break
			endswitch
			switch $(fromroot)
				case on:
					$(pid) = bg $(etc)/Backup/Sbackuplist.sh add $(LIST_DISP) $(LIST_INFO) 4 (/)$(pg_path) $(LIST_TMP) $(total) > $(CNT_TMP)
					break
				default:
					$(pid) = bg $(etc)/Backup/Sbackuplist.sh add $(LIST_DISP) $(LIST_INFO) 4 $(pg_path) $(LIST_TMP) $(total) > $(CNT_TMP)
					break
			endswitch
			trap $(pid) list_end
			break
	endswitch
endproc:
proc: remote_end
	switch $(remote_host)
		case '':
			job clear_var
			quit
	endswitch
	put 'Set tape cartridge to drive.' $(confirm_msg1)
	put 2 $(menu_no)
	$(confirm) = sub $(commonPath)/confirm1 ++48++48
	trap $(confirm) confirm
	buzzer
endproc:
