Mac OS 9
Notification.h File Reference

Notification Manager interfaces. More...

#include <MacTypes.h>
#include <OSUtils.h>

Go to the source code of this file.

Data Structures

struct  NMRec
 

Macros

#define NewNMUPP(userRoutine)
 
#define DisposeNMUPP(userUPP)   DisposeRoutineDescriptor(userUPP)
 
#define InvokeNMUPP(nmReqPtr, userUPP)    CALL_ONE_PARAMETER_UPP((userUPP), uppNMProcInfo, (nmReqPtr))
 
#define NewNMProc(userRoutine)   NewNMUPP(userRoutine)
 
#define CallNMProc(userRoutine, nmReqPtr)   InvokeNMUPP(nmReqPtr, userRoutine)
 

Typedefs

typedef struct NMRec NMRec
 
typedef NMRecNMRecPtr
 

Enumerations

enum  { uppNMProcInfo = 0x000000C0 }
 

Functions

typedef CALLBACK_API (void, NMProcPtr)(NMRecPtr nmReqPtr)
 
typedef STACK_UPP_TYPE (NMProcPtr) NMUPP
 
NMUPP NewNMUPP (NMProcPtr userRoutine)
 
void DisposeNMUPP (NMUPP userUPP)
 
void InvokeNMUPP (NMRecPtr nmReqPtr, NMUPP userUPP)
 
OSErr NMInstall (NMRecPtr nmReqPtr)
 Add a notification request to the notification queue. More...
 
OSErr NMRemove (NMRecPtr nmReqPtr)
 Remove a notification request from the notification queue. More...
 

Detailed Description

Notification Manager interfaces.

Introduced In: System 7.5
Avaliable From: Universal Interfaces 3.4.1
Copyright: © 1989-2001 by Apple Computer, Inc., all rights reserved

For bug reports, consult the following page on the World Wide Web:

http://developer.apple.com/bugreporter/

Macro Definition Documentation

◆ NewNMProc

#define NewNMProc (   userRoutine)    NewNMUPP(userRoutine)

support for pre-Carbon UPP routines: New...Proc and Call...Proc

◆ NewNMUPP

#define NewNMUPP (   userRoutine)
Value:
(NMUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppNMProcInfo, \
GetCurrentArchitecture())
UniversalProcPtr NewRoutineDescriptor(ProcPtr theProc, ProcInfoType theProcInfo, ISAType theISA)

pascal no_return_value Func(4_bytes)

Function Documentation

◆ DisposeNMUPP()

void DisposeNMUPP ( NMUPP  userUPP)

DisposeNMUPP()

Non-Carbon CFM: available as macro/inline
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ InvokeNMUPP()

void InvokeNMUPP ( NMRecPtr  nmReqPtr,
NMUPP  userUPP 
)

InvokeNMUPP()

Non-Carbon CFM: available as macro/inline
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ NewNMUPP()

NMUPP NewNMUPP ( NMProcPtr  userRoutine)

NewNMUPP()

Non-Carbon CFM: available as macro/inline
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ NMInstall()

OSErr NMInstall ( NMRecPtr  nmReqPtr)

Add a notification request to the notification queue.

CALL_NOT_IN_CARBON

NMInstall adds a notification request to the notification queue.
nmReqPtr is a pointer to an NMRec data structure.
Returns
an error code. It will be one of:
noErr(0) No error
nmTypErr (-299)Wrong qType (must be 8)
Note
NMInstall neither moves nor purges memory and you can call it from
completion routines, interrupt handlers, the main body of an application
program and from the response procedure of a notification request
The system automatically initializes the Notification Manager when it
boots. You call NMInstall when you want to add a request to the queue.
However, before calling NMInstall , you need to see if your application is
running in the background. If it is, make this call to install the notification
event.
err = NMInstall (( NMRecPtr ) &myNote);
If your application is in the foreground, Notification Manager generally
isn't needed.
If NMInstall returns an error, you can't install the notification event.
Wait for the user to switch your application to the foreground before
proceeding with anything else. If you installed the notification successfully,
make sure you remove it with code like this when your application is
switched back into the foreground:
err = NMRemove (( QElemPtr ) &myNote);
Glue for the Notification Manager is available in System 6.0 and later.
If you do not yet have glue for NMInstall , you can use the following:
Pascal
FUNCTION NMInstall (nmReqPtr: QElemPtr) : OSErr;
NLINE 0x205F, 0xA05E, 0x3E80;
C
pascal OSErr NMInstall (QElemPtr nmReqPtr) = {0x205F, 0xA05E,
0x3E80};
Copyright: THINK Reference © 1991-1992 Symantec Corporation
Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ NMRemove()

OSErr NMRemove ( NMRecPtr  nmReqPtr)

Remove a notification request from the notification queue.

NMRemove removes a notification request procedure from the notification
queue.
nmReqPtr is a pointer to the NMRec that you want to remove.
Returns
an error code. It will be one of:
noErr(0) No error
qErr (-1) Not in queue
nmTypErr (-299)Wrong qType (must be ORD(nmType))
Note
NMRemove neither moves nor purges memory and you can call it from
completion routines, interrupt handlers, the main body of an application
program and from the response procedure of a notification request
If you do not yet have glue for NMRemove , you can use the following:
Pascal
FUNCTION NMRemove (nmReqPtr: QElemPtr) : OSErr;
INLINE 0x205F, 0xA05F, 0x3E80;
C
pascal OSErr NMRemove (QElemPtr nmReqPtr)
= {0x205F, 0xA05F, 0x3E80};
Also note that qType must be set to ORD(nmType), which is 8.
See NMInstall for a code example using the Notification Manager .
Copyright: THINK Reference © 1991-1992 Symantec Corporation
Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later