DIRECTORY NetMgtServiceSupport USING [UnRegisterService], NSExec USING [ClientID, ClientStatus, DestroyClient, Error, ExecProc, GetTTY, Handle, StopMode, SystemFilingSession, WorkingDirectory], NSFile USING [Handle, Session], NSString USING [nullString, String], PSCommand USING [GetPrintServiceStatus, Start, Stop], PSCommandExtras USING [ServiceState], PSExec USING [GetClientID], PSExecInternal USING [DeleteServiceFromClearinghouse, printServiceName], PSExecMessages USING [Key], PSInit USING [ExpungePrintService], PSKMessages USING [DestroyMsgs, GetHandle], TextInput USING [Confirm, GetTimedYesNo], TTY USING [Rubout], XMessage USING [Get, Handle], XString USING [ReaderBody]; PSExecInitBImpl: CEDAR PROGRAM IMPORTS NetMgtServiceSupport, NSExec, PSCommand, PSCommandExtras, PSExec, PSExecInternal, PSInit, PSKMessages, TextInput, TTY, XMessage EXPORTS PSExecInternal SHARES XString = BEGIN execMsgs: XMessage.Handle _ PSKMessages.GetHandle[exec]; Start: PUBLIC NSExec.ExecProc = {PSCommand.Start[]}; Stop: PUBLIC PROCEDURE [exec: NSExec.Handle, stopMode: NSExec.StopMode] = BEGIN ENABLE BEGIN TTY.Rubout => GOTO Exit; NSExec.Error => IF type = invalidExec THEN GOTO Exit; END; IF stopMode = quiesce AND (PSCommand.GetPrintServiceStatus[].mode.current = repair) THEN IF TextInput.GetTimedYesNo [ tty: NSExec.GetTTY[exec], prompt: M[mPrintServerinRepairMode], timeAllotted: 60--seconds--, valueIfTimedOut: no] = no THEN RETURN; PSCommand.Stop[]; EXITS Exit => NULL; END; --Stop Expunge: PUBLIC NSExec.ExecProc = BEGIN psClientID: NSExec.ClientID _ PSExec.GetClientID[]; servicesWorkDir: NSFile.Handle _ NSExec.WorkingDirectory[]; servicesSession: NSFile.Session _ NSExec.SystemFilingSession[]; IF TextInput.Confirm[NSExec.GetTTY[exec], M[mExpungeWarning]] THEN BEGIN [] _ PSExecInternal.DeleteServiceFromClearinghouse[exec]; PSInit.ExpungePrintService[deleteFonts: TRUE]; PSKMessages.DestroyMsgs[]; NetMgtServiceSupport.UnRegisterService[psClientID]; NSExec.DestroyClient[psClientID]; END ELSE ERROR NSExec.Error[cannotExpunge]; END; --Expunge Name: PUBLIC PROCEDURE [nameProc: PROCEDURE [clientName: NSString.String]] = BEGIN IF PSExecInternal.printServiceName # NIL THEN nameProc[PSExecInternal.printServiceName.local] ELSE nameProc[M[mNull]]; END; --Name Status: PUBLIC PROCEDURE [ statusProc: PROCEDURE [status: NSExec.ClientStatus, comment: NSString.String]] = BEGIN statusProc[status: SELECT PSCommandExtras.ServiceState[] FROM starting => starting, stopped => stopped, stopping => stopping, ENDCASE => started, comment: NSString.nullString]; END; --Status PrintServiceCommand: PUBLIC NSExec.ExecProc = BEGIN called whenever "Print Service" command is entered END; M: PROCEDURE [key: PSExecMessages.Key] RETURNS [string: NSString.String] = { r: XString.ReaderBody _ XMessage.Get[execMsgs, ORD[key]]; string _ [bytes: LOOPHOLE[r.bytes], length: r.limit, maxlength: r.limit]}; END. -- of PSExecInitBImpl LOG 21-May-86 12:18:25 - Jacks - Created (split up PSExecInitImpl). DPSExecInitBImpl.mesa Copyright (C) Xerox Corporation 1986. All rights reserved. Last edited by Jacks 21-May-86 12:24:27 Ruseli Binsol: November 7, 1986 1:46:20 pm PST Client procs proviced to Services Executive by NSExec.CreateClient in PSExecControlImpl (except for Initialize which is in PSExecInitAImpl). Message domain handle: If not a cold quit and we are in repair mode, the user is prompted to confirm stopping the print service. If for some reason no one can provide confirmation at the TTY window, stopping is aborted. Proc for getting NSString from XMessage key ΚP˜™J™:J™'Icode™.—J™J™ŒJ˜šΟk ˜ Jšœœ˜/Jšœœ{˜‡Jšœœ˜Jšœ œ˜$Jšœ œ&˜5Jšœœ˜%Jšœœ˜Jšœœ4˜HJšœœ˜Jšœœ˜#Jšœ œ˜+Jšœ œ˜)Jšœœ ˜Jšœ œ˜Jšœœ˜—J˜šΟnœ ˜Jšœsœ ˜‡Jšœ˜Jšœ ˜J˜Jšœ™J˜8J˜šžœœ'˜4J˜—Jšžœœ œ4˜OšœΕ™Εšœ˜ Jšœ œ˜Jšœœœœ˜5Jšœ˜—šœ˜Jšœ:˜>šœ˜J˜>šœΟc œ˜6Jšœœ˜ —J˜——J˜Jšœ œ˜JšœŸ˜ J˜—šžœœ˜'J˜3J˜;J˜?šœ<œ˜HJ˜9Jšœ(œ˜.J˜J˜3J˜!Jš˜—Jšœœ˜'JšœŸ ˜J˜—š žœœ œ  œ!˜Ršœ#œ˜-J˜/—Jšœ˜JšœŸ˜ J˜—šžœœ œ˜Jšœ  œ;˜Všœœ ˜=˜*Jšœœ ˜*—J˜—JšœŸ˜ J˜—šžœœ˜3JšœŸ2˜3Jšœ˜J˜—Jšœ+™+šžœ œ˜&Jšœ˜%Jšœ/œ˜9Jšœœ1˜JJ˜—JšœŸ˜J˜Jš˜—J˜?J˜—…— ΈL