OSI/AS Management Programming Manual
Event-Retrieval Example
Sample Programs
C–44 056785 Tandem Computers Incorporated
}
#pragma PAGE "spi_cmd_load_filter()"
/* ---------- spi_cmd_load_filter ---------------------------
* Builds an SPI command that loads a filter into the
* distributor.
*/
int spi_cmd_load_filter(void)
{
/* Initialize spi_buf for distributor CONTROL command. */
spi_err = SSINIT( (int *)spi_buf, ZEMS_VAL_BUFLEN,
(int *)&zems_val_ssid,
ZSPI_VAL_CMDHDR, ZEMS_CMD_CONTROL );
if (spi_err != ZSPI_ERR_OK)
DEBUG();
/* Place load-filter token in buffer. */
spi_err = SSPUTTKN( (int *)spi_buf, ZEMS_TKN_FILTERFILE,
filt_name );
if (spi_err != ZSPI_ERR_OK)
DEBUG();
/* Send command to distributor. */
spi_err = send_spi_cmd();
return spi_err;
}
#pragma PAGE "displ_event()"
/* ---------- displ_event -----------------------------------
* This function displays an event message on the home
* terminal.
* Pass: the event buffer pointer to convert to a message
*/
void displ_event(EMSBUFDEF *event_buf)
{
unsigned long etxt_stat;
# define high(x) (x >> 16)
# define low(x) (x & 0xFFFF)
char text[EVT_TEXT_LEN+1]; /* needed for printf() call */
int i;
/* Generate display text from event message. */
etxt_stat = EMSTEXT( (int *)event_buf,
evt_text_buf,
EVT_TEXT_LEN, /* displayable line length */
NUM_EVT_LINES, /* number of display lines */
actual_len,0,0, /* line length to display */
1); /* console-compatible */
/* Check for EMSTEXT calling errors. */
if ( (high(etxt_stat) == 0) && (low(etxt_stat) != 0) )
DEBUG();
for(i=0; i < NUM_EVT_LINES; i++) {
if( actual_len[i] != -1 ) {