home *** CD-ROM | disk | FTP | other *** search
- /*
- File: SystemNotification.h
-
- Contains: System Notification Service Interfaces.
-
- Version: Technology: System 8
- Release: Universal Interfaces 3.0d3 on Copland DR1
-
- Copyright: © 1984-1996 by Apple Computer, Inc. All rights reserved.
-
- Bugs?: If you find a problem with this file, send the file and version
- information (from above) and the problem description to:
-
- Internet: apple.bugs@applelink.apple.com
- AppleLink: APPLE.BUGS
-
- */
- #ifndef __SYSTEMNOTIFICATION__
- #define __SYSTEMNOTIFICATION__
-
- #ifndef __KERNEL__
- #include <Kernel.h>
- #endif
- #ifndef __FILEMANAGERTYPES__
- #include <FileManagerTypes.h>
- #endif
- #ifndef __NAMEREGISTRY__
- #include <NameRegistry.h>
- #endif
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- #if PRAGMA_IMPORT_SUPPORTED
- #pragma import on
- #endif
-
- #if PRAGMA_ALIGN_SUPPORTED
- #pragma options align=power
- /* the following contents can only be used by compilers that support PowerPC struct alignment */
-
- #if FOR_SYSTEM8_PREEMPTIVE
- /*
- * basic notification data structures and constants
- */
-
- enum {
- kSNSMatchAnyService = '****',
- kSNSMatchAnyKind = '****'
- };
-
- typedef OSType SNSService;
- typedef OSType SNSKind;
- union SNSSubjectVariant {
- char genericSubject[256];
- ObjectID nsObject;
- FSObjectPersistentReference fsPersistence;
- FSEventObjectSubject fsObject;
- FSEventObjectPropertySubject fsObjectProperty;
- RegEntryRef nameRegistryEntry;
- };
- typedef union SNSSubjectVariant SNSSubjectVariant;
-
- typedef SNSSubjectVariant *SNSSubjectVariantPtr;
- struct SNSSubject {
- ByteCount subjectLength;
- SNSSubjectVariant subject;
- };
- typedef struct SNSSubject SNSSubject;
-
- typedef SNSSubject *SNSSubjectPtr;
- struct SNSNotificationHeader {
- SNSService service;
- SNSKind kind;
- SNSSubject subject;
- void * subscriberRefCon;
- ByteCount infoLength;
- };
- typedef struct SNSNotificationHeader SNSNotificationHeader;
-
- typedef SNSNotificationHeader *SNSNotificationHeaderPtr;
- struct SNSNotification {
- SNSNotificationHeader header;
- unsigned char info[1];
- };
- typedef struct SNSNotification SNSNotification;
-
- typedef SNSNotification *SNSNotificationPtr;
- /*
- * producer data structures and constants
- */
-
- enum {
- kSNSFireAndForgetNotification = 0,
- kSNSRequireAllConsumersSucceed = 0x00000001,
- kSNSRequireOneConsumerSucceed = 0x00000002
- };
-
- typedef OptionBits SNSProduceOptions;
- typedef ObjectID SNSDistributorID;
- /*
- * consumer data structures and constants
- */
- typedef ObjectID SNSConsumerID;
- typedef OSType SNSConsumerName;
- /*
- * producer interface
- */
- extern OSStatus SNSFindDistributor(SNSService service, SNSKind kind, Boolean createDistributor, SNSDistributorID *distributor);
-
- extern OSStatus SNSProduce(SNSDistributorID distributor, void *notification, ByteCount notificationLength, void *subject, ByteCount subjectLength, SNSProduceOptions options);
-
- extern OSStatus SNSProduceAsync(SNSDistributorID distributor, void *notification, ByteCount notificationLength, void *subject, ByteCount subjectLength, SNSProduceOptions options, KernelNotificationPtr completion);
-
- /*
- * consumer and subscription interface
- */
- extern OSStatus SNSCreateConsumer(SNSConsumerName name, ItemCount maxPending, SNSConsumerID *consumer);
-
- extern OSStatus SNSDeleteConsumer(SNSConsumerID consumer);
-
- extern OSStatus SNSSubscribe(SNSConsumerID consumer, SNSService service, SNSKind kind, void *subject, ByteCount subjectLength, void *refCon);
-
- extern OSStatus SNSUnsubscribe(SNSConsumerID consumer, SNSService service, SNSKind kind, void *subject, ByteCount subjectLength);
-
- extern OSStatus SNSHold(SNSConsumerID consumer, SNSService service, SNSKind kind, void *subject, ByteCount subjectLength);
-
- extern OSStatus SNSUnhold(SNSConsumerID consumer, SNSService service, SNSKind kind, void *subject, ByteCount subjectLength);
-
- extern OSStatus SNSFlush(SNSConsumerID consumer, SNSService service, SNSKind kind, void *subject, ByteCount subjectLength);
-
- extern OSStatus SNSConsume(SNSConsumerID consumer, SNSNotificationPtr notification, ByteCount maxSize);
-
- extern OSStatus SNSConsumeAsync(SNSConsumerID consumer, SNSNotificationPtr notification, ByteCount maxSize, KernelNotificationPtr completion);
-
- #endif
-
- #pragma options align=reset
- #endif /* PRAGMA_ALIGN_SUPPORTED */
-
- #if PRAGMA_IMPORT_SUPPORTED
- #pragma import off
- #endif
-
- #ifdef __cplusplus
- }
- #endif
-
- #endif /* __SYSTEMNOTIFICATION__ */
-
-