Debian Codegraph @

docs/api_reference/C/logfile.html

raw symbols SCIP
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_ENV-&gt;log_file()</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="lsn.html" title="Chapter 7.  The DB_LSN Handle" />
11 <link rel="prev" href="logcursor.html" title="DB_ENV-&gt;log_cursor()" />
12 <link rel="next" href="logflush.html" title="DB_ENV-&gt;log_flush()" />
13 </head>
14 <body>
15 <div xmlns="" class="navheader">
16 <div class="libver">
17 <p>Library Version 11.2.5.3</p>
18 </div>
19 <table width="100%" summary="Navigation header">
20 <tr>
21 <th colspan="3" align="center">DB_ENV-&gt;log_file()</th>
22 </tr>
23 <tr>
24 <td width="20%" align="left"><a accesskey="p" href="logcursor.html">Prev</a> </td>
25 <th width="60%" align="center">Chapter 7. 
26 The DB_LSN Handle
27 </th>
28 <td width="20%" align="right"> <a accesskey="n" href="logflush.html">Next</a></td>
29 </tr>
30 </table>
31 <hr />
32 </div>
33 <div class="sect1" lang="en" xml:lang="en">
34 <div class="titlepage">
35 <div>
36 <div>
37 <h2 class="title" style="clear: both"><a id="logfile"></a>DB_ENV-&gt;log_file()</h2>
38 </div>
39 </div>
40 </div>
41 <pre class="programlisting">#include &lt;db.h&gt;
42
43 int
44 DB_ENV-&gt;log_file(DB_ENV *env,
45 const DB_LSN *lsn, char *namep, size_t len); </pre>
46 <p>
47 The <code class="methodname">DB_ENV-&gt;log_file()</code> method maps
48 <code class="classname">DB_LSN</code> structures to filenames,
49 returning the name of the file containing the record named by
50 <span class="bold"><strong>lsn</strong></span>.
51 </p>
52 <p>
53 This mapping of <code class="classname">DB_LSN</code> structures to files is needed for database
54 administration. For example, a transaction manager typically records
55 the earliest <a class="link" href="lsn.html" title="Chapter 7.  The DB_LSN Handle">DB_LSN</a>
56 needed for restart, and the database administrator may want to archive
57 log files to tape when they contain only
58 <a class="link" href="lsn.html" title="Chapter 7.  The DB_LSN Handle">DB_LSN</a> entries before the
59 earliest one needed for restart.
60 </p>
61 <p>
62 The <code class="methodname">DB_ENV-&gt;log_file()</code> <span>
63 <span>
64 method returns a non-zero error value on failure and 0 on success.
65 </span>
66
67 </span>
68 </p>
69 <div class="sect2" lang="en" xml:lang="en">
70 <div class="titlepage">
71 <div>
72 <div>
73 <h3 class="title"><a id="idp52857376"></a>Parameters</h3>
74 </div>
75 </div>
76 </div>
77 <div class="sect3" lang="en" xml:lang="en">
78 <div class="titlepage">
79 <div>
80 <div>
81 <h4 class="title"><a id="idp52857224"></a>lsn</h4>
82 </div>
83 </div>
84 </div>
85 <p>
86 The <span class="bold"><strong>lsn</strong></span> parameter is the
87 <code class="classname">DB_LSN</code> structure for which a
88 filename is wanted.
89 </p>
90 </div>
91 <div class="sect3" lang="en" xml:lang="en">
92 <div class="titlepage">
93 <div>
94 <div>
95 <h4 class="title"><a id="idp52871192"></a>namep</h4>
96 </div>
97 </div>
98 </div>
99 <p>
100 The <span class="bold"><strong>namep</strong></span> parameter references memory
101 into which the name of the file containing the record named by
102 <span class="bold"><strong>lsn</strong></span> is copied.
103 </p>
104 </div>
105 <div class="sect3" lang="en" xml:lang="en">
106 <div class="titlepage">
107 <div>
108 <div>
109 <h4 class="title"><a id="idp52858216"></a>len</h4>
110 </div>
111 </div>
112 </div>
113 <p>
114 The <span class="bold"><strong>len</strong></span> parameter is the length of
115 the <span class="bold"><strong>namep</strong></span> buffer in bytes. If
116 <span class="bold"><strong>namep</strong></span> is too short to hold the
117 filename, <code class="methodname">DB_ENV-&gt;log_file()</code> will fail. (Log filenames
118 are always 14 characters long.)
119 </p>
120 </div>
121 </div>
122 <div class="sect2" lang="en" xml:lang="en">
123 <div class="titlepage">
124 <div>
125 <div>
126 <h3 class="title"><a id="idp52872464"></a>Errors</h3>
127 </div>
128 </div>
129 </div>
130 <p>
131 The <code class="methodname">DB_ENV-&gt;log_file()</code> <span>
132 <span>
133 method may fail and return one of the following non-zero errors:
134 </span>
135
136 </span>
137 </p>
138 <div class="sect3" lang="en" xml:lang="en">
139 <div class="titlepage">
140 <div>
141 <div>
142 <h4 class="title"><a id="idp52877112"></a>EINVAL</h4>
143 </div>
144 </div>
145 </div>
146 <p>
147 If supplied buffer was too small to hold the log filename;
148 or if an invalid flag value or parameter was specified.
149 </p>
150 </div>
151 </div>
152 <div class="sect2" lang="en" xml:lang="en">
153 <div class="titlepage">
154 <div>
155 <div>
156 <h3 class="title"><a id="idp52875088"></a>Class</h3>
157 </div>
158 </div>
159 </div>
160 <p>
161 <a class="link" href="env.html" title="Chapter 5.  The DB_ENV Handle">DB_ENV</a>,
162 <a class="link" href="logc.html" title="The DB_LOGC Handle">DB_LOGC</a>,
163 <a class="link" href="lsn.html" title="Chapter 7.  The DB_LSN Handle">DB_LSN</a>
164 </p>
165 </div>
166 <div class="sect2" lang="en" xml:lang="en">
167 <div class="titlepage">
168 <div>
169 <div>
170 <h3 class="title"><a id="idp52878448"></a>See Also</h3>
171 </div>
172 </div>
173 </div>
174 <p>
175 <a class="xref" href="lsn.html#loglist" title="Logging Subsystem and Related Methods">Logging Subsystem and Related Methods</a>
176 </p>
177 </div>
178 </div>
179 <div class="navfooter">
180 <hr />
181 <table width="100%" summary="Navigation footer">
182 <tr>
183 <td width="40%" align="left"><a accesskey="p" href="logcursor.html">Prev</a> </td>
184 <td width="20%" align="center">
185 <a accesskey="u" href="lsn.html">Up</a>
186 </td>
187 <td width="40%" align="right"> <a accesskey="n" href="logflush.html">Next</a></td>
188 </tr>
189 <tr>
190 <td width="40%" align="left" valign="top">DB_ENV-&gt;log_cursor() </td>
191 <td width="20%" align="center">
192 <a accesskey="h" href="index.html">Home</a>
193 </td>
194 <td width="40%" align="right" valign="top"> DB_ENV-&gt;log_flush()</td>
195 </tr>
196 </table>
197 </div>
198 </body>
199 </html>