OSI/TS Management Programming Manual
Sample Programs
C–34 056786 Tandem Computers Incorporated
 if (spi_err != ZSPI_ERR_OK)
 DEBUG();
 /* Save the original command. */
 movmem( (char *)spi_buf, (char *)sav_buf,
 sizeof(EMSBUFDEF) );
 /* Begin loop that gets and displays event messages. */
 while ( (msgcount < msglimit) || (msglimit == 0) ) {
 msgcount++;
 /* Send GETEVENT command to distributor. */
 send_spi_cmd();
 /* Extract event message from GETEVENT response. */
 tkn = ZEMS_TKN_EVENT;
 /* Return offset of the event in SPI buffer
 * via event_buf_loc. */
 spi_err = SSGETTKN( (int *)spi_buf, ZSPI_TKN_OFFSET,
 (char *)&tkn, 1, (int *)&byteoffset);
 if (spi_err != ZSPI_ERR_OK)
 DEBUG();
 event_buf = (EMSBUFDEF *)((char *)(spi_buf) +
 byteoffset + 2);
 /* Display the event message at your terminal. */
 displ_event( event_buf );
 /* Save context token from this GETEVENT response for
 * the next GETEVENT request. */
 spi_err = SSMOVETKN(ZSPI_TKN_CONTEXT,
 (int *)spi_buf, 1, /* source */
 (int *)sav_buf, 1); /* destination */
 if (spi_err != ZSPI_ERR_OK)
 DEBUG();
 /* Move the updated command to spi_buf for next time
 * through the loop. */
 movmem( (char *)sav_buf, (char *)spi_buf,
 sizeof(EMSBUFDEF) );
 } /* end while */
 return(0);
} /* end getevent_loop() */
#pragma PAGE
/************************************************************
 * main program *
 ************************************************************
 *
 * Starts a distributor and calls procedures that use
 * SPI commands to connect a source collector, load a
 * filter, and position the distributor within the log
 * files. Then the getevent_loop procedure is called to










