FTAM/9000 Programmer's Guide
380 Chapter 10
Example Programs
Checking for Errors Example
Checking for Errors Example
This example checks the function return value and the
result.return_code, result.vendor_code, and diagnostic structures. This
example also uses printf() statements to print the results. Use this
routine in conjunction with the first three examples in this chapter:
Using HLCF Functions Example, Managing FTAM Connections
Example, and Using LLCS Example.
#include %</opt/ftam/include/map.h>
#include %</opt/ftam/include/mapftam.h>
#include %<stdio.h>
/*
** error_handler
**
** DESCRIPTION:
** This routine is an example of handling failures experienced
** during the FTAM functions. This routine will display the
** error messages.
**
** PARAMETERS:
** INPUT:
** result : the MAP and HP error information
** diag : the ISO error information
**
*/
void
error_handler(result, diag)
Api_rc result;
struct Ft_diagnostic *diag;
{
Return_code res;
Api_rc outcome;
Octet *return_string;
Octet *vendor_string;
struct Ft_diagnostic *ft_diag = NULL;
/*
** Initialize variables.
*/
return_string = NULL;
vendor_string = NULL;