1<!--$Id: db_set_msgfile.so,v 1.1 2004/07/14 19:30:39 bostic Exp $--> 2<!--$Id: env_set_msgfile.so,v 10.7 2006/02/10 22:54:59 bostic Exp $--> 3<!--Copyright (c) 1997,2008 Oracle. All rights reserved.--> 4<!--See the file LICENSE for redistribution information.--> 5<html> 6<head> 7<title>Berkeley DB: DB->set_msgfile</title> 8<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit."> 9<meta name="keywords" content="embedded,database,programmatic,toolkit,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,Java,C,C++"> 10</head> 11<body bgcolor=white> 12<table width="100%"><tr valign=top> 13<td> 14<b>DB->set_msgfile</b> 15</td> 16<td align=right> 17<a href="../api_c/api_core.html"><img src="../images/api.gif" alt="API"></a> 18<a href="../ref/toc.html"><img src="../images/ref.gif" alt="Ref"></a></td> 19</tr></table> 20<hr size=1 noshade> 21<tt> 22<b><pre> 23#include <db.h> 24<p> 25void 26DB->set_msgfile(DB *db, FILE *msgfile); 27<p> 28void 29DB->get_msgfile(DB *db, FILE **msgfilep); 30</pre></b> 31<hr size=1 noshade> 32<b>Description: DB->set_msgfile</b> 33<p>There are interfaces in the Berkeley DB library which either directly output 34informational messages or statistical information, or configure the 35library to output such messages when performing other operations, for 36example, <a href="../api_c/env_set_verbose.html">DB_ENV->set_verbose</a> and <a href="../api_c/env_stat.html">DB_ENV->stat_print</a>.</p> 37<p>The <a href="../api_c/env_set_msgfile.html">DB_ENV->set_msgfile</a> and DB->set_msgfile methods are used to 38display these messages for the application. 39In this case the message will include a trailing <newline> 40character.</p> 41<p>Setting <b>msgfile</b> to NULL unconfigures the interface.</p> 42<p>Alternatively, you can use the <a href="../api_c/env_set_msgcall.html">DB_ENV->set_msgcall</a> or 43<a href="../api_c/db_set_msgcall.html">DB->set_msgcall</a> methods to capture the additional error information 44in a way that does not use C library FILE *'s.</p> 45<p>For <a href="../api_c/db_class.html">DB</a> handles opened inside of Berkeley DB environments, calling the 46DB->set_msgfile method affects the entire environment and is equivalent to calling 47the <a href="../api_c/env_set_msgfile.html">DB_ENV->set_msgfile</a> method.</p> 48<p>The DB->set_msgfile method configures operations performed using the specified 49<a href="../api_c/db_class.html">DB</a> handle, not all operations performed on the underlying 50database.</p> 51<p>The DB->set_msgfile method may be called at any time during the life of the 52application.</p> 53<b>Parameters</b> <br> 54 <b>msgfile</b><ul compact><li>The <b>msgfile</b> parameter is a C library FILE * to be used for 55displaying messages.</ul> 56<br> 57<hr size=1 noshade> 58<b>Description: DB->get_msgfile</b> 59<p>The DB->get_msgfile method returns the FILE *.</p> 60<p>The DB->get_msgfile method may be called at any time during the life of the 61application.</p> 62<p>The DB->get_msgfile method 63returns a non-zero error value on failure 64and 0 on success. 65</p> 66<b>Parameters</b> <br> 67 <b>msgfilep</b><ul compact><li>The DB->get_msgfile method returns the 68FILE * in <b>msgfilep</b>.</ul> 69<br> 70<hr size=1 noshade> 71<br><b>Class</b> 72<a href="../api_c/db_class.html">DB</a> 73<br><b>See Also</b> 74<a href="../api_c/db_list.html">Databases 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