.\" This manpage has been automatically generated by docbook2man
.\" from a DocBook document. This tool can be found at:
.\"
.\" Please send any bug reports, improvements, comments, patches,
.\" etc. to Steve Cheng .
.TH "CFG_PRINT_ERROR" "3" "17 February 2004" "libcfg+ 0.6.2" "libcfg+ 0.6.2"
.SH NAME
cfg_print_error, cfg_fprint_error, cfg_get_error_str \- libcfg+ error handling
.SH "SYNOPSIS"
.PP
The information about the last occurred error is stored within the context in
the CFG_CONTEXT structure. The following functions
provide a convenient interface for interpreting, querying and printing that
information.
.sp
\fB#include
.sp
void cfg_print_error (const CFG_CONTEXT \fIcon\fB);
.sp
void cfg_fprint_error (const CFG_CONTEXT \fIcon\fB, FILE *\fIfh\fB);
.sp
char *cfg_get_error_str (const CFG_CONTEXT \fIcon\fB);
\fR
.SH "DESCRIPTION"
.PP
The function \fBcfg_print_error()\fR prints an error message
describing the last error. To print the message to the specified stream, use
\fBcfg_fprint_error()\fR, which takes a stream pointer
\fIfh\fR as its second argument.
.PP
Lastly, \fBcfg_get_error_str()\fR, returns an error message in
a dynamically allocated string. Be sure to free the memory taken by the string
when you do not need it anymore.
.PP
The following Error codes table describes the error constants
used by the parsing functions. See Parsing section for reference.
.PP
"ERROR CODES"
.TP
\fBCFG_OK\fR
Everything is OK
.TP
\fBCFG_ERROR_NOARG\fR
An argument is missing for the option
.TP
\fBCFG_ERROR_NOTALLOWEDARG\fR
An argument is not allowed for the option
.TP
\fBCFG_ERROR_BADOPT\fR
The option's argument could not be parsed
.TP
\fBCFG_ERROR_BADQUOTE\fR
Error in quotations
.TP
\fBCFG_ERROR_BADNUMBER\fR
The option could not be converted to an appropriate numeric type
.TP
\fBCFG_ERROR_OVERFLOW\fR
A given numeric value was too big or too small
.TP
\fBCFG_ERROR_MULTI\fR
Multiple arguments used for an option that takes only one argument
.TP
\fBCFG_ERROR_NOMEM\fR
Not enough memory
.TP
\fB CFG_ERROR_STOP_STR, CFG_ERROR_STOP_STR_FOUND \fR
Stop string was found
.TP
\fBCFG_ERROR_NOEQUAL\fR
Equal sign expected on the line, but no one was found
.TP
\fBCFG_ERROR_UNKNOWN\fR
An unknown option
.TP
\fBCFG_ERROR_FILE_NOT_FOUND\fR
File not found
.TP
\fBCFG_ERROR_SEEK_ERROR\fR
Seek error (\fBfseek()\fR\~failure)
.TP
\fBCFG_ERROR_INTERNAL\fR
Internal error
.PP
All of the constants have an alternative, short form, which can be derived by
replacing _ERROR_ with _ERR_ in the
name of the constant. So for example you can use
CFG_ERR_BADOPT as a substitution for
CFG_ERROR_BADOPT.
.\" This is common footer for libcfg+ manpages.
.\" Written by Ondrej Jombik in 14th September 2002
.SH "SEE ALSO"
You can get library overview, table of contents and such additional information
info from main \fBlibcfg+\fR(3) manpage by typing "man libcfg+" on UNIX-based
systems. Also use this command to get information about authors, homepage and
license conditions.