Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Processes
Chapter 3 - Time Manager


Summary of the Time Manager

Pascal Summary

Constants

CONST
   {Gestalt selector}
   gestaltTimeMgrVersion      = 'tmgr';   {Time Manager version}

   {values returned by Gestalt}
   gestaltStandardTimeMgr     = 1;        {original Time Manager}
   gestaltRevisedTimeMgr      = 2;        {revised Time Manager}
   gestaltExtendedTimeMgr     = 3;        {extended Time Manager}

Data Types

Original and Revised Time Manager Task Record

TYPE TMTask = 
   RECORD 
      qLink:         QElemPtr;      {next queue entry}
      qType:         Integer;       {queue type}
      tmAddr:        ProcPtr;       {pointer to task}
      tmCount:       LongInt;       {reserved}
   END;

Extended Time Manager Task Record

TYPE TMTask = 
   RECORD 
      qLink:         QElemPtr;      {next queue entry}
      qType:         Integer;       {queue type}
      tmAddr:        ProcPtr;       {pointer to task}
      tmCount:       LongInt;       {unused time}
      tmWakeUp:      LongInt;       {wakeup time}
      tmReserved:    LongInt;       {reserved for future use}
   END;
TMTaskPtr = ^TMTask;

Time Manager Routines

PROCEDURE InsTime		(tmTaskPtr: QElemPtr);
PROCEDURE InsXTime		(tmTaskPtr: QElemPtr);
PROCEDURE PrimeTime		(tmTaskPtr: QElemPtr; count: LongInt);
PROCEDURE RmvTime		(tmTaskPtr: QElemPtr);

Application-Defined Routine

PROCEDURE MyTimeTask;

C Summary

Constants

/*Gestalt selector*/
#define gestaltTimeMgrVersion    'tmgr'      /*Time Manager version*/

/*values returned by Gestalt*/
#define gestaltStandardTimeMgr   1           /*original Time Manager*/
#define gestaltRevisedTimeMgr    2           /*revised Time Manager*/
#define gestaltExtendedTimeMgr   3           /*extended Time Manager*/

Data Types

typedef pascal void (*TimerProcPtr)(void);

Original and Revised Time Manager Task Record

struct TMTask {
      QElemPtr       qLink;         /*next queue entry*/
      short          qType;         /*queue type*/
      TimerProcPtr   tmAddr;        /*pointer to task*/
      long           tmCount;       /*reserved*/
};

Extended Time Manager Task Record

struct TMTask {
      QElemPtr       qLink;         /*next queue entry*/
      short          qType;         /*queue type*/
      TimerProcPtr   tmAddr;        /*pointer to task*/
      long           tmCount;       /*unused time*/
      long           tmWakeUp;      /*wakeup time*/
      long           tmReserved;    /*reserved for future use*/
};
typedef struct TMTask TMTask;
typedef TMTask *TMTaskPtr;

Time Manager Routines

pascal void InsTime(QElemPtr tmTaskPtr);
pascal void InsXTime(QElemPtr tmTaskPtr);
pascal void PrimeTime(QElemPtr tmTaskPtr, long count);
pascal void RmvTime(QElemPtr tmTaskPtr);

Application-Defined Routine

pascal void MyTimeTask(void);

Assembly-Language Summary

Data Structures

Structure of Original and Revised Time Manager Queue Entry
0qLinklongpointer to next queue entry
4qTypewordqueue type
6tmAddrlongpointer to task
10tmCountlongunused time; returned to caller

Structure of Extended Time Manager Queue Entry
0qLinklongpointer to next queue entry
4qTypewordqueue type
6tmAddrlongpointer to task
10tmCountlongunused time; returned to caller
14tmWakeUplongwakeup time; used internally by the Time Manager
18tmReservedlongreserved for future use

Result Codes
noErr0No error


Previous Book Contents Book Index Next

© Apple Computer, Inc.
17 JUN 1996