.ds Vv 1.2.14 .TH VistaIOWarning 3 "24 April 1993" "VistaIO Version \*(Vv" .SH NAME VistaIOWarning, VistaIOSystemWarning \- report a nonfatal error .SH SYNOPSIS .nf .ft B void VistaIOWarning (\fIformat\fP \fR[\fB, \fIarg\fR...]\fB) .RS VistaIOStringConst \fIformat\fP; .RE .PP .ft B void VistaIOSystemWarning (\fIformat\fR \fR[\fB, \fIarg\fR...]\fB) .RS VistaIOStringConst \fIformat\fP; .RE .fi .SH ARGUMENTS .IP \fIformat\fP 10n Specifies the format of the message that is to be reported. .PP .IP \fIarg\fP 10n Specifies values that are to be included in the formatted message. .SH DESCRIPTION \fBVistaIOWarning\fP is called to report a nonfatal error. It composes an error message and passes it to the nonfatal error handler, which typically prints the message and returns (see \fBVistaIOSetWarningHandler\fP(3)). .PP The message composed by \fBVistaIOWarning\fP is of the form: .PP .RS .nf \fIProgram\fB: Warning: \fIDescription\fB. .fi .RE .PP \fIProgram\fP, the program's name, is included if it has been previously established with a call to \fBVistaIOSetProgramName\fP. \fIDescription\fP is a string that has been formatted by \fBsprintf\fP using \fIformat\fP, plus all of the optional arguments, \fIarg\fP. .PP \fBVistaIOSystemWarning\fP is identical to \fBVistaIOWarning\fP except that it also includes in the message a phrase based on the current value of the external variable \fBerrno\fP, which is used by system calls to return diagnostic codes. The message composed by \fBVistaIOSystemWarning\fP is of the form: .PP .RS .nf \fIProgram\fB: Warning: \fIDescription\fB: \fIDiagnostic\fB. .fi .RE .PP \fIDiagnostic\fP is a short phrase corresponding to the value of \fBerrno\fP. This phrase is drawn from the table used by \fBperror\fP(3). .SH EXAMPLES In this first example, the values of \fBattr_name\fP, \fBact_value\fP, and \fBexp_value\fP are incorporated into the error message produced by \fBVistaIOWarning\fP. .PP .RS .nf .ft B char *attr_name; float act_value, exp_value; if (act_value != exp_value) VistaIOWarning ("MyRoutine: Attribute %s is %f rather than %f", attr_name, act_value, exp_value); .fi .RE .PP In this second example, the diagnostic phrase corresponding to the value of \fBerrno\fP is incorporated into the error message produced by \fBVistaIOSystemWarning\fP. .PP .RS .nf .ft B if (ioctl (fd, request, arg) == \-1) VistaIOSystemWarning ("MyRoutine: ioctl failed"); .fi .RE .SH "SEE ALSO" .na .nh .BR VistaIOError (3), .BR VistaIOSetWarningHandler (3), .BR VistaIOSetProgramName (3), .BR perror (3), .ad .hy .SH AUTHOR Art Pope Adaption to vistaio: Gert Wollny