OSI/AS Management Programming Manual

Event-Retrieval Example
Sample Programs
C–42 056785 Tandem Computers Incorporated
* Return: filt_name[]
*/
void get_filter_name()
{
int errval;
int got_it = FALSE;
int len_vol, len_subvol, len_filenm, i;
char vol[8], subvol[8], filenm[8];
while ( !got_it ) {
retry:
printf("\nEnter the filter name ($vol subvol filter)?: ");
errval = scanf("%s %s %s", &vol, &subvol, &filenm);
len_vol = strlen( &vol[0]);
len_subvol = strlen( &subvol[0]);
len_filenm = strlen( &filenm[0]);
if(( len_vol > 8) || (len_subvol > 8)
|| (len_filenm > 8)){
printf("Illegal file name, retry again");
goto retry;
}
strncat(&filt_name[0], &vol[0], len_vol);
for ( i = 0; i < (8-len_vol); i++) {
strncat(&filt_name[len_vol], " ", 1);
}
strncat(&filt_name[8], &subvol[0], len_subvol);
for ( i = 0; i < (8-len_subvol); i++) {
strncat(&filt_name[8 + len_subvol], " ", 1);
}
strncat(&filt_name[16], &filenm[0], len_filenm);
for ( i = 0; i < (8-len_filenm); i++) {
strncat(&filt_name[16 + len_filenm], " ", 1);
}
if (errval == EOF)
STOP();
if ( (errval != 0) )
got_it = TRUE;
}
}
#pragma PAGE "send_spi_cmd()"
/* ---------- send_spi_cmd ----------------------------------
* Puts the finishing touches on an SPI command that has
* been prepared by another procedure. Sends the command to
* the distributor and checks the response.
*/
int send_spi_cmd(void)
{
int ccval; /* for CC return from WRITEREAD */
/* Determine how much buffer space was used. */
spi_err = SSGETTKN( (int *)spi_buf, ZSPI_TKN_USEDLEN,
(char *)&used_len );
if (spi_err != ZSPI_ERR_OK)