1<!--$Id: env_err.so,v 10.34 2006/04/27 20:17:47 bostic Exp $--> 2<!--Copyright (c) 1997,2008 Oracle. All rights reserved.--> 3<!--See the file LICENSE for redistribution information.--> 4<html> 5<head> 6<title>Berkeley DB: DB_ENV->err</title> 7<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit."> 8<meta name="keywords" content="embedded,database,programmatic,toolkit,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,Java,C,C++"> 9</head> 10<body bgcolor=white> 11<table width="100%"><tr valign=top> 12<td> 13<b>DB_ENV->err</b> 14</td> 15<td align=right> 16<a href="/api_c/api_core.html"><img src="/images/api.gif" alt="API"></a> 17<a href="/ref/toc.html"><img src="/images/ref.gif" alt="Ref"></a></td> 18</tr></table> 19<hr size=1 noshade> 20<tt> 21<b><pre> 22#include <db.h> 23<p> 24void 25DB_ENV->err(DB_ENV *dbenv, int error, const char *fmt, ...); 26<p> 27void 28DB_ENV->errx(DB_ENV *dbenv, const char *fmt, ...); 29</pre></b> 30<hr size=1 noshade> 31<b>Description: DB_ENV->err</b> 32<p>The DB_ENV->err, DB_ENV->errx, <a href="/api_c/db_err.html">DB->err</a> and 33<a href="/api_c/db_err.html">DB->errx</a> methods provide error-messaging functionality for 34applications written using the Berkeley DB library.</p> 35<p>The <a href="/api_c/db_err.html">DB->err</a> and DB_ENV->err methods constructs an error message 36consisting of the following elements:</p> 37<blockquote><br> 38<b>An optional prefix string</b><ul compact><li>If no error callback function has been set using the 39<a href="/api_c/env_set_errcall.html">DB_ENV->set_errcall</a> method, any prefix string specified using the 40<a href="/api_c/env_set_errpfx.html">DB_ENV->set_errpfx</a> method, followed by two separating characters: a colon 41and a <space> character.</ul> 42<b>An optional printf-style message</b><ul compact><li>The supplied message <b>fmt</b>, if non-NULL, in which the 43ANSI C X3.159-1989 (ANSI C) printf function specifies how subsequent parameters 44are converted for output.</ul> 45<b>A separator</b><ul compact><li>Two separating characters: a colon and a <space> character.</ul> 46<b>A standard error string</b><ul compact><li>The standard system or Berkeley DB library error string associated with the 47<b>error</b> value, as returned by the <a href="/api_c/env_strerror.html">db_strerror</a> method.</ul> 48<br> 49</blockquote> 50<p>The <a href="/api_c/db_err.html">DB->errx</a> and DB_ENV->errx methods are the same as the 51<a href="/api_c/db_err.html">DB->err</a> and DB_ENV->err methods, except they do not append the 52final separator characters and standard error string to the error 53message.</p> 54<p>This constructed error message is then handled as follows:</p> 55<blockquote><p>If an error callback function has been set (see <a href="/api_c/db_set_errcall.html">DB->set_errcall</a> 56and <a href="/api_c/env_set_errcall.html">DB_ENV->set_errcall</a>), that function is called with two 57parameters: any prefix string specified (see <a href="/api_c/db_set_errpfx.html">DB->set_errpfx</a> and 58<a href="/api_c/env_set_errpfx.html">DB_ENV->set_errpfx</a>) and the error message.</p> 59<p>If a C library FILE * has been set (see <a href="/api_c/db_set_errfile.html">DB->set_errfile</a> and 60<a href="/api_c/env_set_errfile.html">DB_ENV->set_errfile</a>), the error message is written to that output 61stream.</p> 62<p>If none of these output options has been configured, the error message 63is written to stderr, the standard error output stream.</p></blockquote> 64<b>Parameters</b> <br> 65 <b>error</b><ul compact><li>The <b>error</b> parameter is the error value for which the 66DB_ENV->err and <a href="/api_c/db_err.html">DB->err</a> methods will display a explanatory 67string.</ul> 68 <b>fmt</b><ul compact><li>The <b>fmt</b> parameter is an optional printf-style message to display.</ul> 69<br> 70<hr size=1 noshade> 71<br><b>Class</b> 72<a href="/api_c/env_class.html">DB_ENV</a> 73<br><b>See Also</b> 74<a href="/api_c/env_list.html">Database Environments and Related Methods</a> 75</tt> 76<table width="100%"><tr><td><br></td><td align=right> 77<a href="/api_c/api_core.html"><img src="/images/api.gif" alt="API"></a><a href="/ref/toc.html"><img src="/images/ref.gif" alt="Ref"></a> 78</td></tr></table> 79<p><font size=1>Copyright (c) 1996,2008 Oracle. All rights reserved.</font> 80</body> 81</html> 82