VirtualSerialStatus VirtualSetFormat(
VSSerialFormat format,/* data format */
VSSerialBaud baud); /* baud rate */
Sets the modem's data format and speed. Returns VS_OK if successfully set or VS_CLOSED if stream is not open.
Include:
vserlib.h
VirtualSerialStatus VirtualSerialSetNotify( VSNotifyType notifyTpe, /* Which events, and how they are received */ optr destination, /* Destination object */ word method); /* Message to pass to destination object */
This routine registers a notifier for any of the possible relevant events. The parameter notifyType is set to specify which events should result in the object destination being sent the message method. The notifyType should be set by OR-ing one VSNT_, one VSNE_, and one VSNM_ parameter.
The set of these parameters is:
VSNT_READERVSNE_DATAVSNE_MODEMVSNM_NONEVSNM_MESSAGEnotifyType = VSNT_READER | VSNE_DATA | VSNM_MESSAGE: This will notify the reader for data available using messaging.
This routine returns VS_OK if the notification is successfully registered.
Returns VS_NOT_SUPPORTED if the notifier is not supported.
Returns VS_CLOSED if the stream is not open.
Warning: This is a low-level routine whose use is discouraged in favor of ModemSetRoutineDataNotify(),
ModemSetMessageDataNotify(),
ModemSetRoutineResponseNotify(),
ModemSetMessageResponseNotify(), and
ModemSetMessageEndCallNotify().
Include:
vserlib.h
VirtualSerialStatus VirtualSerialWrite(
VSBlockingMode blocking_mode, /* to block or not to block */
word buffer_size, /* # of bytes of data to write */
const byte *ptr_to_buffer, /* data to write to stream */
word *bytes_written); /* # of bytes actually written */
Writes buffer_size number of bytes of data from the buffer to stream. If there is not enough space in the stream and STREAM_BLOCK was specified in blocking_mode, will block and wait until more space becomes available; if there is not enough space in the stream and STREAM_NO_BLOCK was specified, returns immediately with VS_SHORT_READ_WRITE.
Returns VS_OK if data was successfully written.
Returns VS_CLOSED if stream is not open.
Warning: STREAM_BLOCK is dangerous to use: if the opposite end does not read its data, stream may be constantly full and routine will continue to block for a maximum of two minutes. After two minutes, routine returns VS_SHORT_READ_WRITE and discards the data.
Include: vserlib.h
VirtualSerialStatus VirtualSerialWriteByte(
VSBlockingMode blockingMode, /* To block or not to block... */
byte dataByte); /* Data to write */
This routine writes the byte dataByte into the stream. If the stream is full and blockingMode is set to STREAM_BLOCK then the routine will wait for the request to be filled, or if STREAM_NO_BLOCK is specified the routine will immediately return an error.
Returns VS_OK if data was successfully written.
Returns VS_SHORT_READ_WRITE if the space was not available and STREAM_NO_BLOCK was specified.
Returns VS_CLOSED if the stream is not open.
Warning: STREAM_BLOCK mode is dangerous to use: if the opposite end does not read its data, the stream may be constantly full and this function will block for maximum of two minutes. After two minutes the routine returns VS_SHORT_READ_WRITE and discards the given data.
Include: vserlib.h
See Also: VirtualSerialWrite(),
VirtualSerialReadByte().
extern VMChain VisTextGraphicCompressGraphic(
VisTextGraphic *graphic,
FileHandle sourceFile,
FileHandle destFile,
BMFormat format,
word xRes,
word yRes);
This routine compresses the bitmaps in a VisTextGraphic.
VMBlockHandle VMAlloc(
VMFileHandle file,
word size, /* Size of a file in bytes */
word userID); /* ID # to associate with block */
This routine creates a VM block. The block is not initialized. Before you use the block, you must lock it with
VMLock()
. If you pass a size of zero bytes, the VM block will be given an entry in the VM handle table, but no space in memory or in the file will be used; a global memory block will have to be assigned with
VMAttach()
.
Include: vm.h
See Also: VMAllocLMem(),
VMAttach().
VMBlockHandle VMAllocLmem(
VMFileHandle file,
LMemType ltype, /* Type of LMem heap to create */
word headerSize); /* Size to leave for LMem header...
* pass zero for standard header */
This routine allocates a VM block and initializes it to contain an LMem heap. You must pass the type of LMem heap to create. If you want a fixed data space, you must pass the total size to leave for a header (including the
LMemBlockHeader
); otherwise, pass a zero header size, indicating that only enough space for an
LMemBlockHeader
should be left. You do not need to specify a block size, since the heap will automatically expand to accommodate chunk allocations.
The block's user ID number is undefined. You will need to lock the block with
VMLock()
before accessing the chunks.
Include: vm.h
Warning: When you access chunks, remember to pass the block's global memory handle to the LMem routines (not the block's VM handle).
See Also: LMemInitHeap(),
VMAlloc(),
VMAttach().
VMBlockHandle VMAttach(
VMFileHandle file,
VMBlockHandle vmBlock,
MemHandle mh);
This routine attaches an existing global memory block to a VM block. It is passed the following arguments:
file
VMFileHandle.
vmBlock
VMBlockHandle
, a new VM block will be allocated.
mh
The routine returns the handle of the VM block to which the memory block was attached.
If you attach to a pre-existing VM block, its user ID will be preserved. If you create a new block (by passing a null
vmBlock
argument), the user ID will be undefined.
The block is automatically marked dirty.
Include: vm.h
Boolean VMCheckForModifications(
VMFileHandle file);
This routine returns true if the VM file has been dirtied or updated since the last full save.
Include: vm.h
GEOS SDK TechDocs
|
|
UtilAsciiToHex32() ...
|
VMClose() ...