DIRECTORY IO USING [STREAM, Value], Rope USING [ROPE]; LogViewer: CEDAR DEFINITIONS = BEGIN CreateStream: PROC [] RETURNS [stream: IO.STREAM]; PutRope: PROC [text: Rope.ROPE]; PutRopes: PROC [t1, t2, t3: Rope.ROPE_NIL]; PutF: PROC [format: Rope.ROPE _ NIL, v1, v2, v3, v4, v5: IO.Value _ [null[]]]; PutF1: PROC [format: Rope.ROPE _ NIL, value: IO.Value _ [null[]]]; UserAbort: SIGNAL; TimeOut: SIGNAL; RequestRope: PROC [prompt: Rope.ROPE_NIL, timeOut: NAT_0] RETURNS [Rope.ROPE]; AddLock: PRIVATE PROC [lock, free: PROC]; END. ώLogViewer.mesa Copyright c 1983, 1985, 1986 by Xerox Corporation. All rights reserved. Created by: Christian. Jacobi, August 3, 1983 9:54 am Last edited by: Christian Jacobi, August 30, 1986 12:30:04 pm PDT Sequential IO for "terminal and keyboard" All processes share one log viewer. Output may be delayed while input is pending. Don't use procedures from inside a viewers-repaint or a TIP-notify procedure. Output Output must not overwhelm the user: the user must be able to recognize an output line made by a different application. Output made in form of lines simplifies the recognition of the output source. It is also a good idea to follow the input convention for outputs. Creates an output stream which writes its output into the log viewer. This procedure is lightweight; the viewer is only created when output is done. No signals or errors are raised, neither on call nor on sequential output. Short cuts Input In order to allow different applications to share this package in an orderly fashion, (one that will not confuse users) clients must follow the convention below: Do not require input except as immediate response to an user action. Requests user to type in a rope. May raise UserAbort and TimeOut. prompt: NIL is ok, but others are better. timeOut: in seconds; 0 for no timeout [the user can always abort]. USE WITH CARE. Procedures tell client module whether some input is in progress. This is typically used to diplay a different cursor, so the user sees that input is required. The lock procedure is a hint, do not rely on it. The client procedures are called in a monitored way; they must be fast and not cause any wedge. Do not make assumptions about the order of calls. The registered procedures can not be removed, use only one per client. Κ ˜codešœ™Kšœ Οmœ=™HKšœ6™6K™AK˜—šΟk œ˜ Kšžœžœžœ˜Kšœžœžœ˜—K˜šΟn œžœž œž˜$K™—šœ*™*Kšœ#™#Kšœ-™-KšœM™MK™—K™™K™IK™JK™RK™"K˜—š Ÿ œžœžœ žœžœ˜2KšœE™EK™NK™KK˜—K˜™ K˜—KšŸœžœ žœ˜ KšŸœžœžœ˜+Kš Ÿœžœžœžœžœ˜Nš Ÿœžœžœžœ žœ˜BK˜—K˜™K˜K™U™KK™D—K˜—Kšœ žœ˜šœ žœ˜K˜—šŸ œžœžœžœ žœžœžœ˜NKšœ ™ Kšœ!™!Kšœ*™*KšœB™BK˜—šŸœžœžœžœ˜)Kšœ™KšœF™FK™KKšœ>™>KšœG™GKšœK™KKšœF™F—K˜Kšžœ˜K˜—…—& /