![]() |
![]() |
![]() |
![]() |
FeatureMgr.h.
Err FtrGet (UInt32 creator, UInt16 featureNum, UInt32 *valueP)
|   |
|
Creator ID, which must be registered with Palm Computing®. This is usually the same as the creator ID for the application that owns this feature. |
|   |
|
Feature number of the feature. |
|   |
|
Value of the feature is returned here. |
ftrErrNoSuchFtr if the specified feature number doesn't exist for the specified creator.
FtrSet
Err FtrGetByIndex (UInt16 index, Boolean romTable, UInt32 *creatorP, UInt16 *numP, UInt32 *valueP)
|   |
|
Index of feature. |
|   |
|
If true, index into ROM table; otherwise, index into RAM table. |
|   |
|
Feature creator is returned here. |
|   |
|
Feature number is returned here. |
|   |
|
Feature value is returned here. |
ftrErrNoSuchFeature if the index is out of range.
ftrErrNoSuchFeature, it should pass indices for each table (ROM, RAM) starting at 0 and incrementing. Note that in Palm OS 3.1 and higher, the RAM feature table serves the entire system. At system startup, the values in the ROM feature table are copied into the RAM feature table.
FtrPtrNew.
Err FtrPtrFree (UInt32 creator, UInt16 featureNum)
|   |
|
The creator ID for the feature. |
|   |
|
Feature number of the feature. |
ftrErrNoSuchFtr if an error occurs.
Err FtrPtrNew (UInt32 creator, UInt16 featureNum, UInt32 size, void **newPtrP)
|   |
|
Creator ID, which must be registered with Palm Computing. This is usually the same as the creator ID for the application that owns this feature. |
|   |
|
Feature number of the feature. |
|   |
|
Size in bytes of the temporary memory to allocate. The maximum chunk size is 64K. |
|   |
|
Pointer to the memory chunk is returned here. |
memErrInvalidParam if the value of size is 0, or memErrNotEnoughSpace if there is not enough space to allocate a chunk of the specified size.
newPtrP. The memory chunk remains allocated and locked until the next system reset or until you free the chunk with FtrPtrFree.
FtrPtrNew is useful if you want quick, efficient access to data that persists from one invocation of the application to the next. FtrPtrNew stores values on the storage heap rather than the dynamic heap, where free space is often extremely limited. The disadvantage to using feature memory is that writing to storage memory is slower than writing to dynamic memory.
NOTE:  Starting withPalm OS 3.5 FtrPtrNewallows allocating chunks larger than 64k. Do keep in mind standard issues with allocating large chunks of memory: there might not be enough contiguous space, and it can impact system performance.
FtrGet. To write to the chunk, you must use DmWrite because the chunk is in the storage heap, not the dynamic heap.
FtrPtrNew(appCreator,
myFtrMemFtr, 32, &ftrMem);void* data; if (!FtrGet(appCreator,
myFtrMemFtr, (UInt32*)&data))    DmWrite(data, 0, &someVal, sizeof(someVal));FtrPtrResize
Err FtrPtrResize (UInt32 creator, UInt16 featureNum, UInt32 newSize, void **newPtrP)
|   |
|
The creator ID for the feature. |
|   |
|
Feature number of the feature. |
|   |
|
New size in bytes for the chunk. |
|   |
|
Pointer to the memory chunk is returned here. |
ftrErrNoSuchFtr if the specified feature number doesn't exist for the specified creator, memErrInvalidParam if newSize is 0, or memErrNotEnoughSpace if there's not enough free space available to allocate a chunk of that size.
FtrPtrNew.
MemHandleResize
Err FtrSet (UInt32 creator, UInt16 featureNum, UInt32 newValue)
|   |
|
Creator ID, which must be registered with Palm Computing. This is usually the same as the creator ID for the application that owns this feature. |
|   |
|
Feature number for this feature. |
|   |
|
New value. |
memErrNotEnoughSpace if the feature table must be resized to add a new feature and no space is available.
FtrUnregister.
FtrGet, FtrPtrNew
Err FtrUnregister (UInt32 creator, UInt16 featureNum)
|   |
|
Creator ID for the feature. |
|   |
|
Feature number of the feature. |
ftrErrNoSuchFeature if the specified feature number doesn't exist for the specified creator.
|   | ![]() |
![]() |
![]() |
![]() |
  |