Up: GEOS SDK TechDocs | Up | Prev: SysGetPenMode() ... | Next: TextSearchInString() ...

SysShutdown()

Boolean	SysShutdown(
        SysShutdownType type,
        ...);

This routine causes the system to shut down, exiting to the native operating system (typically DOS). It takes variable parameters depending on the first parameter. The first parameter is the type of shutdown requested, and it determines the calling format of the routine. SysShutdown() returns a Boolean value dependent on the type of shutdown.

The parameters and calling format for this routine depend on the value in the type parameter. The possible values ( SysShutdownType ) are listed below with the associated parameter and return information.

SST_CLEAN
Shut down all applications cleanly, allowing any that wish to to abort the shutdown. The routine will return true if a system shutdown is already in progress at the time of the call. This type of shutdown will send MSG_META_CONFIRM_SHUTDOWN to all objects registered on the MANUFACTURER_ID_GEOWORKS:GCNSLT_SHUTDOWN_CONTROL GCN list (but only if the shutdown is not cancelled). Each object on that list must return an acknowledgment of the shutdown. The parameter format and parameters are
Boolean SysShutdown(
	SysShutdownType			type,
	optr			notificationOD,
	Message			msg);
notificationOD
The optr of an object which will receive the message passed in msg after the shutdown has been acknowledged. Pass a null optr to use the default notification ( MSG_META_DETACH sent to the UI).
msg
The message to be sent to the object in notificationOD .
SST_CLEAN_FORCED
Shut down all applications cleanly without the possibility of cancellation. This type takes no additional parameters and does not allow other geodes to abort the shutdown. It will return, but the return value will be meaningless.
SST_DIRTY
Attempt to exit device drivers and close all files without shutting down applications. Does not return. The parameters of this type are
Boolean SysShutdown{
	SysShutdownType			type,		/* SST_DIRTY */
	const char			* reason);
The reason parameter is a pointer to a text string presented to the user as a reason for the dirty shutdown. The string is null-terminated. Pass -1 if no reason is to be given.
SST_PANIC
Exit system device drivers (GA_SYSTEM) without exiting applications or closing files. This can be bad for the system and should be used only in emergency situations. This type of shutdown takes no additional parameters and does not return.
SST_REBOOT
This is used by GEOS when the user hits Ctrl-Alt-Del . Applications should not call it.
SST_RESTART
This is like SST_CLEAN_FORCED above, but it reloads GEOS after shutting down rather than exit completely. It takes no additional parameters; it will return TRUE if the system could not be restarted, FALSE if the shutdown has been initiated.
SST_FINAL
Perform the final phase of a shutdown. This routine is called only by the UI when the SST_CLEAN_FORCED shutdown is complete. This type does not return, and it takes one additional parameter. The calling format and parameters of this type are
Boolean SysShutdown(
	SysShutdownType			type,
	const char			* reason);
The reason parameter is a character string explaining the reason (typically an error) for the final shutdown.
SST_SUSPEND
Suspend system operation in preparation for task switching, and broadcast MSG_META_CONFIRM_SHUTDOWN to all objects on the MANUFACTURER_ID_GEOWORKS:GCNSLT_SHUTDOWN_CONTROL GCN list (see MetaClass ). All notified objects must return acknowledgment of the shutdown. This type of SysShutdown() returns true if another system shutdown is already in progress. It takes two additional parameters:
Boolean SysShutdown(
	SysShutdownType			type,
	optr			notificationOD,
	Message			msg);
notificationOD
The optr of an object which will receive the message passed in msg after the shutdown has been acknowledged. Pass a null optr to use the default notification ( MSG_META_DETACH sent to the UI), though this is not usually the intent of the call.
msg
The message to be sent to the object in notificationOD .
SST_CONFIRM_START
Called by the recipient of MSG_META_CONFIRM_SHUTDOWN ; this allows shutdown confirmation dialog boxes to be presented in order to the user. The caller of this type will be blocked until all previous callers have finished their confirmation procedure. When SysShutdown() returns, the caller may present its confirmation dialog and continue or abort the shutdown. If SysShutdown() returns true from a call with this type, the caller should not present the confirmation dialog to the user and need not call SysShutdown() with SST_CONFIRM_END; another thread has already cancelled the shutdown. This type takes no additional parameters.
SST_CONFIRM_END
The counterpart of SST_CONFIRM_START, this ends the confirmation sequence in an object's MSG_META_CONFIRM_SHUTDOWN handler. It takes one additional parameter and returns nothing. The calling format is shown below:
void	SysShutdown(
	SysShutdownType			type,
	Boolean			confirm);
The confirm parameter should be TRUE if the shutdown is to be continued, FALSE if the shutdown should be aborted.

Include: system.h

Warnings: Most applications should not call SysShutdown() . Any that do should do so with extreme care.

SysStatistics()

void	SysStatistics(
        SysStats * stats);			/* returned statistics */

This routine returns system performance statistics. Pass it a pointer to an empty SysStats structure; the routine will fill in the appropriate fields. SysStats has the following structure:

typedef struct {
    dword			SS_idleCount;
    SysSwapInfo			SS_swapOuts;
    SysSwapInfo			SS_swapIns;
    word			SS_contextSwitches;
    word			SS_interrupts;
    word			SS_runQueue;
} SysStats;

Include: sysstats.h

SysUnlockBIOS()

void	SysUnlockBIOS(void);

 


Up: GEOS SDK TechDocs | Up | Prev: SysGetPenMode() ... | Next: TextSearchInString() ...