OSI/AS Management Programming Manual
Event-Retrieval Example
Sample Programs
056785 Tandem Computers Incorporated C–47
if (sav_buf == NULL)
DEBUG();
err_buf = (SPIERRDEF *) malloc( sizeof(SPIERRDEF) );
if (err_buf == NULL)
DEBUG();
/* Not necessary to open home terminal in C. */
/* Not necessary to read startup message from C. */
/* It is stored in environment pointers. */
/* Initialize to spaces the startup structure areas that
* will contain volume and subvolume names to for passing
* to NEWPROCESS. */
startup = init_startup();
/* Create a name for the distributor process. */
ccval = CREATEPROCESSNAME( (int *)distr_proc_name );
if (ccval != CCE) {
printf("\n Unable to Create process name.\n");
DEBUG();
}
NEWPROCESS( (int *)distr_prog_file, , , , ,(int *)&error,
(int *)distr_proc_name);
if ( (error >> 8) != 0 ) {
printf(" Newprocess returned %xh\n",error);
DEBUG();
}
/* 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. */