gtpc2m61 | C/C++ Language Support User's Guide |
This function routes a message to a terminal or to another application
program.
Format
#include <tpfio.h>
#include <c$rc0pl.h>
void routc(struct rc0pl *rcpl, enum t_lvl level);
- rcpl
- This argument is a pointer to type struct rc0pl,
included in tpfapi.h, that defines a routing control
parameter list (RCPL).
- level
- One of 16 possible values representing a valid data level from enumeration
type t_lvl, expressed as Dx, where x represents
the hexadecimal number of the level (0-F). This argument
identifies the CBRW level where the working storage block containing the
message to be transmitted is.
Normal Return
Void.
Error Return
Not applicable.
Programming Considerations
- The first or only segment of the message to be routed must be contained in
a working storage block on the referenced level. If the message is not
completely contained in the storage block, it should be continued in 1 or more
long-term pool records of the same size. For messages sent to
terminals, only 381-byte storage blocks are allowed.
- Messages sent to application programs must be in application message
format.
- Messages sent to terminals may be either in application message format or
in output message format. The contents of the RCPL indicate which
format is in use.
- Note:
- The structure am0sg, which defines an application message block,
is defined in c$am0sg.h.
- On return, the working storage block on the specified level is released to
the system and made unavailable to the operational program.
- If the ROUTC service routine detects the following error conditions, a
system error with exit results.
- No main storage block on the specified CBRW level
- Invalid message length
- Invalid contents of the message block and the RCPL or both.
Examples
The following example calls routc to send a message to the
originating user terminal, because the message block has already been built on
level D4 and the RCPL remains at EBW000.
#include <tpfio.h>
#include <c$rc0pl.h>
·
·
·
routc((struct rc0pl *)&(ecbptr()->ebw000),D4);
Related Information
puts-Put String to Standard Output Stream.