Up: GEOS SDK TechDocs | Up | Prev: VirtualSerialSetFormat() ... | Next: VMGetMapBlock() ...

VMClose()

word	VMClose(
        VMFileHandle		file,
        Boolean		noErrorFlag);

This routine updates and closes a VM file. If it is successful, it returns false . If it fails, it returns a member a VMStatus error code. Note that the routine closes the file even if it could not successfully update the file; in this case, any changes since the last update will be lost. For this reason, it is safest to call VMUpdate() first, then (after the file has been successfully updated) call VMClose() .

If noErrorFlag is FILE_NO_ERRORS, VMClose() will fatal-error if it could not succesfully update and close the file. If noErrorFlag is neither FILE_NO_ERRORS nor zero, VMClose() will crash.

Include: vm.h

VMCompareVMChains()

Boolean	VMCompareVMChains(
        VMFileHandle		sourceFile,
        VMChain		sourceChain,
        VMFileHandle		destFile,
        VMChain		destChain);

This routine compares two VM chains or DB items. It returns true if the two are identical; otherwise it returns false .

Include: vm.h

VMCopyVMBlock()

VMBlockHandle 	VMCopyVMBlock(
        VMFileHandle		sourceFile,
        VMBlockHandle		sourceBlock,
        VMFileHandle		destFile);

This routine creates a duplicate of a VM block in the specified destination file (which may be the same as the source file). It returns the duplicate block's handle. The duplicate will have the same user ID as the original block.

Include: vm.h

VMCopyVMChain()

VMChain 	VMCopyVMChain(
        VMFileHandle		sourceFile,
        VMChain		sourceChain,
        VMFileHandle		destFile);

This routine creates a duplicate of a VM chain (or DB item) in the specified destination file (which may be the same as the source file). It returns the duplicate's VMChain structure. All blocks in the duplicate will have the same user ID numbers as the corresponding original blocks.

Include: vm.h

VMDetach()

MemHandle 	VMDetach(
        VMFileHandle		file,
        VMBlockHandle		block,
        GeodeHandle		owner);			/* Pass zero to have block owned by 
					 * current thread's owner */

This routine detaches a global memory block from a VM block. If the VM block is not currently in memory, VMDetach() allocates a memory block and copies the VM block into it. If the VM block is dirty, VMDetach() will update the block to the file before detaching it.

Include: vm.h

VMDirty()

void	VMDirty(
        MemHandle		mh);

This routine marks a locked VM block as dirty.

Include: vm.h

VMFind()

VMBlockHandle 	VMFind(
        VMFileHandle		file,
        VMBlockHandle		startBlock,
        word		userID);

This routine finds a VM block with the specified user ID number. If the second argument is NullHandle the routine will return the matching block with the lowest handle. If the second argument is non-null, it will return the first matching block whose handle is larger than the one passed (in numerical order).

Include: vm.h

VMFree()

void	VMFree(
        VMFileHandle		file,
        VMBlockHandle		block);

This routine frees the specified VM block. If a global memory block is currently attached to the VM block, it is freed too.

Include: vm.h

VMFreeVMChain()

void	VMFreeVMChain(
        VMFileHandle		file,
        VMChain		chain);

This routine frees the specified VM chain or DB item. If a chain is specified, all blocks in the chain will be freed.

Include: vm.h

VMGetAttributes()

word	VMGetAttributes(
        VMFileHandle		file);

Each VM file contains a set of VMAttributes flags. These determine how the VM manager will treat the file. This routine returns the current flags.

Include: vm.h

Tips and Tricks: When the Document Control objects create files, they automatically initialize the attributes appropriately.

See Also: VMSetAttributes().

VMGetDirtyState()

word	VMGetDirtyState(
        VMFileHandle		file);

This routine finds out if a file has been dirtied. It returns a word-sized value. The upper byte of the return value is non-zero if the file has not been dirtied since the last save, auto-save, or update; the lower byte is non-zero if the file has not been dirtied since the last save. Thus, if the return value is zero, the file must be updated.

Include: vm.h

Tips and Tricks: VMUpdate() is optimized for updating clean files. For this reason, it is faster to call VMUpdate() then it is to first check the dirty state, then call VMUpdate() only if the file is dirty.


Up: GEOS SDK TechDocs | Up | Prev: VirtualSerialSetFormat() ... | Next: VMGetMapBlock() ...