• Home
  • History
  • Annotate
  • Line#
  • Navigate
  • Raw
  • Download
  • only in /asuswrt-rt-n18u-9.0.0.4.380.2695/release/src-rt/router/db-4.8.30/docs/api_reference/C/
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;add_data_dir()</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="env.html" title="Chapter��5.�� The DB_ENV Handle" />
11    <link rel="prev" href="dbgetenv.html" title="DB-&gt;get_env()" />
12    <link rel="next" href="envclose.html" title="DB_ENV-&gt;close()" />
13  </head>
14  <body>
15    <div class="navheader">
16      <table width="100%" summary="Navigation header">
17        <tr>
18          <th colspan="3" align="center">DB_ENV-&gt;add_data_dir()</th>
19        </tr>
20        <tr>
21          <td width="20%" align="left"><a accesskey="p" href="dbgetenv.html">Prev</a>��</td>
22          <th width="60%" align="center">Chapter��5.��
23                The DB_ENV Handle
24        </th>
25          <td width="20%" align="right">��<a accesskey="n" href="envclose.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="envadd_data_dir"></a>DB_ENV-&gt;add_data_dir()</h2>
35          </div>
36        </div>
37      </div>
38      <pre class="programlisting">#include &lt;db.h&gt;
39
40int
41DB_ENV-&gt;add_data_dir(DB_ENV *dbenv, const char *dir);  </pre>
42      <p>
43         Add the path of a directory to be used as the location of the access
44         method database files.  Paths specified to the 
45         <a class="xref" href="dbopen.html" title="DB-&gt;open()">DB-&gt;open()</a>  function will be
46         searched relative to this path.  Paths set using this method are
47         additive, and specifying more than one will result in each specified
48         directory being searched for database files.  
49    </p>
50      <p>
51         If no database directories are specified, database files must be named
52         either by absolute paths or relative to the environment home
53         directory. See <a href="../../programmer_reference/env_naming.html" class="olink">Berkeley DB File Naming</a> for more information.
54    </p>
55      <p>
56         The database environment's data directories may also be configured
57         using the environment's <a href="../../programmer_reference/env_db_config.html#env_db_config.DB_CONFIG" class="olink">DB_CONFIG</a> file.  The
58         syntax of the entry in that file is a single line with the string
59         "add_data_dir", one or more whitespace characters, and the directory
60         name.
61    </p>
62      <p>
63         The <code class="methodname">DB_ENV-&gt;add_data_dir()</code> method configures operations performed
64         using the specified <a class="link" href="env.html" title="Chapter��5.�� The DB_ENV Handle">DB_ENV</a>  
65         handle, not all operations performed on the underlying database environment.
66    </p>
67      <p>
68         The <code class="methodname">DB_ENV-&gt;add_data_dir()</code> method may not be called after the 
69         <a class="xref" href="envopen.html" title="DB_ENV-&gt;open()">DB_ENV-&gt;open()</a>  method is called.
70         If the database environment already exists when 
71         <a class="xref" href="envopen.html" title="DB_ENV-&gt;open()">DB_ENV-&gt;open()</a>  is called, the
72         information specified to <code class="methodname">DB_ENV-&gt;add_data_dir()</code> must be consistent
73         with the existing environment or corruption can occur.
74    </p>
75      <p>
76         The <code class="methodname">DB_ENV-&gt;add_data_dir()</code> <span>
77            <span>
78                  method returns a non-zero error value on failure and 0 on success.
79            </span>
80            
81        </span>
82    </p>
83      <div class="sect2" lang="en" xml:lang="en">
84        <div class="titlepage">
85          <div>
86            <div>
87              <h3 class="title"><a id="id1660700"></a>Parameters</h3>
88            </div>
89          </div>
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="id1660635"></a>dir</h4>
96              </div>
97            </div>
98          </div>
99          <p>
100                          The <span class="bold"><strong>dir</strong></span> parameter is a directory to
101                          be used as a location for database files.
102                     </p>
103          <p>
104                             When using a Unicode build on Windows (the default), this argument will be interpreted
105                             as a UTF-8 string, which is equivalent to ASCII for Latin characters.
106                     </p>
107        </div>
108      </div>
109      <div class="sect2" lang="en" xml:lang="en">
110        <div class="titlepage">
111          <div>
112            <div>
113              <h3 class="title"><a id="id1660781"></a>Errors</h3>
114            </div>
115          </div>
116        </div>
117        <p>
118                         The <code class="methodname">DB_ENV-&gt;add_data_dir()</code> <span>
119            <span>
120                 method may fail and return one of the following non-zero errors:
121            </span>
122            
123        </span>
124                    </p>
125        <div class="sect3" lang="en" xml:lang="en">
126          <div class="titlepage">
127            <div>
128              <div>
129                <h4 class="title"><a id="id1660706"></a>EINVAL</h4>
130              </div>
131            </div>
132          </div>
133          <p>
134                If the method was called after <a class="xref" href="envopen.html" title="DB_ENV-&gt;open()">DB_ENV-&gt;open()</a> 
135                was called; or if an invalid flag value or parameter was specified.
136            </p>
137        </div>
138      </div>
139      <div class="sect2" lang="en" xml:lang="en">
140        <div class="titlepage">
141          <div>
142            <div>
143              <h3 class="title"><a id="id1660713"></a>Class</h3>
144            </div>
145          </div>
146        </div>
147        <p>
148                <a class="link" href="env.html" title="Chapter��5.�� The DB_ENV Handle">DB_ENV</a>  
149            </p>
150      </div>
151      <div class="sect2" lang="en" xml:lang="en">
152        <div class="titlepage">
153          <div>
154            <div>
155              <h3 class="title"><a id="id1660685"></a>See Also</h3>
156            </div>
157          </div>
158        </div>
159        <p>
160                     <a class="xref" href="env.html#envlist" title="Database Environments and Related Methods">Database Environments and Related Methods</a> 
161                </p>
162      </div>
163    </div>
164    <div class="navfooter">
165      <hr />
166      <table width="100%" summary="Navigation footer">
167        <tr>
168          <td width="40%" align="left"><a accesskey="p" href="dbgetenv.html">Prev</a>��</td>
169          <td width="20%" align="center">
170            <a accesskey="u" href="env.html">Up</a>
171          </td>
172          <td width="40%" align="right">��<a accesskey="n" href="envclose.html">Next</a></td>
173        </tr>
174        <tr>
175          <td width="40%" align="left" valign="top">DB-&gt;get_env()��</td>
176          <td width="20%" align="center">
177            <a accesskey="h" href="index.html">Home</a>
178          </td>
179          <td width="40%" align="right" valign="top">��DB_ENV-&gt;close()</td>
180        </tr>
181      </table>
182    </div>
183  </body>
184</html>
185