Debian Codegraph @

docs/api_reference/C/envcreate.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_create</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="envclose.html" title="DB_ENV-&gt;close()" />
12 <link rel="next" href="envdbbackup.html" title="DB_ENV-&gt;dbbackup()" />
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_create</th>
22 </tr>
23 <tr>
24 <td width="20%" align="left"><a accesskey="p" href="envclose.html">Prev</a> </td>
25 <th width="60%" align="center">Chapter 5. 
26 The DB_ENV Handle
27 </th>
28 <td width="20%" align="right"> <a accesskey="n" href="envdbbackup.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="envcreate"></a>db_env_create</h2>
38 </div>
39 </div>
40 </div>
41 <pre class="programlisting">#include &lt;db.h&gt;
42
43 int
44 db_env_create(DB_ENV **dbenvp, u_int32_t flags); </pre>
45 <p>
46 The <code class="function">db_env_create()</code> function creates a <code class="classname">DB_ENV</code>
47 structure that is the handle for a Berkeley DB environment. This function allocates memory for the structure,
48 returning a pointer to the structure in the memory to which
49 <span class="bold"><strong>dbenvp</strong></span> refers. To release the allocated memory and discard the
50 handle, call the
51 <a class="xref" href="envclose.html" title="DB_ENV-&gt;close()">DB_ENV-&gt;close()</a> or
52 <a class="xref" href="envremove.html" title="DB_ENV-&gt;remove()">DB_ENV-&gt;remove()</a> methods.
53 </p>
54 <p>
55 <code class="classname">DB_ENV</code> handles are free-threaded if the
56 <a class="link" href="envopen.html#envopen_DB_THREAD">DB_THREAD</a> flag is specified to the
57 <a class="xref" href="envopen.html" title="DB_ENV-&gt;open()">DB_ENV-&gt;open()</a> method when the environment is opened.
58 The <code class="classname">DB_ENV</code> handle should not be closed while any other handle
59 remains open that is using it as a reference (for example,
60 <a class="link" href="db.html" title="Chapter 2.  The DB Handle">DB</a> or <a class="link" href="txn.html" title="Chapter 12.  The DB_TXN Handle">DB_TXN</a>).
61 Once either the
62 <a class="xref" href="envclose.html" title="DB_ENV-&gt;close()">DB_ENV-&gt;close()</a> or
63 <a class="xref" href="envremove.html" title="DB_ENV-&gt;remove()">DB_ENV-&gt;remove()</a>
64 methods are called, the handle may not be accessed again, regardless of the method's return.
65 </p>
66 <p>
67 Before the handle may be used, you must open it using the
68 <a class="xref" href="envopen.html" title="DB_ENV-&gt;open()">DB_ENV-&gt;open()</a>
69 method.
70 </p>
71 <p>
72 The DB_ENV handle contains a special field, <code class="literal">app_private</code>, which is declared as type
73 <code class="literal">void *</code>. This field is
74 provided for the use of the application program. It is initialized to NULL and is not further used by
75 Berkeley DB in any way.
76 </p>
77 <p>
78 The <code class="function">db_env_create()</code> method returns a non-zero error value on failure and 0 on success.
79 </p>
80 <p>
81 The <span class="bold"><strong>flags</strong></span> parameter must be set to 0.
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="idp51271592"></a>Class</h3>
88 </div>
89 </div>
90 </div>
91 <p>
92 <a class="link" href="env.html" title="Chapter 5.  The DB_ENV Handle">DB_ENV</a>
93 </p>
94 </div>
95 <div class="sect2" lang="en" xml:lang="en">
96 <div class="titlepage">
97 <div>
98 <div>
99 <h3 class="title"><a id="idp51313416"></a>See Also</h3>
100 </div>
101 </div>
102 </div>
103 <p>
104 <a class="xref" href="env.html#envlist" title="Database Environments and Related Methods">Database Environments and Related Methods</a>
105 </p>
106 </div>
107 </div>
108 <div class="navfooter">
109 <hr />
110 <table width="100%" summary="Navigation footer">
111 <tr>
112 <td width="40%" align="left"><a accesskey="p" href="envclose.html">Prev</a> </td>
113 <td width="20%" align="center">
114 <a accesskey="u" href="env.html">Up</a>
115 </td>
116 <td width="40%" align="right"> <a accesskey="n" href="envdbbackup.html">Next</a></td>
117 </tr>
118 <tr>
119 <td width="40%" align="left" valign="top">DB_ENV-&gt;close() </td>
120 <td width="20%" align="center">
121 <a accesskey="h" href="index.html">Home</a>
122 </td>
123 <td width="40%" align="right" valign="top"> DB_ENV-&gt;dbbackup()</td>
124 </tr>
125 </table>
126 </div>
127 </body>
128 </html>