![]() |
![]() |
![]() |
![]() |
SystemMgr.h and SysUtils.h.
Err SysAppLaunch (UInt16 cardNo, LocalID dbID, UInt16 launchFlags, UInt16 cmd, MemPtr cmdPBP, UInt32* resultP)
|   |
|
cardNo and dbID identify the application. |
|   |
|
Set to 0. |
|   |
|
Launch code. |
|   |
|
Launch code parameter block. |
|   |
|
Pointer to what's returned by the application's PilotMain routine. |
sysErrParamErr, memErrNotEnoughSpace, sysErrOutOfOwnerIDs.
keyDownEvent that contains a launchChr, as shown in the section "Application Launcher" of the user interface chapter in the Palm OS Programmer's Companion.
sysAppLaunchFlagNewThread is set, and you are passing a parameter block (the cmdPBP parameter), you must set the owner of the parameter block chunk to the operating system. To do this, and for more information, see MemPtrSetOwner. If the parameter block structure contains references by pointer or handle to any other chunks, you also must set the owner of those chunks by using MemHandleSetOwner or MemPtrSetOwner.
NOTE:  For important information regarding the correct use of this function, see the "Application Startup and Stop" chapter in the Palm OS Programmer's Companion.
SysBroadcastActionCode, SysUIAppSwitch, SysCurAppDatabase
set to false to retrieve battery settings. (Applications should not change any of the settings).
UInt16 SysBatteryInfo (Boolean set, UInt16* warnThresholdP, UInt16* criticalThresholdP, UInt16* maxTicksP, SysBatteryKind* kindP, Boolean* pluggedIn UInt8* percentP)
|   |
|
If false, parameters with non-NULL pointers are retrieved. Never set this parameter to true. |
|   |
|
Pointer to battery voltage warning threshold in volts*100, or NULL. |
|   |
|
Pointer to the battery voltage critical threshold in volts*100, or NULL. |
|   |
|
Pointer to the battery timeout, or NULL. |
|   |
|
Pointer to the battery kind, or NULL. |
|   |
|
Pointer to pluggedIn return value, or NULL. |
|   |
|
Percentage of power remaining in the battery. |
warnThresholdP and maxTicksP are the battery-warning voltage threshold and time out. If the battery voltage falls below the threshold, or the timeout expires, a lowBatteryChr key event is put on the queue. Normally, applications call SysHandleEvent which calls SysBatteryDialog in response to this event.
criticalThresholdP is the battery voltage threshold. If battery voltage falls below this level, the system turns itself off without warning and doesn't turn on until battery voltage is above it again.
percentP parameter was added. This enhancement is implemented only if 3.0 New Feature Set is present.
SysBatteryInfoV20
false to retrieve battery settings. (Applications should not change any of the settings).
UInt16 SysBatteryInfoV20 (Boolean set, UInt16* warnThresholdP, UInt16* criticalThresholdP, UInt16* maxTicksP, SysBatteryKind* kindP, Boolean* pluggedIn)
|   |
|
If false, parameters with non-NULL pointers are retrieved. Never set this parameter to true. |
|   |
|
Pointer to battery voltage warning threshold in volts*100, or NULL. |
|   |
|
Pointer to the battery voltage critical threshold in volts*100, or NULL. |
|   |
|
Pointer to the battery timeout, or NULL. |
|   |
|
Pointer to the battery kind, or NULL. |
|   |
|
Pointer to pluggedIn return value, or NULL. |
warnThresholdP and maxTicksP are the battery-warning voltage threshold and time out. If the battery voltage falls below the threshold, or the timeout expires, a lowBatteryChr key event is put on the queue. Normally, applications call SysHandleEvent which calls SysBatteryDialog in response to this event.
criticalThresholdP is the battery voltage threshold. If battery voltage falls below this level, the system turns itself off without warning and doesn't turn on until battery voltage is above it again.
SysBatteryInfo. Implemented only if 3.0 New Feature Set is present.
SysBatteryInfo
Boolean SysBinarySearch (void const *baseP, const UInt16 numOfElements, const Int16 width, SearchFuncPtr searchF, void const *searchData, const Int32 other, Int32* position, const Boolean findFirst)
|   |
|
Base pointer to an array of elements |
|   |
|
Number of elements to search, starting at 0 to numOfElements -1. Must be greater than 0. |
|   |
|
Width of an element comparison function. |
|   |
|
Search function. |
|   |
|
Data to search for. This data is passed to the searchF function. |
|   |
|
Data to be passed as the third parameter (the other parameter) to the comparison function. |
|   |
|
Pointer to the position result. |
|   |
|
If set to true, the first matching element is returned. Use this parameter if the array contains duplicate entries to ensure that the first such entry will be the one returned. |
true if an exact match was found. In this case, position points to the element number where the data was found.
false if an exact match was not found. If false is returned, position points to the element number where the data should be inserted if it was to be added to the array in sorted order.
SysInsertionSort or SysQSort to sort the array.
numOfElements - 1).
searchF) prototype is:
Int16 _searchF (void const *searchData, void const *arrayData, Int32 other);Err SysBroadcastActionCode (UInt16 cmd, MemPtr cmdPBP)
sysErrParamErr, memErrNotEnoughSpace, sysErrOutOfOwnerIDs.
SysAppLaunch, Chapter 3, "Application Startup and Stop." of the Palm OS Programmer's Companion
void SysCopyStringResource (Char* string, Int16 theID)
string.
lookupName is true then a name in a tAIN resource is used instead of the database's name and the list is sorted. Only the last version of a database is returned. Databases with multiple versions are listed only once.
Boolean SysCreateDataBaseList (UInt32 type, UInt32 creator, UInt16* dbCount, MemHandle *dbIDs, Boolean lookupName)
|   |
|
Type of database to find (0 for wildcard). |
|   |
|
Creator of database to find (0 for wildcard). |
|   |
|
Pointer to contain count of matching databases. |
|   |
|
Pointer to handle allocated to contain the database list. |
|   |
|
Use tAIN names and sort the list. |
false if no databases were found, true if databases were found. dbCount is updated to the number of databases found; dbIDs is updated to the list of matching databases found.
Boolean SysCreatePanelList (UInt16* panelCount, MemHandle *panelIDs)
|   |
|
Pointer to set to the number of panels. |
|   |
|
Pointer to handle containing a list of panels. |
false if no panels were found, true if panels were found. panelCount is updated to the number of panels found; panelIDs is updated to the IDs of panels found.
Err SysCurAppDatabase (UInt16* cardNoP, LocalID* dbIDP)
|   |
|
Pointer to the card number; 0 or 1. |
|   |
|
Pointer to the database ID. |
SysErrParamErr if an error occurs.
SysAppLaunch, SysUIAppSwitch
Char* SysErrString (Err err, Char* strP, UInt16 maxLen)
|   |
|
Error number |
|   |
|
Pointer to space to form the string |
|   |
|
Size of strP buffer. |
MemHandle SysFormPointerArrayToStrings (Char* c, Int16 stringCount)
|   |
|
Pointer to packed block of strings, each terminated by NULL. |
|   |
|
Count of strings in block. |
Char* SysGetOSVersionString()
MemPtrFree function.
Err SysGetROMToken (UInt16 cardNo, UInt32 token, UInt8 **dataP, UInt16 *sizeP)
|   |
-> |
The card on which the ROM to be queried resides. Currently, no Palm hardware provides multiple cards, so this value must be 0. |
|   |
-> |
The value to retrieve, as specified by one of the following tokens: |
|   |
|
The serial number of the ROM, expressed as a text string with no null terminator. |
|   |
<- |
Pointer to a text buffer that holds the requested value when the function returns. |
|   |
<- |
The number of bytes in the dataP buffer. |
NULL, or if the first byte of the text buffer is 0xFF, then no serial number is available.
Boolean SysGetStackInfo (MemPtr *startPP, MemPtr *endPP)
|   |
|
Upon return, points to the start of the stack. |
|   |
|
Upon return, points to the end of the stack. |
true if the stack has not overflowed, that is, the value of the stack overflow address has not been changed. Returns false if the stack overflow value has been overwritten, meaning that a stack overflow has occurred.
void* SysGetTrapAddress (UInt16 trapNum)
|   |
-> |
One of the routine selectors defined in SysTraps.h (sysTrap...) or CoreTraps.h on Palm OS version 3.5 and higher. |
NULL if an invalid routine selector is passed.
SysGetTrapAddress and you use the address, the wrong function will be called.
void SysGraffitiReferenceDialog (ReferenceType referenceType)
|   |
|
Which reference to display. See GraffitiReference.h for more information. |
UInt32 SysGremlins (GremlinFunctionType selector, GremlinParamsType *params)
|   |
|
The selector for a function to pass to Gremlins. |
|   |
|
Pointer to a parameter block used to pass parameters to the function specified by selector. |
GremlinIsOn, which takes no parameters. GremlinIsOn returns 0 if Gremlins is not running, non-zero if it is running.
GremlinIsOn.
SysGremlins is replaced by the functions defined in the file HostControl.h. Specifically, the one selector supported by SysGremlins is replaced with the function HostGremlinIsRunning. For backward compatibility, SysGremlins is mapped to HostGremlinIsRunning.
Boolean SysHandleEvent (EventPtr eventP)
true if the system handled the event.
EvtGetEvent unless they want to override the default system behavior. However, overriding the default system behavior is almost never appropriate for an application.
EvtProcessSoftKeyStroke, KeyRates
void SysInsertionSort (void* baseP, Int16 numOfElements, Int16 width, const CmpFuncPtr comparF, const Int32 other)
|   |
|
Base pointer to an array of elements. |
|   |
|
Number of elements to sort (must be at least 2). |
|   |
|
Width of an element. |
|   |
|
Comparison function (see Comments). |
|   |
|
Other data passed to the comparison function. |
SysQSort).
DmComparF has 6 parameters.
typedef Int16 DmComparF (void *, void *, Int16 other, SortRecordInfoPtr, SortRecordInfoPtr,MemHandle appInfoH);comparF) has this prototype:
Int comparF (VoidPtr, VoidPtr, Long other);comparF) had this prototype:
Int comparF (BytePtr A, BytePtr B, Long other);SysQSort
void SysKeyboardDialog (KeyboardType kbd)
SysKeyboardDialogV10, FrmSetFocus
void SysKeyboardDialogV10 ()
SysKeyboardDialog.
SysKeyboardDialog, FrmSetFocus
Err SysLibFind (const Char* nameP, UInt16* refNumP)
|   |
|
Pointer to the name of a loaded library. |
|   |
|
Pointer to a variable for returning the library reference number (on failure, this variable is undefined) |
sysErrLibNotFound (if the library is not yet loaded), or another error returned from the library's install entry point.
SysLibLoad). You can check if a library is already loaded by calling SysLibFind and checking for a 0 error return value (it will return a non-zero value if the library is not loaded).
Err SysLibLoad (UInt32 libType, UInt32 libCreator, UInt16* refNumP)
|   |
|
Type of library database. |
|   |
|
Creator of library database. |
|   |
|
Pointer to variable for returning the library reference number (on failure, sysInvalidRefNum is returned in this variable) |
sysErrLibNotFound, sysErrNoFreeRAM, sysErrNoFreeLibSlots, or other error returned from the library's install entry point.
SysLibLoad, it is responsible for unloading the library by calling SysLibRemove and passing it the library reference number returned by SysLibLoad. More information is available in the white paper on shared libraries, which you can find on the Palm developer support web site.
SysLibLoad.
Err SysLibRemove (UInt16 refNum)
sysErrParamErr if the refNum is not a valid library reference number.
SysLibRemove releases the dynamic memory allocated to the shared library's dispatch table, resources, and global variables.
SysQSort multiple times can result in a different order if the records are not completely unique. If you don't want this behavior, use the insertion sort instead (see SysInsertionSort).
void SysQSort (void* baseP, Int16 numOfElements, Int16 width, const CmpFuncPtr comparF, const Int32 other)
|   |
|
Base pointer to an array of elements. |
|   |
|
Number of elements to sort (must be at least 2). |
|   |
|
Width of an element. |
|   |
|
Comparison function. See Comments for SysInsertionSort. |
|   |
|
Other data passed to the comparison function. |
SysInsertionSort
sysRandomMax.
Int16 SysRandom (UInt32 newSeed)
void SysReset (void)
UInt16 SysSetAutoOffTime (UInt16 seconds)
Err SysSetTrapAddress (UInt16 trapNum, void* procP)
|   |
-> |
One of the routine selectors defined in SysTraps.h (sysTrap...) or CoreTraps.h on Palm OS version 3.5 and higher. |
|   |
-> |
Pointer to a function that the trap identified by trapNum is to point to. |
SysErrParamErr if trapNum is greater than the number of traps in the trap table.
SysGetTrapAddress. To patch a system trap in your application, first call SysGetTrapAddress to get the trap address and then save this value somewhere. Next use SysSetTrapAddress to set the trap address to point to your function. Before your application exits, remove the patch by calling SysSetTrapAddress and passing in the original trap address you saved.
WARNING!If your application patches a system trap using this function, you must remove the patch before your application exits. Do not use this mechanism to permanently patch system traps as it may cause unpredictable results for the system and other applications.
Char* SysStringByIndex (UInt16 resID, UInt16 index, Char* strP, UInt16 maxLen)
|   |
|
Resource ID of the string list. |
|   |
|
String to get out of the list. |
|   |
|
Pointer to space to form the string. |
|   |
|
Size of strP buffer. |
Err SysTaskDelay (Int32 delay)
EvtGetEvent
UInt16 SysTicksPerSecond (void)
Err SysUIAppSwitch (UInt16 cardNo, LocalID dbID, UInt16 cmd, MemPtr cmdPBP)
|   |
|
Card number for the new application; currently only card 0 is valid. |
|   |
|
ID of the new application. |
|   |
|
Action code (launch code). |
|   |
|
Action code (launch code) parameter block. |
keyDownEvent that contains a launchChr, as shown in the section "Application Launcher" of the user interface chapter in the Palm OS Programmer's Companion.
cmdPBP parameter), you must set the owner of the parameter block chunk to the operating system. To do this, and for more information, see MemPtrSetOwner. If the parameter block structure contains references by pointer or handle to any other chunks, you also must set the owner of those chunks by using MemHandleSetOwner or MemPtrSetOwner.
|   | ![]() |
![]() |
![]() |
![]() |
  |