gtpc2m9rC/C++ Language Support User's Guide

wtopc_insert_header-Save Header for wtopc

This function inserts a header, in correct format for the wtopc function to use, into a 12-byte field pointed to by the buffer_ptr parameter.

Format

#include   <tpfapi.h>
void         wtopc_insert_header(char * buffer_ptr, char * prefix_ptr,
                   short int number, char letter,
                   enum t_wtopc_time time);

buffer_ptr
Storage location of where to store the header information.

prefix_ptr
char pointer to a 4-character prefix in the header. This field has a default (NULL entered) of the name of the program that called the wtopc function.

number
short int number field in the header from 0--9999.

letter
char letter field in the header. NULL can be entered to indicate a default value is to be used by wtopc; the default is the letter 'I'. IBM limits the letters to I, E, and W, and provides equates for these values. You can choose to hardcode a different letter for your messages.

Table 35. wtopc_insert_header letter parameter

Value Name Letter Description
# define WTOPC_INFO I Informational message
#define WTOPC_WARNING W Attention message
#define WTOPC_ERROR E Error message

time
This field must belong to the enumeration type t_wtopc_time, defined in tpfapi.h, specifying one of the following times:

WTOPC_SYS_TIME
Specifies system time should be included in the header.

WTOPC_SUBSYS_TIME
Specifies subsystem time should be included in the header.

WTOPC_NO_TIME
Specifies that no time should be included in the header.

This field has a default (NULL entered) of WTOPC_SUBSYS_TIME.

Normal Return

Void.

Error Return

Not applicable.

Programming Considerations

This function is designed to simplify parameter coding for the wtopc function.

Examples

The following example sets up a header for the wtopc function to use.

#include <tpfapi.h>

  ·
  ·
  ·
struct wtopc_header header_buffer;
  ·
  ·
  ·
wtopc_insert_header(&header_buffer, "C000", 2, 'A', WTOPC_SYS_TIME);
  ·
  ·
  ·

The following example sets up a header for the wtopc function to use. A NULL is entered as one of the parameters.

#include <tpfapi.h>

  ·
  ·
  ·
struct wtopc_header header_buffer;
  ·
  ·
  ·
wtopc_insert_header(&header_buffer, NULL, 2, 'A', WTOPC_SYS_TIME);
  ·
  ·
  ·

Related Information