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

StreamWrite()

StreamError StreamWrite (
        GeodeHandle 		driver,
        StreamToken 		stream,
        StreamBlocker 		blocker,
        word 		buffSize,
        const byte *		buffer,
        word *		numBytesWritten);

This routine writes data to a stream. The routine takes the following arguments:

driver
The GeodeToken of the stream driver.
stream
The StreamToken of the stream.
blocker
Specify whether to block if there is not enough room to write all the data.
buffsize
Size of passed data buffer (i.e. amount of data to write to stream).
buffer
Pointer to data to write to stream.
*numBytesWritten
StreamWrite() will write to this variable the number of bytes actually written to the stream.

If StreamWrite() is successful, it returns zero. If it is unsuccessful, or could not write all the data to the stream, it returns a member of the StreamError enumerated type.

StreamWriteByte()

StreamError StreamWriteByte (
        GeodeHandle 		driver,
        StreamToken 		stream,
        StreamBlocker 		blocker,
        byte 		dataByte);

This routine writes a single byte to a stream. It takes the following arguments:

driver
The GeodeToken of the stream driver.
stream
The StreamToken of the stream.
blocker
Specify whether to block if there is not enough room to write the data.
dataByte
Write this byte to the stream.

If the routine is successful, it returns zero. If it is unsuccessful, it returns a member of the StreamError enumerated type.

SysGetConfig()

dword	SysGetConfig();

This routine returns a set of values defining the system configuration. The returned dword contains four byte values, listed below from least significant byte to most significant byte:

configuration flags
This byte contains a record of SysConfigFlags reflecting the system status. This record includes information on how the system was started, whether Swat is running it, whether the system was restarted, etc.
reserved byte
This byte contains reserved information unusable by applications.
processor type
This byte contains a value reflecting the processor type of the machine running GEOS. This is of type SysProcessorType and is one of SPT_8088, SPT_8086, SPT_80186, SPT_80286, SPT_80386, or SPT_80486. Use the macro SGC_PROCESSOR() to extract this value from the returned dword.
machine type
This byte contains a value of SysMachineType indicating the type of the machine running GEOS. It may be one of the following values: SMT_UNKNOWN, SMT_PC, SMT_PC_CONV, SMT_PC_JR, SMT_PC_XT, SMT_PC_XT_286, SMT_PC_AT, SMT_PS2_30, SMT_PS2_50, SMT_PS2_60, SMT_PS2_80, or SMT_PS1. Use the macro SGC_MACHINE() to extract this value from the returned dword.

Include: system.h

SysGetDosEnvironment()

Boolean	SysGetDosEnvironment( /* true if error (not found) */
        const char		* variable,				/* environment variable */
        char		* buffer,				/* buffer for return value */
        word		bufSize);				/* maximum return string length */

This routine looks up a specified DOS environment variable in the environment buffer. It takes three parameters:

variable
A pointer to the null-terminated character string representing the name of the variable to be searched for.
buffer
A pointer to a locked or fixed buffer in which the variable's value will be returned.
bufSize
The size of the passed buffer in bytes (the maximum number of characters that can be returned including the terminating null character).

If the variable is not found, the error flag returned will be true .

Include: system.h

SysGetECLevel()

ErrorCheckingFlags SysGetECLevel(
        MemHandle * checksumBlock);

This routine checks the current error-checking level of the system. The returned record of ErrorCheckingFlags describes which levels of error checking are turned on and which are off. If checksum error checking (ECF_BLOCK_CHECKSUM) is on, pass a pointer to the handle of a block on which the checksum will be done.

Include: ec.h

SysGetInfo()

dword	SysGetInfo(
        SysGetInfoType info);			/* type of information to retrieve */

This routine returns general system information. Pass the type of information to be returned; the value returned depends on the type passed in info . Note that the largest returned value is a dword; many different return values should be cast to the appropriate type when calling SysGetInfo() .

The info parameter (of SysGetInfoType ) can have one of the following values:

SGIT_TOTAL_HANDLES
Returns the total number of handles in the kernel's handle table.
SGIT_HEAP_SIZE
Returns the total heap size in bytes.
SGIT_LARGEST_FREE_BLOCK
Returns the size (in bytes) of the largest possible block that may be allocated at the moment.
SGIT_TOTAL_COUNT
Returns the total number of clock ticks since the current session of GEOS started (subtracts the initial system clock value from the current time).
SGIT_NUMBER_OF_VOLUMES
Returns the total number of volumes registered with the system.
SGIT_TOTAL_GEODES
Returns the total number of geodes currently loaded.
SGIT_NUMBER_OF_PROCESSES
Returns the total number of processes currently loaded.
SGIT_NUMBER_OF_LIBRARIES
Returns the total number of libraries currently loaded.
SGIT_NUMBER_OF_DRIVERS
Returns the total number of drivers currently loaded.
SGIT_CPU_SPEED
Returns the CPU speed of the processor. The value returned will be ten times the ratio of the CPU speed relative to a base XT processor.
SGIT_SYSTEM_DISK
Returns the disk handle of the disk on which GEOS (the GEOS.INI file) resides.
SGIT_UI_PROCESS

Include: sysstats.h


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