📄 qccerror.3
字号:
.TH QCCERROR 3 "QCCPACK" "".SH NAMEQccErrorAddMessage, QccErrorPrintMessages, QccErrorExit, QccErrorWarning\- error-message handling.SH SYNOPSIS.B #include "libQccPack.h".sp.BI "void QccErrorAddMessage(const char *" format ", ...);".br.B void QccErrorPrintMessages(void);.br.B void QccErrorClearMessages(void);.br.B void QccErrorExit(void);.br.BI "void QccErrorWarning(const char *" format ", ...);".br.sp.BI "void QccErrorAddMessageVA(const char *" format ", va_list " ap );.br.BI "void QccErrorWarningVA(const char *" format ", va_list " ap );.SH DESCRIPTIONThe.BR QccErrorAddMessage() ,.BR QccErrorPrintMessages() ,and.BR QccErrorExit()routinesprovide automatic handling of error messages for programs and routinesusing the QccPack library.The QccPack library maintains a list of error messages..B QccErrorAddMessage()is used to add a message to this list;.B QccErrorPrintMessages()is used to print the messages to stderr;.B QccErrorExit()is used to print the messages to stderr and then exit the current program..LP.B QccErrorAddMessage()accepts a.I formatstring and a subsequent variable-length argument list in the style of.BR printf (3);this .I formatstring and argument list are used to assemble an error-message string.The resulting error-message string is stored in a list of error messages,and control is returned to the calling routine..B QccErrorAddMessage()uses .BR vsnprintf (3)to generate the error message and the facilities of.BR stdarg (3)to implement the variable-length argument list..LP.B QccErrorPrintMessages()dumps the current list of error messages to stderr..B QccErrorPrintMessages()takes care, when possible,to nicely wrap long lines of text onto multiple output lines withoutsplitting words. After the messages are output, the message list maintainedby the QccPack library is cleared via a call to .BR QccErrorClearMessages() ,and control is returned to the callingroutine..LP.BR QccErrorClearMessages()removes all messages from the message list maintain by QccPack..LP.B QccErrorExit()calls.B QccErrorPrintMessages()to dump the current list of messages to stderrand then causes program termination, returning a value of.B QCCEXIT_ERRORto the parent..B QccErrorExit()does not return..LP.B QccErrorWarning()accepts a warning message in the same manner that.B QccErrorAddMessage()accepts an error message; however, the warning message is written immediatelyto stderr rather than being stored in a list of messages, as in the case of.BR QccErrorAddMessage() .This is useful to provide the user with important, but noncritical, warninginformation..LP.BR QccErrorAddMessageVA()and.BR QccErrorWarningVA()function indentically to.BR QccErrorAddMessage()and.BR QccErrorWarning() ,respectively,except that.BR QccErrorAddMessageVA()and.BR QccErrorWarningVA()can be called from a function whose own argument list containsa variable number of arguments implemented viathe variable-length argument facilities of.BR stdarg (3)..SH "SEE ALSO".BR QccExit (3),.BR QccInit (3),.BR printf (3),.BR stdarg (3),.BR exit (3),.BR QccPack (3).SH AUTHORCopyright (C) 1997-2009 James E. Fowler.\" The programs herein are free software; you can redistribute them an.or.\" modify them under the terms of the GNU General Public License.\" as published by the Free Software Foundation; either version 2.\" of the License, or (at your option) any later version..\" .\" These programs are distributed in the hope that they will be useful,.\" but WITHOUT ANY WARRANTY; without even the implied warranty of.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the.\" GNU General Public License for more details..\" .\" You should have received a copy of the GNU General Public License.\" along with these programs; if not, write to the Free Software.\" Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -