Apple AppleShare 3.0 File Server Controls User Manual
Page 39

END;
{ ProcessServerEvents should be called every time through }
{ the event loop to see if there are any server event }
{ records to process. If there aren't, then it exits }
{ immediately. If there are, then it processes the server }
{ event records in the used queue until none are left. }
PROCEDURE ProcessServerEvents;
VAR
theSERecQElemPtr: SERecQElemPtr;
BEGIN
WITH gExtendedSEQEntry DO
WHILE usedQ.qHead <> NIL DO
BEGIN
{ Get the server event record out of the usedQ. }
theSERecQElemPtr := SERecQElemPtr(usedQ.qHead);
IF Dequeue(QElemPtr(theSERecQElemPtr), @usedQ) =
noErr THEN
BEGIN
WITH theSERecQElemPtr^.theSERec DO
BEGIN
{ Do something useful with the }
{ server event record. }
{ • add your code here • }
END;
{ We're done with the server event }
{ record, so put it back in the freeQ. }
Enqueue(QElemPtr(theSERecQElemPtr), @freeQ);
END;
END;