OSI/FTAM Programming Guide

NonStop FTAM Programming Examples
HP NonStop OSI/FTAM Programming Guide528612-001
5-31
Reading a File: C Programming Example
1086 FILEINFO ( , (int *) &error, local_file );
1087 printf ( "OPEN for local file failed with error # %d\n", error );
1088 exit (EXIT_SUCCESS);
1089 }
1090
1091 } /* create_open_local_file */
1092
1093
1094 #pragma PAGE "GET_EVENT"
1095 /*********************************************************************/
1096 /* */
1097 /* Name: get_event */
1098 /* */
1099 /* Description: The get_event procedure gets an available event. It */
1100 /* verifies that the event is the expected event and */
1101 /* that there are no errors associated with it. If an */
1102 /* unexpected event is received, it sends an error */
1103 /* message. */
1104 /* */
1105 /********************************************************************/
1106
1107 void get_event ( expected_event )
1108
1109 int *expected_event;
1110
1111 {
1112 int event_code;
1113
1114 /******************************************************************/
1115 /* Wait for an event to be received. */
1116 /******************************************************************/
1117
1118 status = APS_EVENT_RECEIVE_ ( cepi, WAIT_FOREVER );
1119 if ( status != ZAPS_VAL_STATUS_EVENT )
1120 check_status ();
1121
1122 /******************************************************************/
1123 /* Get the event code. */
1124 /******************************************************************/