FTAM/9000 Programmer's Guide

344 Chapter 9
Handling Errors
Example Program Checking for Errors
Example Program Checking for Errors
This example checks the result.return_code, result.vendor_code, and
Ft_diagnostic structures. This example also uses printf() statements to
print the results.
#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;