1<?xml version="1.0" encoding="UTF-8" standalone="no"?> 2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 3<html xmlns="http://www.w3.org/1999/xhtml"> 4 <head> 5 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 6 <title>DB->set_msgfile()</title> 7 <link rel="stylesheet" href="apiReference.css" type="text/css" /> 8 <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /> 9 <link rel="start" href="index.html" title="Berkeley DB C API Reference" /> 10 <link rel="up" href="db.html" title="Chapter 2. The DB Handle" /> 11 <link rel="prev" href="dbset_msgcall.html" title="DB->set_msgcall()" /> 12 <link rel="next" href="dbset_pagesize.html" title="DB->set_pagesize()" /> 13 </head> 14 <body> 15 <div class="navheader"> 16 <table width="100%" summary="Navigation header"> 17 <tr> 18 <th colspan="3" align="center">DB->set_msgfile()</th> 19 </tr> 20 <tr> 21 <td width="20%" align="left"><a accesskey="p" href="dbset_msgcall.html">Prev</a> </td> 22 <th width="60%" align="center">Chapter 2. 23 The DB Handle 24 </th> 25 <td width="20%" align="right"> <a accesskey="n" href="dbset_pagesize.html">Next</a></td> 26 </tr> 27 </table> 28 <hr /> 29 </div> 30 <div class="sect1" lang="en" xml:lang="en"> 31 <div class="titlepage"> 32 <div> 33 <div> 34 <h2 class="title" style="clear: both"><a id="dbset_msgfile"></a>DB->set_msgfile()</h2> 35 </div> 36 </div> 37 </div> 38 <pre class="programlisting">#include <db.h> 39 40void 41DB->set_msgfile(DB *db, FILE *msgfile); </pre> 42 <p> 43 There are interfaces in the Berkeley DB library which either directly 44 output informational messages or statistical information, or configure 45 the library to output such messages when performing other operations, 46 for example, 47 <a class="xref" href="envset_verbose.html" title="DB_ENV->set_verbose()">DB_ENV->set_verbose()</a> and 48 <a class="xref" href="envstat.html" title="DB_ENV->stat_print()">DB_ENV->stat_print()</a>. 49 </p> 50 <p> 51 The <a class="xref" href="envset_msgfile.html" title="DB_ENV->set_msgfile()">DB_ENV->set_msgfile()</a> and 52 <code class="methodname">DB->set_msgfile()</code> methods are used to display these messages for the 53 application. In this case the message will include a trailing 54 <newline> character. 55 </p> 56 <p> 57 Setting <span class="bold"><strong>msgfile</strong></span> to NULL unconfigures 58 the interface. 59 </p> 60 <p> 61 Alternatively, you can use the 62 63 64 <a class="xref" href="envset_msgcall.html" title="DB_ENV->set_msgcall()">DB_ENV->set_msgcall()</a> or 65 <a class="xref" href="dbset_msgcall.html" title="DB->set_msgcall()">DB->set_msgcall()</a> 66 methods to capture the additional error information in a way that does 67 not use C library FILE *'s. 68 69 </p> 70 <p> 71 For <a class="link" href="db.html" title="Chapter 2. The DB Handle">DB</a> handles opened 72 inside of Berkeley DB environments, calling the <code class="methodname">DB->set_msgfile()</code> 73 method affects the entire environment and is equivalent to calling the 74 <a class="xref" href="envset_msgfile.html" title="DB_ENV->set_msgfile()">DB_ENV->set_msgfile()</a> 75 method. 76 </p> 77 <p> 78 The <code class="methodname">DB->set_msgfile()</code> method configures operations performed using 79 the specified <a class="link" href="db.html" title="Chapter 2. The DB Handle">DB</a> handle, 80 not all operations performed on the underlying database. 81 </p> 82 <p> 83 The <code class="methodname">DB->set_msgfile()</code> method may be called at any time during the 84 life of the application. 85 </p> 86 <div class="sect2" lang="en" xml:lang="en"> 87 <div class="titlepage"> 88 <div> 89 <div> 90 <h3 class="title"><a id="id1648598"></a>Parameters</h3> 91 </div> 92 </div> 93 </div> 94 <div class="sect3" lang="en" xml:lang="en"> 95 <div class="titlepage"> 96 <div> 97 <div> 98 <h4 class="title"><a id="id1648526"></a>msgfile</h4> 99 </div> 100 </div> 101 </div> 102 <p> 103 The <span class="bold"><strong>msgfile</strong></span> parameter is a C library 104 FILE * to be used for displaying messages. 105 </p> 106 </div> 107 </div> 108 <div class="sect2" lang="en" xml:lang="en"> 109 <div class="titlepage"> 110 <div> 111 <div> 112 <h3 class="title"><a id="id1648599"></a>Class</h3> 113 </div> 114 </div> 115 </div> 116 <p> 117 <a class="link" href="db.html" title="Chapter 2. The DB Handle">DB</a> 118 </p> 119 </div> 120 <div class="sect2" lang="en" xml:lang="en"> 121 <div class="titlepage"> 122 <div> 123 <div> 124 <h3 class="title"><a id="id1648731"></a>See Also</h3> 125 </div> 126 </div> 127 </div> 128 <p> 129 <a class="xref" href="db.html#dblist" title="Database and Related Methods">Database and Related Methods</a> 130 </p> 131 </div> 132 </div> 133 <div class="navfooter"> 134 <hr /> 135 <table width="100%" summary="Navigation footer"> 136 <tr> 137 <td width="40%" align="left"><a accesskey="p" href="dbset_msgcall.html">Prev</a> </td> 138 <td width="20%" align="center"> 139 <a accesskey="u" href="db.html">Up</a> 140 </td> 141 <td width="40%" align="right"> <a accesskey="n" href="dbset_pagesize.html">Next</a></td> 142 </tr> 143 <tr> 144 <td width="40%" align="left" valign="top">DB->set_msgcall() </td> 145 <td width="20%" align="center"> 146 <a accesskey="h" href="index.html">Home</a> 147 </td> 148 <td width="40%" align="right" valign="top"> DB->set_pagesize()</td> 149 </tr> 150 </table> 151 </div> 152 </body> 153</html> 154