beautypg.com

Apple AppleShare 3.0 File Server Controls User Manual

Page 34

background image

(theSEQPtr: ExtendedSEQEntryPtr;

theSERecPtr: ServerEventRecordPtr);

VAR

theSERecQElemPtr: SERecQElemPtr;

BEGIN

WITH theSEQPtr^ DO

BEGIN

IF freeQ.qHead <> NIL THEN

BEGIN

{ Get the server event record out of the freeQ. }

theSERecQElemPtr := SERecQElemPtr(freeQ.qHead);

IF Dequeue(QElemPtr(theSERecQElemPtr), @freeQ) <>

noErr THEN

; { Do nothing with errors-- }

{ you'd better not be getting them! }

END

ELSE

BEGIN

{ The freeQ is empty, so get the oldest server }

{ event record out of the usedQ. }

theSERecQElemPtr := SERecQElemPtr(usedQ.qHead);

IF Dequeue(QElemPtr(theSERecQElemPtr), @usedQ) <>

noErr THEN

; { Do nothing with errors-- }

{ you'd better not be getting them! }

END;

{ Copy the server event record into my server }

{ event record, }

theSERecQElemPtr^.theSERec := theSERecPtr^;