dm_ask.c revision d1d2228c6cf3ec632d28262810ab7902932a5d33
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* A collection of functions to ask operator questions
*
* These functions must be reworked when the operator interface is available
*/
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#include <dm_msg.h>
#include <dm_impl.h>
#include <dm_proto.h>
#include <mms_trace.h>
/*
* Function name
* dm_ask_reply(char *reply)
*
* Parameters:
* reply address of reply buffer
*
* Description:
* check standard replies from operator
*
* Return code:
* DM_REP_YES
* DM_REP_NO
* DM_REP_UNATTENDED
* DM_REP_ABORT
* DM_REP_RETRY
* DM_REP_STRING reply is none above.
*
* Note:
*
*
*/
int
dm_ask_reply(char *reply)
{
int rc;
rc = DM_REP_YES;
rc = DM_REP_ABORT;
rc = DM_REP_RETRY;
} else {
rc = DM_REP_STRING;
}
return (rc);
}
/*
* Function name
* dm_ask_preempt(void)
*
* Parameters:
* none
*
* Description:
* Ask operator if reservation should be preempted
*
* Return code:
* return code from dm_ask_reply()
* DM_REP_ERROR error
*
* Note:
*
*
*/
int
dm_ask_preempt(void)
{
int rc;
return (DM_REP_ERROR);
}
return (rc);
}
/*
* Function name
* dm_ask_freserve(void)
*
* Parameters:
* none
*
* Description:
* Ask operator if DM should reserve the tape unit by breaking
* reservation held by another host
*
* Return code:
* return code from dm_ask_reply()
* DM_REP_ERROR error
*
* Note:
*
*
*/
int
dm_ask_freserve(void)
{
int rc;
return (DM_REP_ERROR);
}
return (rc);
}
/*
* Function name
* dm_ask_write_lbl(char *from, char *to, char *pcl)
*
* Parameters:
* from from label type
* to to label type
* pcl cartridge PCL of new label
*
* Description:
* ask for permission to write a new VOL1 label
*
* Return code:
* 0 success
* -1 operator replied no or error
*
* Note:
*
*
*/
int
{
int rc;
int ask_lsw = 0;
int ask_wo = 0;
/* No switch labels */
return (-1);
}
ask_lsw = 1;
}
/* Not a blank tape */
ask_wo = 1;
}
} else {
/* No writeover */
return (-1);
}
}
/* Write label without asking */
return (0);
}
} else if (ask_lsw == 1) {
} else {
}
/* Can't get reply - means "no" */
return (-1);
}
if (rc == DM_REP_ERROR) {
/* Ask got an error, assume "no" */
return (-1);
}
"write label denied by operator"));
return (-1);
}
/*
* Can write label
*/
return (0);
}