OSI/TS Management Programming Manual
Sample Programs
C–36 056786 Tandem Computers Incorporated
 }
 /* Open the new process to send it the startup message. */
 ccval = OPEN( (int *)distr_proc_name, (int *)&distr );
 if (ccval != CCE) {
 printf(" Open returned non-zero ccval: %d.\n",ccval);
 DEBUG();
 }
 /* Add "TYPE CONSUMER" to startup message to send to
 * EMSDIST. */
 strcat(startup->params, "TYPE CONSUMER");
 /* Now write the startup structure. */
 ccval = WRITE( distr, (int *)startup, sizeof(CISTART) );
 FILEINFO(distr, (int *)&error);
 if ( !(error == 0 || error == 70) ) {
 printf(" Write returned error: %d.\n",error);
 DEBUG();
 }
 /* Close the standard interface to the distributor. */
 CLOSE(distr);
 /* Get filter name from terminal. */
 get_filter_name();
 /* Prepare to reopen the distributor SPI interface. */
 movmem( zspi_name, distr_qual, 5 );
 ccval = OPEN( (int *)distr_proc_name, (int *)&distr );
 if (ccval != CCE) {
 printf(" Open of %s returned non-zero ccval: %d.\n",
 distr_proc_name,ccval);
 DEBUG();
 }
 /* Tell collector to use log files as source for
 * event messages.
 */
 if ((error = spi_cmd_set_source()) != 0)
 goto eexit;
 /* Load filter into distributor. */
 if ((error = spi_cmd_load_filter()) != 0)
 goto eexit;
 getevent_loop();
eexit:
 CLOSE(distr);
}










