OSI/TS Management Programming Manual
Sample Programs
056786 Tandem Computers Incorporated C–35
 * retrieve and process event messages.
 */
main(int argc, char *argv[])
{
 CISTART *startup; /* local pointer to startup message
 * structure */
 char *cptr;
 char *cptr1;
 int ccval = 0;
 static char zspi_name[] = "#ZSPI";
 /* Initialize subsystem IDs. */
 cptr = strncpy(zems_val_ssid.u_z_filler.z_filler,
 ZSPI_VAL_TANDEM, 8);
 zems_val_ssid.z_number = ZSPI_SSN_ZEMS;
 zems_val_ssid.z_version = ZEMS_VAL_VERSION;
 cptr1 = strncpy(zos4_val_ssid.u_z_filler.z_filler,
 ZSPI_VAL_TANDEM, 8);
 zos4_val_ssid.z_number = ZSPI_SSN_ZOS4;
 zos4_val_ssid.z_version = ZOS4_VAL_VERSION;
 /* Allocate memory for SPI buffers. */
 spi_buf = (EMSBUFDEF *) malloc( sizeof(EMSBUFDEF) );
 if (spi_buf == NULL)
 DEBUG();
 sav_buf = (EMSBUFDEF *) malloc( sizeof(EMSBUFDEF) );
 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 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();










