putmsg() extensions: fixmmsgfh, closemmsgfh

SYNOPSIS

void closemmsg(void)

void fixmmsgfh(void)


DESCRIPTION
These are some useful extensions to the putmsg() family of functions that provide more flexibility to programmers. They are not used directly by the Metamorph 3 API.

closemmsg() closes the message file and should be called before exiting any application that uses putmsg() or the Metamorph 3 API. It may also be called in the middle of an application to flush the message file buffers to disk or force the message file to be reopened on the next call to putmsg(). If mmsgfh is stderr, it will not be closed, but the next putmsg() call will still force a reopen. It is safe to call closemmsg() at any time because it will not attempt to close a file that is already closed or has never been opened.

fixmmsgfh() is called by putmsg() before any output is attempted. It guarantees that mmsgfh points somewhere legal based on mmsgfname. See "Output destination" in the putmsg() description. fixmmsgfh() will probably not be needed by API users because putmsg() supplies ample output functionality.

If you use any of these functions and replace putmsg() you will have to write your own replacements for the extensions. All of the putmsg() functions are in the same object module within the library. Therefore, calling any one of the functions will cause all of them to be brought in by the linker, which will then cause a clash if you have your own version of putmsg().


SEE ALSO

putmsg()
putmsg() replacement


Copyright © Thunderstone Software     Last updated: Dec 10 2018
Copyright © 2019 Thunderstone Software LLC. All rights reserved.