OSI/FTAM Programming Guide
NonStop FTAM Programming Examples
HP NonStop OSI/FTAM Programming Guide—528612-001
5-37
Reading a File: C Programming Example
1320 /* Name: check_diag */
1321 /* */
1322 /* Description: The check_diag procedure displays */
1323 /* the diagnostic message type and error ID for each */
1324 /* diagnostic message element, discards the association*/
1325 /* and ends the program. Additional application- */
1326 /* specific error handling or recovery could be */
1327 /* implemented if required by an application. */
1328 /* */
1329 /********************************************************************/
1330
1331 void check_diag ()
1332
1333 {
1334
1335 int i; /* index into diagnostic array */
1336
1337 /******************************************************************/
1338 /* Display the number of diagnostic messages received. */
1339 /******************************************************************/
1340
1341 if ( diag.zdiagcount > 0 )
1342 printf ( "Following is a list of %d diagnostic elements -\n"
1343 , diag.zdiagcount );
1344
1345 for ( i = 0; i < diag.zdiagcount; i++ )
1346 {
1347 printf (" Diagnostic Type: %ld\n", diag.zdiagelems[i].zdiagtype );
1348 printf (" Error ID: %ld\n", diag.zdiagelems[i].zerrorid );
1349 if ( diag.zdiagelems[i].zfurtherdetailsispresent == ZAPS_VAL_PRESENT )
1350 printf (" Details: %s\n",
1351 diag.zdiagelems[i].zfurtherdetails.u_zc.zb );
1352 }
1353
1354 /******************************************************************/
1355 /* Discard the API context information for the association, */
1356 /* and exit the program. */
1357 /******************************************************************/
1358