PDQueue: DEFINITIONS = BEGIN Request: TYPE = RECORD [ fileName: LONG STRING, requestTime: LONG STRING, requestor: LONG STRING, requestorPassword: LONG STRING, separator: LONG STRING, copies: CARDINAL ]; Reset: PROC; QueueRequest: PROC [request: Request] RETURNS [requestNumber: INT]; Reprint: PROC [copies: CARDINAL]; CancelReprint: PROC; ReprintCancelled: PROC RETURNS [BOOLEAN]; DoRequest: PROC [action: PROC [request: Request, requestNumber: CARDINAL, abort: LONG POINTER TO BOOLEAN]]; CheckRequest: PROC [requestNumber: CARDINAL, action: PROC [request: Request, status: RequestStatus]]; RequestStatus: TYPE = {notFound, canceled, waiting, printing}; CancelRequest: PROC [requestNumber: CARDINAL] RETURNS [ok: BOOLEAN]; CountRequests: PROC RETURNS [requestCount: NAT]; EnumerateRequests: PROC [action: PROC [requestNumber: CARDINAL, request: Request, status: RequestStatus] RETURNS [continue: BOOLEAN]]; RegisterDisk: PROC [read, write: PROC [address: LONG POINTER, nwords: CARDINAL], maxWords: CARDINAL]; RegisterTTY: PROC [writeLine: PROC [LONG STRING]]; GetSuspended: PROC RETURNS [BOOLEAN]; SetSuspended: PROC [suspended: BOOLEAN] RETURNS [old: BOOLEAN]; LogMessage: PROC [message: LONG STRING, requestNumber: INT _ -1, userName: LONG STRING _ NIL]; SetLogState: PROC [logging: BOOLEAN] RETURNS [old: BOOLEAN]; EnumerateMessages: PROC [PROC[message: LONG STRING] RETURNS [continue: BOOLEAN]]; DeferSaving: PROC; DoDeferredSave: PROC; END. RPDQueue.mesa Copyright (C) 1984, Xerox Corporation. All rights reserved. Michael Plass, October 31, 1984 10:19:10 am PST This module manages the queue for the peach printer. If a disk is available, a simple mechanism is provided here for periodically saving the state of the queue on the disk, so booting the server will not lose it all. In any case, the queue lives in main memory, and consists mostly of full path names of the files, together with a little bit of information about who requested the print, etc. There is also some stuff here for logging what has been going on, and for accessing the log. i.e., "[Indigo]foo.pd!33". To be printed between jobs, if possible. Resets the queue. Returns -1 if the queue is full. Waits if queue is empty; action should return or raise ABORTED if abort^ becomes true. If the strings in the Request are NIL, the request is to reprint as much as the previous request as is possible without a lot of recomputation. Looks for a matching request (fileName and requestor), and removes it from the queue. Number of outstanding requests. Periodically calls the write proc; calls the read proc at startup time. If this is never called, the queue lives only in main memory and is lost at boot time. Registers a proc for displaying messages. Setting suspended to TRUE will stop printing after the current job finishes. Adds time stamp. Message is also output to the printer's TTY, if present and enabled. Setting logging to FALSE prevents messages from being logged on the TTY, to prevent interference with typein. Unprinted messages will be printed when logging is re-enabled. Replays history for as far back as we can remember. Prevents operations that normally checkpoint the queue on disk from doing so, for example to prevent contention for the disk while actually printing. Does any deferred checkpoints; Ê*˜J™ J™<™/J™—šœ Ïk œ˜™èJ˜—šœ œœ˜šœ œœ˜J™&—Jšœ œœ˜Jšœ œœ˜Jšœœœ˜šœ œœ˜J™(—Jšœ˜Jšœ˜J˜—šÏnœœ˜ J™J˜—šž œœœœ˜CJ™ J˜—šžœœ œ˜!J˜—šž œœ˜J˜—šžœœœœ˜)J˜—šž œœ œ#œ œœœœ˜kJšœ7œ™VJšœ"œj™J˜—šž œœœ œ,˜eJšœœ+˜>J˜—š ž œœœœœ˜DJšœU™UJ˜—šž œœœœ˜0J™J˜—š žœœ œœ+œ œ˜†J˜—šž œœœ œœ œ œ˜eJ™ŸJ˜—š ž œœ œœœ˜2J™)J˜—Jšž œœœœ˜%š ž œœ œœœ˜?Jšœœ3™LJ˜—šž œœ œœœœœœ˜^Jšœ:œ™VJ˜—š ž œœ œœœ˜