DIRECTORY IO USING [STREAM], Rope USING [ROPE]; BridgeExec: CEDAR DEFINITIONS ~ { ROPE: TYPE ~ Rope.ROPE; NetworkStream: TYPE ~ IO.STREAM; Register: PROC [ name: ROPE, -- name under which command is registered. createProc: CreateProc, -- proc invoked to instantiate. clientData: REF, -- passed to cmdProc to instantiate. destroyProc: DestroyProc -- proc invoked to act on instances. ]; CreateSession: PROC [sessionName: ROPE] RETURNS [newSession: Session]; DestroySession: PROC [session: Session]; SessionNameFromSession: PROC [session: Session] RETURNS [sessionName: ROPE]; SessionIsDead: PROC [session: Session] RETURNS [dead: BOOL]; Instance: TYPE ~ REF; -- identifies instance; opaque to BridgeExec package. Session: TYPE ~ REF SessionObject; SessionObject: TYPE; -- identifies session to BridgeExec package; opaque to clients. CreateProc: TYPE ~ PROC [ s: NetworkStream, -- stream for communication with host. args: ROPE, -- as sent from host, with leading blanks stripped but no other processing performed. The command name is not included. By convention, args are terminated (rather than separated) by CRs. session: Session, -- session in which this instance is being created. clientData: REF -- the clientData that was passed to AddCommand. ] RETURNS [ instance: Instance -- newly-created instance, or NIL. ]; DestroyProc: TYPE ~ PROC [ instance: Instance, -- instance to be killed. clientData: REF -- NIL if called by BridgeExec package. ]; CreateInstance: PROC[cmdName: ROPE, s: NetworkStream, args: ROPE, session: Session] RETURNS [instance: Instance]; DestroyInstance: PROC [session: Session, instance: Instance, clientData: REF]; }... PBridgeExec.mesa Demers, February 20, 1987 4:26:52 pm PST Copied Types Registration Register a command, whose CreateProc can then be invoked using CreateInstance. To unregister a command, use createProc = NIL. Session Management Create a new session. There may be multiple sessions with the same name. Destroy the session and all command instances associated with it. Destroying a session more than once is okay. Instance Management Create a command instance by calling the CreateProc for the named command with the given parameters. Fails if the session is dead, returning NIL. Call the DestroyProc associated with cmdInstance, after deleting the instance from the session data structure. If the instance isn't there, do nothing. This is the only way for a client to destroy a command instance. Succeeds even if the session is dead. ΚY˜code™K™(K˜—šΟk ˜ Kšœœœ˜Kšœœœ˜K˜—šΟn œœ œ˜!head™ Kšœœœ˜Kšœœœœ˜ —™ šžœœ˜KšœœΟc*˜6KšœŸ˜7Kšœ œŸ$˜5KšœŸ$˜=Kšœ˜K™~——šœ™šž œœœœ˜FKšœI™IK˜—šžœœ˜(K™oK˜—Kšžœœœœ˜LK˜Kšž œœœœ˜<—™Kšœ œœŸ5˜KK˜Kšœ œœ˜"KšœœŸ?˜TK˜šœ œ˜šœ˜KšœŸ&˜8KšœœŸΌ˜ΙKšœŸ3˜EKšœ œŸ0˜@—šœœ˜ KšœŸ"˜5—K˜K™—šœ œ˜šœ˜KšœŸ˜-Kšœ œŸ'˜7—Kšœ˜—K˜š žœœ œœœ˜qK™’K˜—šžœœ4œ˜NKšœ¦ΟbœW™——K˜K˜——…—€ )