SECTION 8 -- MISCELLANEOUS FUNCTIONS

The z_ package contains miscellaneous functions.

8.1 z_exit - Terminate Application Process

VOID z_exit (sfi, skey)

Function return:

Arguments:

  1. sfi: input, FUNINT sfi;

    Success/Fail indicator: negative if the process wishes to signal failure; positive if a success. (Zero is reserved.)

  2. skey: input, TEXT *skey;

    Error key string, describing the cause for failure. If skey is an empty string, then the key from the most recent m_msg is used.

z_exit terminates a process, passing to TM an indication of the status of the termination. (TM sets the TCL globals, $SFI and $SKEY according to the values of the sfi and skey.)

If z_exit is not used to terminate the process then:

8.2 z_init - General Process Initialization

FILE *z_init (vptr, mode)

Function return: Pointer to the stdout file.

Arguments:

  1. vptr: input, struct PARBLK *vptr;

    Pointer to a PARBLK structure for receiving the initial V-block from the TAE Monitor.

  2. mode: input, FUNINT mode;

    Note that return status is available only if z_init is called with mode set to P_CONT.

z_init is used to initialize a program when the program requires the capability to write to the TAB standard output device. Z_init initializes the terminal package (using t_init), initializes the p_ package (using p_inim) and opens the standard output device for output.

Program output should be performed by using the FILE pointer to the stdout file returned by the z_init function. For example, the fprintf function should be used instead of printf. Output may be lost in batch or asynchronous execution if output functions are called that do not use this pointer.