MorePalmOS
A development library for developing Palm OS applications

MoreSystemMgr.h File Reference

Functions for working with System Manager. More...

#include "MorePrefix.h"
#include "MoreTypes.h"
#include <SystemMgr.h>

Include dependency graph for MoreSystemMgr.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.


Defines

#define MSysHasTrap(trap)   ( SysGetTrapAddress( sysTrapSysUnimplemented ) != SysGetTrapAddress( trap ) )
 Macro to test if a trap is implemented.

Functions

Boolean MSysRomVersionCompatible (UInt32 requiredVersion, UInt16 launchFlags, UInt16 alertID)
 Check if ROM is of recent version.
Err MSysGetMyCreatorID (CreatorID_t *creatorId)
 Gets the active application's creator code.

Detailed Description

Functions for working with System Manager.

Definition in file MoreSystemMgr.h.


Define Documentation

#define MSysHasTrap trap   )     ( SysGetTrapAddress( sysTrapSysUnimplemented ) != SysGetTrapAddress( trap ) )
 

Macro to test if a trap is implemented.

If you're testing multiple traps, it's more efficient to do this yourself to avoid many calls to SysGetTrapAddress( sysTrapSysUnimplemented ).

Definition at line 37 of file MoreSystemMgr.h.


Function Documentation

Err MSysGetMyCreatorID CreatorID_t creatorId  ) 
 

Gets the active application's creator code.

Definition at line 51 of file MoreSystemMgr.c.

00052 {
00053         InternalCardNum_t card;
00054         LocalID db;
00055         Err err;
00056         err = SysCurAppDatabase( &card, &db );
00057         _reject( err, fail );
00058         err = DmDatabaseInfo( card, db, NULL, NULL, NULL, NULL, NULL, NULL,
00059                                                   NULL, NULL, NULL, NULL, creatorId );
00060         // fall thru
00061 fail:
00062         return err;
00063 }

Boolean MSysRomVersionCompatible UInt32  requiredVersion,
UInt16  launchFlags,
UInt16  alertID
 

Check if ROM is of recent version.

Checks the ROM version of this handheld. If it's less than the required version, displays an alert and returns a non-zero error. No alert will be displayed if the alert id is 0, or if the launch flags indicate that it isn't safe to show an alert.

WARNING: Since this function is called by notifications, you need to make sure it is linked into your main segment.

Definition at line 25 of file MoreSystemMgr.c.

00027 {
00028         UInt16 safeToCallAlertFlags;
00029         UInt32 romVersion;
00030 
00031         // See if we're on in minimum required version of the ROM or later.
00032         FtrGet( sysFtrCreator, sysFtrNumROMVersion, &romVersion );
00033         _require( romVersion >= requiredVersion, fail );
00034         return errNone;
00035 fail:
00036         safeToCallAlertFlags =
00037                 sysAppLaunchFlagNewGlobals | sysAppLaunchFlagUIApp;
00038         if ( ( launchFlags & ( safeToCallAlertFlags ) )== safeToCallAlertFlags )
00039         {
00040                 if ( alertID )
00041                         FrmAlert( alertID );
00042                 // Pilot 1.0 will continuously relaunch this app unless we switch to
00043                 // a safe one.
00044                 if ( romVersion < sysMakeROMVersion( 2, 0, 0, sysROMStageRelease, 0 ) )
00045                         AppLaunchWithCommand( sysFileCDefaultApp,
00046                                 sysAppLaunchCmdNormalLaunch, NULL );
00047         }
00048         return sysErrRomIncompatible;
00049 }

SourceForge.net Logo