Mac OS 9
NameRegistry.h File Reference

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 RegEntryIDRegEntryIDPtr
 
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)
 

Detailed Description

NameRegistry Interfaces.

Introduced In: MacOS
Avaliable From: Universal Interfaces 3.4.1
Copyright: © 1993-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/

Typedef Documentation

◆ RegCStrEntryName

typedef char RegCStrEntryName

Entry Names are single byte ASCII

◆ RegCStrEntryNameBuf

typedef char RegCStrEntryNameBuf[48]

length of RegCStrEntryNameBuf = kRegCStrMaxEntryNameLength+1

◆ RegEntryIter

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

◆ RegPropertyIter

typedef struct OpaqueRegPropertyIter* RegPropertyIter

Traversing the Properties of a name CALL_NOT_IN_CARBON

◆ RegPropertyValue

typedef void* RegPropertyValue

Value of a property

◆ RegPropertyValueSize

typedef UInt32 RegPropertyValueSize

Length of property value

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

Max length of Entry Name

◆ anonymous enum

anonymous enum
Enumerator
kRegEntryNameTerminator 

0x3A

kRegPathNameTerminator 

'\0'

◆ anonymous enum

anonymous enum
Enumerator
kRegPropertyNameTerminator 

Max length of Property Name

◆ anonymous enum

anonymous enum
Enumerator
kRegIterRoot 

Absolute locations

kRegIterParents 

"Upward" Relationships

kRegIterChildren 

include all parent(s) of entry "Downward" Relationships

kRegIterSubTrees 

include all children

kRegIterDescendants 

include all sub trees of entry

kRegIterSibling 

include all descendants of entry "Horizontal" Relationships

kRegIterContinue 

include all siblings Keep doing the same thing

◆ anonymous enum

anonymous enum
Enumerator
kRegUniversalModifierMask 

no entry modifiers in place

kRegNameSpaceModifierMask 

mods to all entries

kRegModifierMask 

mods to all entries within namespace

◆ anonymous enum

anonymous enum

Universal Property Modifiers

Enumerator
kRegPropertyValueIsSavedToDisk 

property is non-volatile (saved in NVRAM)

◆ anonymous enum

anonymous enum

NameRegistry version, Gestalt/PEF-style – MUST BE KEPT IN SYNC WITH MAKEFILE !!

◆ anonymous enum

anonymous enum

///////////////////////

The Registry API

///////////////////// NameRegistry dispatch indexes

Enumerator
kSelectRegistryHighestSelector 

if you add more selectors here, remember to change 'kSelectRegistryHighestSelector' below

Function Documentation

◆ RegistryCStrEntryCreate()

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()

Non-Carbon CFM: in NameRegistryLib 1.0 and later
Carbon Lib: not available
Mac OS X: not available

◆ RegistryCStrEntryLookup()

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()

Non-Carbon CFM: in NameRegistryLib 1.0 and later
Carbon Lib: not available
Mac OS X: not available

◆ RegistryCStrEntryToName()

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()

Non-Carbon CFM: in NameRegistryLib 1.0 and later
Carbon Lib: not available
Mac OS X: not available

◆ RegistryCStrEntryToPath()

OSStatus RegistryCStrEntryToPath ( const RegEntryID entryID,
RegCStrPathName *  pathName,
RegPathNameSize  pathSize 
)

RegistryCStrEntryToPath()

Non-Carbon CFM: in NameRegistryLib 1.0 and later
Carbon Lib: not available
Mac OS X: not available

◆ RegistryEntryCopy()

OSStatus RegistryEntryCopy ( RegEntryID parentEntryID,
RegEntryID sourceDevice,
RegEntryID destDevice 
)

RegistryEntryCopy()

Non-Carbon CFM: in NameRegistryLib 1.0 and later
Carbon Lib: not available
Mac OS X: not available

◆ RegistryEntryDelete()

OSStatus RegistryEntryDelete ( const RegEntryID id)

RegistryEntryDelete()

Non-Carbon CFM: in NameRegistryLib 1.0 and later
Carbon Lib: not available
Mac OS X: not available

◆ RegistryEntryGetMod()

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()

Non-Carbon CFM: in NameRegistryLib 1.0 and later
Carbon Lib: not available
Mac OS X: not available

◆ RegistryEntryIDCompare()

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()

Non-Carbon CFM: in NameRegistryLib 1.0 and later
Carbon Lib: not available
Mac OS X: not available

◆ RegistryEntryIDCopy()

OSStatus RegistryEntryIDCopy ( const RegEntryID src,
RegEntryID dst 
)

Copy an EntryID RegistryEntryIDCopy()

Non-Carbon CFM: in NameRegistryLib 1.0 and later
Carbon Lib: not available
Mac OS X: not available

◆ RegistryEntryIDDispose()

OSStatus RegistryEntryIDDispose ( RegEntryID id)

Free an ID so it can be reused. RegistryEntryIDDispose()

Non-Carbon CFM: in NameRegistryLib 1.0 and later
Carbon Lib: not available
Mac OS X: not available

◆ RegistryEntryIDInit()

OSStatus RegistryEntryIDInit ( RegEntryID id)

///////////////////////

Entry Management

/////////////////////


EntryID handling Initialize an EntryID to a known invalid state note: invalid != uninitialized RegistryEntryIDInit()

Non-Carbon CFM: in NameRegistryLib 1.0 and later
Carbon Lib: not available
Mac OS X: not available

◆ RegistryEntryIterate()

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()

Non-Carbon CFM: in NameRegistryLib 1.0 and later
Carbon Lib: not available
Mac OS X: not available

◆ RegistryEntryIterateCreate()

OSStatus RegistryEntryIterateCreate ( RegEntryIter cookie)

create/dispose the iterator structure defaults to root with relationship = kRegIterDescendants RegistryEntryIterateCreate()

Non-Carbon CFM: in NameRegistryLib 1.0 and later
Carbon Lib: not available
Mac OS X: not available

◆ RegistryEntryIterateDispose()

OSStatus RegistryEntryIterateDispose ( RegEntryIter cookie)

RegistryEntryIterateDispose()

Non-Carbon CFM: in NameRegistryLib 1.0 and later
Carbon Lib: not available
Mac OS X: not available

◆ RegistryEntryIterateSet()

OSStatus RegistryEntryIterateSet ( RegEntryIter cookie,
const RegEntryID startEntryID 
)

set Entry Iterator to specified entry RegistryEntryIterateSet()

Non-Carbon CFM: in NameRegistryLib 1.0 and later
Carbon Lib: not available
Mac OS X: not available

◆ RegistryEntryMod()

OSStatus RegistryEntryMod ( RegEntryIter cookie,
RegEntryIterationOp  relationship,
RegEntryID foundEntry,
Boolean done,
RegEntryModifiers  matchingModifiers 
)

Iterator operator for entry modifier search RegistryEntryMod()

Non-Carbon CFM: in NameRegistryLib 1.0 and later
Carbon Lib: not available
Mac OS X: not available

◆ RegistryEntryPropertyMod()

OSStatus RegistryEntryPropertyMod ( RegEntryIter cookie,
RegEntryIterationOp  relationship,
RegEntryID foundEntry,
Boolean done,
RegPropertyModifiers  matchingModifiers 
)

Iterator operator for entries with matching property modifiers RegistryEntryPropertyMod()

Non-Carbon CFM: in NameRegistryLib 1.0 and later
Carbon Lib: not available
Mac OS X: not available

◆ RegistryEntrySearch()

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()

Non-Carbon CFM: in NameRegistryLib 1.0 and later
Carbon Lib: not available
Mac OS X: not available

◆ RegistryEntrySetMod()

OSStatus RegistryEntrySetMod ( const RegEntryID entry,
RegEntryModifiers  modifiers 
)

RegistryEntrySetMod()

Non-Carbon CFM: in NameRegistryLib 1.0 and later
Carbon Lib: not available
Mac OS X: not available

◆ RegistryEntryToPathSize()

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()

Non-Carbon CFM: in NameRegistryLib 1.0 and later
Carbon Lib: not available
Mac OS X: not available

◆ RegistryPropertyCreate()

OSStatus RegistryPropertyCreate ( const RegEntryID entryID,
const RegPropertyName *  propertyName,
const void *  propertyValue,
RegPropertyValueSize  propertySize 
)

//////////////////////////////////////////////////////

Property Management

////////////////////////////////////////////////////


Adding and removing properties RegistryPropertyCreate()

Non-Carbon CFM: in NameRegistryLib 1.0 and later
Carbon Lib: not available
Mac OS X: not available

◆ RegistryPropertyDelete()

OSStatus RegistryPropertyDelete ( const RegEntryID entryID,
const RegPropertyName *  propertyName 
)

RegistryPropertyDelete()

Non-Carbon CFM: in NameRegistryLib 1.0 and later
Carbon Lib: not available
Mac OS X: not available

◆ RegistryPropertyGet()

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()

Non-Carbon CFM: in NameRegistryLib 1.0 and later
Carbon Lib: not available
Mac OS X: not available

◆ RegistryPropertyGetMod()

OSStatus RegistryPropertyGetMod ( const RegEntryID entry,
const RegPropertyName *  name,
RegPropertyModifiers *  modifiers 
)

Get and Set operators for property modifiers RegistryPropertyGetMod()

Non-Carbon CFM: in NameRegistryLib 1.0 and later
Carbon Lib: not available
Mac OS X: not available

◆ RegistryPropertyGetSize()

OSStatus RegistryPropertyGetSize ( const RegEntryID entryID,
const RegPropertyName *  propertyName,
RegPropertyValueSize propertySize 
)

Get the value of the specified property for the specified entry. RegistryPropertyGetSize()

Non-Carbon CFM: in NameRegistryLib 1.0 and later
Carbon Lib: not available
Mac OS X: not available

◆ RegistryPropertyIterate()

OSStatus RegistryPropertyIterate ( RegPropertyIter cookie,
RegPropertyName *  foundProperty,
Boolean done 
)

RegistryPropertyIterate()

Non-Carbon CFM: in NameRegistryLib 1.0 and later
Carbon Lib: not available
Mac OS X: not available

◆ RegistryPropertyIterateCreate()

OSStatus RegistryPropertyIterateCreate ( const RegEntryID entry,
RegPropertyIter cookie 
)

RegistryPropertyIterateCreate()

Non-Carbon CFM: in NameRegistryLib 1.0 and later
Carbon Lib: not available
Mac OS X: not available

◆ RegistryPropertyIterateDispose()

OSStatus RegistryPropertyIterateDispose ( RegPropertyIter cookie)

RegistryPropertyIterateDispose()

Non-Carbon CFM: in NameRegistryLib 1.0 and later
Carbon Lib: not available
Mac OS X: not available

◆ RegistryPropertyRename()

OSStatus RegistryPropertyRename ( const RegEntryID entry,
const RegPropertyName *  oldName,
const RegPropertyName *  newName 
)

RegistryPropertyRename()

Non-Carbon CFM: in NameRegistryLib 1.0 and later
Carbon Lib: not available
Mac OS X: not available

◆ RegistryPropertySet()

OSStatus RegistryPropertySet ( const RegEntryID entryID,
const RegPropertyName *  propertyName,
const void *  propertyValue,
RegPropertyValueSize  propertySize 
)

RegistryPropertySet()

Non-Carbon CFM: in NameRegistryLib 1.0 and later
Carbon Lib: not available
Mac OS X: not available

◆ RegistryPropertySetMod()

OSStatus RegistryPropertySetMod ( const RegEntryID entry,
const RegPropertyName *  name,
RegPropertyModifiers  modifiers 
)

RegistryPropertySetMod()

Non-Carbon CFM: in NameRegistryLib 1.0 and later
Carbon Lib: not available
Mac OS X: not available