|
Mac OS 9
|
NameRegistry Interfaces. More...
#include <MacTypes.h>Go to the source code of this file.
Data Structures | |
| struct | RegEntryID |
Typedefs | |
| typedef void * | RegPropertyValue |
| typedef UInt32 | RegPropertyValueSize |
| typedef struct RegEntryID | RegEntryID |
| typedef RegEntryID * | RegEntryIDPtr |
| typedef char | RegCStrEntryName |
| typedef char * | RegCStrEntryNamePtr |
| typedef char | RegCStrEntryNameBuf[48] |
| typedef char | RegCStrPathName |
| typedef UInt32 | RegPathNameSize |
| typedef char | RegPropertyNameBuf[32] |
| typedef char | RegPropertyName |
| typedef char * | RegPropertyNamePtr |
| typedef UInt32 | RegIterationOp |
| typedef RegIterationOp | RegEntryIterationOp |
| typedef UInt32 | RegModifiers |
| typedef RegModifiers | RegEntryModifiers |
| typedef RegModifiers | RegPropertyModifiers |
| typedef struct OpaqueRegEntryIter * | RegEntryIter |
| typedef struct OpaqueRegPropertyIter * | RegPropertyIter |
Enumerations | |
| enum | { kRegCStrMaxEntryNameLength = 47 } |
| enum | { kRegPathNameSeparator = ':' , kRegEntryNameTerminator = 0x00 , kRegPathNameTerminator = 0x00 } |
| enum | { kRegMaximumPropertyNameLength = 31 , kRegPropertyNameTerminator = 0x00 } |
| enum | { kRegIterRoot = 0x00000002 , kRegIterParents = 0x00000003 , kRegIterChildren = 0x00000004 , kRegIterSubTrees = 0x00000005 , kRegIterDescendants = 0x00000005 , kRegIterSibling = 0x00000006 , kRegIterContinue = 0x00000001 } |
| enum | { kRegNoModifiers = 0x00000000 , kRegUniversalModifierMask = 0x0000FFFF , kRegNameSpaceModifierMask , kRegModifierMask = (long)0xFF000000 } |
| enum | { kRegPropertyValueIsSavedToNVRAM , kRegPropertyValueIsSavedToDisk } |
| enum | { LatestNR_PEFVersion } |
| enum | { kSelectRegistryEntryIDInit = 0 , kSelectRegistryEntryIDCompare = 1 , kSelectRegistryEntryIDCopy = 2 , kSelectRegistryEntryIDDispose = 3 , kSelectRegistryCStrEntryCreate = 4 , kSelectRegistryEntryDelete = 5 , kSelectRegistryEntryCopy = 6 , kSelectRegistryEntryIterateCreate = 7 , kSelectRegistryEntryIterateDispose = 8 , kSelectRegistryEntryIterateSet = 9 , kSelectRegistryEntryIterate = 10 , kSelectRegistryEntrySearch = 11 , kSelectRegistryCStrEntryLookup = 12 , kSelectRegistryEntryToPathSize = 13 , kSelectRegistryCStrEntryToPath = 14 , kSelectRegistryCStrEntryToName = 15 , kSelectRegistryPropertyCreate = 16 , kSelectRegistryPropertyDelete = 17 , kSelectRegistryPropertyRename = 18 , kSelectRegistryPropertyIterateCreate = 19 , kSelectRegistryPropertyIterateDispose = 20 , kSelectRegistryPropertyIterate = 21 , kSelectRegistryPropertyGetSize = 22 , kSelectRegistryPropertyGet = 23 , kSelectRegistryPropertySet = 24 , kSelectRegistryEntryGetMod = 25 , kSelectRegistryEntrySetMod = 26 , kSelectRegistryPropertyGetMod = 27 , kSelectRegistryPropertySetMod = 28 , kSelectRegistryEntryMod = 29 , kSelectRegistryEntryPropertyMod , kSelectRegistryHighestSelector = kSelectRegistryEntryPropertyMod } |
Functions | |
| OSStatus | RegistryEntryIDInit (RegEntryID *id) |
| Boolean | RegistryEntryIDCompare (const RegEntryID *id1, const RegEntryID *id2) |
| OSStatus | RegistryEntryIDCopy (const RegEntryID *src, RegEntryID *dst) |
| OSStatus | RegistryEntryIDDispose (RegEntryID *id) |
| OSStatus | RegistryCStrEntryCreate (const RegEntryID *parentEntry, const RegCStrPathName *name, RegEntryID *newEntry) |
| OSStatus | RegistryEntryDelete (const RegEntryID *id) |
| OSStatus | RegistryEntryCopy (RegEntryID *parentEntryID, RegEntryID *sourceDevice, RegEntryID *destDevice) |
| OSStatus | RegistryEntryIterateCreate (RegEntryIter *cookie) |
| OSStatus | RegistryEntryIterateDispose (RegEntryIter *cookie) |
| OSStatus | RegistryEntryIterateSet (RegEntryIter *cookie, const RegEntryID *startEntryID) |
| OSStatus | RegistryEntryIterate (RegEntryIter *cookie, RegEntryIterationOp relationship, RegEntryID *foundEntry, Boolean *done) |
| OSStatus | RegistryEntrySearch (RegEntryIter *cookie, RegEntryIterationOp relationship, RegEntryID *foundEntry, Boolean *done, const RegPropertyName *propertyName, const void *propertyValue, RegPropertyValueSize propertySize) |
| OSStatus | RegistryCStrEntryLookup (const RegEntryID *searchPointID, const RegCStrPathName *pathName, RegEntryID *foundEntry) |
| OSStatus | RegistryEntryToPathSize (const RegEntryID *entryID, RegPathNameSize *pathSize) |
| OSStatus | RegistryCStrEntryToPath (const RegEntryID *entryID, RegCStrPathName *pathName, RegPathNameSize pathSize) |
| OSStatus | RegistryCStrEntryToName (const RegEntryID *entryID, RegEntryID *parentEntry, RegCStrEntryName *nameComponent, Boolean *done) |
| OSStatus | RegistryPropertyCreate (const RegEntryID *entryID, const RegPropertyName *propertyName, const void *propertyValue, RegPropertyValueSize propertySize) |
| OSStatus | RegistryPropertyDelete (const RegEntryID *entryID, const RegPropertyName *propertyName) |
| OSStatus | RegistryPropertyRename (const RegEntryID *entry, const RegPropertyName *oldName, const RegPropertyName *newName) |
| OSStatus | RegistryPropertyIterateCreate (const RegEntryID *entry, RegPropertyIter *cookie) |
| OSStatus | RegistryPropertyIterateDispose (RegPropertyIter *cookie) |
| OSStatus | RegistryPropertyIterate (RegPropertyIter *cookie, RegPropertyName *foundProperty, Boolean *done) |
| OSStatus | RegistryPropertyGetSize (const RegEntryID *entryID, const RegPropertyName *propertyName, RegPropertyValueSize *propertySize) |
| OSStatus | RegistryPropertyGet (const RegEntryID *entryID, const RegPropertyName *propertyName, void *propertyValue, RegPropertyValueSize *propertySize) |
| OSStatus | RegistryPropertySet (const RegEntryID *entryID, const RegPropertyName *propertyName, const void *propertyValue, RegPropertyValueSize propertySize) |
| OSStatus | RegistryEntryGetMod (const RegEntryID *entry, RegEntryModifiers *modifiers) |
| OSStatus | RegistryEntrySetMod (const RegEntryID *entry, RegEntryModifiers modifiers) |
| OSStatus | RegistryPropertyGetMod (const RegEntryID *entry, const RegPropertyName *name, RegPropertyModifiers *modifiers) |
| OSStatus | RegistryPropertySetMod (const RegEntryID *entry, const RegPropertyName *name, RegPropertyModifiers modifiers) |
| OSStatus | RegistryEntryMod (RegEntryIter *cookie, RegEntryIterationOp relationship, RegEntryID *foundEntry, Boolean *done, RegEntryModifiers matchingModifiers) |
| OSStatus | RegistryEntryPropertyMod (RegEntryIter *cookie, RegEntryIterationOp relationship, RegEntryID *foundEntry, Boolean *done, RegPropertyModifiers matchingModifiers) |
NameRegistry Interfaces.
For bug reports, consult the following page on the World Wide Web:
http://developer.apple.com/bugreporter/
| typedef char RegCStrEntryName |
Entry Names are single byte ASCII
| typedef char RegCStrEntryNameBuf[48] |
length of RegCStrEntryNameBuf = kRegCStrMaxEntryNameLength+1
| typedef struct OpaqueRegEntryIter* RegEntryIter |
Traversing the namespace
To support arbitrary namespace implementations in the future, I have hidden the form that the place pointer takes. The previous interface exposed the place pointer by specifying it as a RegEntryID.
I have also removed any notion of returning the entries in a particular order, because an implementation might return the names in semi-random order. Many name service implementations will store the names in a hashed lookup table.
Writing code to traverse some set of names consists of a call to begin the iteration, the iteration loop, and a call to end the iteration. The begin call initializes the iteration cookie data structure. The call to end the iteration should be called even in the case of error so that allocated data structures can be freed.
Create(...) do { Iterate(...); } while (!done); Dispose(...);
This is the basic code structure for callers of the iteration interface. CALL_NOT_IN_CARBON
| typedef struct OpaqueRegPropertyIter* RegPropertyIter |
Traversing the Properties of a name CALL_NOT_IN_CARBON
| typedef void* RegPropertyValue |
Value of a property
| typedef UInt32 RegPropertyValueSize |
Length of property value
| anonymous enum |
Max length of Entry Name
| anonymous enum |
| anonymous enum |
| anonymous enum |
| anonymous enum |
NameRegistry version, Gestalt/PEF-style – MUST BE KEPT IN SYNC WITH MAKEFILE !!
| anonymous enum |
| OSStatus RegistryCStrEntryCreate | ( | const RegEntryID * | parentEntry, |
| const RegCStrPathName * | name, | ||
| RegEntryID * | newEntry | ||
| ) |
Adding and removing entries
If (parentEntry) is NULL, the name is assumed to be a rooted path. It is rooted to an anonymous, unnamed root. RegistryCStrEntryCreate()
| OSStatus RegistryCStrEntryLookup | ( | const RegEntryID * | searchPointID, |
| const RegCStrPathName * | pathName, | ||
| RegEntryID * | foundEntry | ||
| ) |
Find a name in the namespace
This is the fast lookup mechanism. NOTE: A reverse lookup mechanism has not been provided because some name services may not provide a fast, general reverse lookup. RegistryCStrEntryLookup()
| OSStatus RegistryCStrEntryToName | ( | const RegEntryID * | entryID, |
| RegEntryID * | parentEntry, | ||
| RegCStrEntryName * | nameComponent, | ||
| Boolean * | done | ||
| ) |
Parse a path name.
Retrieve the last component of the path, and return a spec for the parent. RegistryCStrEntryToName()
| OSStatus RegistryCStrEntryToPath | ( | const RegEntryID * | entryID, |
| RegCStrPathName * | pathName, | ||
| RegPathNameSize | pathSize | ||
| ) |
| OSStatus RegistryEntryCopy | ( | RegEntryID * | parentEntryID, |
| RegEntryID * | sourceDevice, | ||
| RegEntryID * | destDevice | ||
| ) |
| OSStatus RegistryEntryDelete | ( | const RegEntryID * | id | ) |
| OSStatus RegistryEntryGetMod | ( | const RegEntryID * | entry, |
| RegEntryModifiers * | modifiers | ||
| ) |
//////////////////////////////////////////////////////
Modifier Management
//////////////////////////////////////////////////// Modifiers describe special characteristics of names and properties. Modifiers might be supported for some names and not others.
Device Drivers should not rely on functionality specified as a modifier. These interfaces are for use in writing Experts. Get and Set operators for entry modifiers RegistryEntryGetMod()
| Boolean RegistryEntryIDCompare | ( | const RegEntryID * | id1, |
| const RegEntryID * | id2 | ||
| ) |
Compare EntryID's for equality or if invalid
If a NULL value is given for either id1 or id2, the other id is compared with an invalid ID. If both are NULL, the id's are consided equal (result = true). RegistryEntryIDCompare()
| OSStatus RegistryEntryIDCopy | ( | const RegEntryID * | src, |
| RegEntryID * | dst | ||
| ) |
Copy an EntryID RegistryEntryIDCopy()
| OSStatus RegistryEntryIDDispose | ( | RegEntryID * | id | ) |
Free an ID so it can be reused. RegistryEntryIDDispose()
| OSStatus RegistryEntryIDInit | ( | RegEntryID * | id | ) |
///////////////////////
Entry Management
/////////////////////
EntryID handling Initialize an EntryID to a known invalid state note: invalid != uninitialized RegistryEntryIDInit()
| OSStatus RegistryEntryIterate | ( | RegEntryIter * | cookie, |
| RegEntryIterationOp | relationship, | ||
| RegEntryID * | foundEntry, | ||
| Boolean * | done | ||
| ) |
Return each value of the iteration
return entries related to the current entry with the specified relationship RegistryEntryIterate()
| OSStatus RegistryEntryIterateCreate | ( | RegEntryIter * | cookie | ) |
create/dispose the iterator structure defaults to root with relationship = kRegIterDescendants RegistryEntryIterateCreate()
| OSStatus RegistryEntryIterateDispose | ( | RegEntryIter * | cookie | ) |
| OSStatus RegistryEntryIterateSet | ( | RegEntryIter * | cookie, |
| const RegEntryID * | startEntryID | ||
| ) |
set Entry Iterator to specified entry RegistryEntryIterateSet()
| OSStatus RegistryEntryMod | ( | RegEntryIter * | cookie, |
| RegEntryIterationOp | relationship, | ||
| RegEntryID * | foundEntry, | ||
| Boolean * | done, | ||
| RegEntryModifiers | matchingModifiers | ||
| ) |
Iterator operator for entry modifier search RegistryEntryMod()
| OSStatus RegistryEntryPropertyMod | ( | RegEntryIter * | cookie, |
| RegEntryIterationOp | relationship, | ||
| RegEntryID * | foundEntry, | ||
| Boolean * | done, | ||
| RegPropertyModifiers | matchingModifiers | ||
| ) |
Iterator operator for entries with matching property modifiers RegistryEntryPropertyMod()
| OSStatus RegistryEntrySearch | ( | RegEntryIter * | cookie, |
| RegEntryIterationOp | relationship, | ||
| RegEntryID * | foundEntry, | ||
| Boolean * | done, | ||
| const RegPropertyName * | propertyName, | ||
| const void * | propertyValue, | ||
| RegPropertyValueSize | propertySize | ||
| ) |
return entries with the specified property
A NULL RegPropertyValue pointer will return an entry with the property containing any value. RegistryEntrySearch()
| OSStatus RegistryEntrySetMod | ( | const RegEntryID * | entry, |
| RegEntryModifiers | modifiers | ||
| ) |
| OSStatus RegistryEntryToPathSize | ( | const RegEntryID * | entryID, |
| RegPathNameSize * | pathSize | ||
| ) |
Convert an entry to a rooted name string
A utility routine to turn an Entry ID back into a name string. RegistryEntryToPathSize()
| OSStatus RegistryPropertyCreate | ( | const RegEntryID * | entryID, |
| const RegPropertyName * | propertyName, | ||
| const void * | propertyValue, | ||
| RegPropertyValueSize | propertySize | ||
| ) |
//////////////////////////////////////////////////////
Property Management
////////////////////////////////////////////////////
Adding and removing properties RegistryPropertyCreate()
| OSStatus RegistryPropertyDelete | ( | const RegEntryID * | entryID, |
| const RegPropertyName * | propertyName | ||
| ) |
| OSStatus RegistryPropertyGet | ( | const RegEntryID * | entryID, |
| const RegPropertyName * | propertyName, | ||
| void * | propertyValue, | ||
| RegPropertyValueSize * | propertySize | ||
| ) |
(*propertySize) is the maximum size of the value returned in the buffer pointed to by (propertyValue). Upon return, (*propertySize) is the size of the value returned. RegistryPropertyGet()
| OSStatus RegistryPropertyGetMod | ( | const RegEntryID * | entry, |
| const RegPropertyName * | name, | ||
| RegPropertyModifiers * | modifiers | ||
| ) |
Get and Set operators for property modifiers RegistryPropertyGetMod()
| OSStatus RegistryPropertyGetSize | ( | const RegEntryID * | entryID, |
| const RegPropertyName * | propertyName, | ||
| RegPropertyValueSize * | propertySize | ||
| ) |
Get the value of the specified property for the specified entry. RegistryPropertyGetSize()
| OSStatus RegistryPropertyIterate | ( | RegPropertyIter * | cookie, |
| RegPropertyName * | foundProperty, | ||
| Boolean * | done | ||
| ) |
| OSStatus RegistryPropertyIterateCreate | ( | const RegEntryID * | entry, |
| RegPropertyIter * | cookie | ||
| ) |
RegistryPropertyIterateCreate()
| OSStatus RegistryPropertyIterateDispose | ( | RegPropertyIter * | cookie | ) |
RegistryPropertyIterateDispose()
| OSStatus RegistryPropertyRename | ( | const RegEntryID * | entry, |
| const RegPropertyName * | oldName, | ||
| const RegPropertyName * | newName | ||
| ) |
| OSStatus RegistryPropertySet | ( | const RegEntryID * | entryID, |
| const RegPropertyName * | propertyName, | ||
| const void * | propertyValue, | ||
| RegPropertyValueSize | propertySize | ||
| ) |
| OSStatus RegistryPropertySetMod | ( | const RegEntryID * | entry, |
| const RegPropertyName * | name, | ||
| RegPropertyModifiers | modifiers | ||
| ) |