Sophie

Sophie

distrib > Mandriva > 2007.0 > x86_64 > media > main-release > by-pkgid > a4c98df40e78f6c892308fd6841f950a > files > 144

lib64db4.2-devel-4.2.52-11mdv2007.0.x86_64.rpm

<!--$Id: memp_fget.so,v 10.42 2003/11/08 19:17:39 bostic Exp $-->
<!--Copyright 1997-2003 by Sleepycat Software, Inc.-->
<!--All rights reserved.-->
<!--See the file LICENSE for redistribution information.-->
<html>
<head>
<title>Berkeley DB: DB_MPOOLFILE-&gt;get</title>
<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit.">
<meta name="keywords" content="embedded,database,programmatic,toolkit,b+tree,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,Java,C,C++">
</head>
<body bgcolor=white>
<a name="2"><!--meow--></a>
<table width="100%"><tr valign=top>
<td>
<h3>DB_MPOOLFILE-&gt;get</h3>
</td>
<td align=right>
<a href="../../db42-devel-4.2.52/api_c/api_index.html"><img src="../../db42-4.2.52/images/api.gif" alt="API"></a>
<a href="../../db42-devel-4.2.52/ref/toc.html"><img src="../../db42-4.2.52/images/ref.gif" alt="Ref"></a>
</td></tr></table>
<hr size=1 noshade>
<tt>
<h3><pre>
#include &lt;db.h&gt;
<p>
int
DB_MPOOLFILE-&gt;get(DB_MPOOLFILE *mpf,
    db_pgno_t *pgnoaddr, u_int32_t flags, void **pagep);
</pre></h3>
<hr size=1 noshade>
<h3>Description: DB_MPOOLFILE-&gt;get</h3>
<p>The DB_MPOOLFILE-&gt;get method returns pages from the cache.</p>
<p>All pages returned by DB_MPOOLFILE-&gt;get will be retained (that is,
<i>pinned</i>), in the pool until a subsequent call to
<a href="../../db42-devel-4.2.52/api_c/memp_fput.html">DB_MPOOLFILE-&gt;put</a>.</p>
<p>The returned page is <b>size_t</b> type aligned.</p>
<p>Fully or partially created pages have all their bytes set to a nul byte,
unless the <a href="../../db42-devel-4.2.52/api_c/memp_set_clear_len.html">DB_MPOOLFILE-&gt;set_clear_len</a> method was called to specify other
behavior before the file was opened.</p>
<a name="3"><!--meow--></a>
<p>
The DB_MPOOLFILE-&gt;get method
will return DB_PAGE_NOTFOUND if the requested page does not exist and DB_MPOOL_CREATE was
not set.
Unless otherwise specified, the DB_MPOOLFILE-&gt;get method
returns a non-zero error value on failure
and 0 on success.
</p>
<h3>Parameters</h3>
<p><dl compact>
<p><dt><b>flags</b><dd>
The <b>flags</b> parameter must be set to 0 or by bitwise inclusively <b>OR</b>'ing together one
or more of the following values:
<p><dl compact>
<p><dt><a name="DB_MPOOL_CREATE">DB_MPOOL_CREATE</a><dd>If the specified page does not exist, create it.  In this case, the
<a href="memp_register.html#pgin">pgin</a> method, if specified, is
called.
<p><dt><a name="DB_MPOOL_LAST">DB_MPOOL_LAST</a><dd>Return the last page of the source file, and copy its page number into
the memory location to which <b>pgnoaddr</b> refers.
<p><dt><a name="DB_MPOOL_NEW">DB_MPOOL_NEW</a><dd>Create a new page in the file, and copy its page number into the memory
location to which <b>pgnoaddr</b> refers.  In this case, the
<a href="memp_register.html#pgin">pgin</a> method, if specified, is
<b>not</b> called.
</dl>
<p>The DB_MPOOL_CREATE, DB_MPOOL_LAST, and
DB_MPOOL_NEW flags are mutually exclusive.</p>
<p><dt><b>pagep</b><dd>
The <b>pagep</b> parameter references memory into which
a pointer to the returned page is copied.
<p><dt><b>pgnoaddr</b><dd>
If the <b>flags</b> parameter is set to DB_MPOOL_LAST or
DB_MPOOL_NEW, the page number of the created page is copied
into the memory location to which the <b>pgnoaddr</b> parameter
refers.  Otherwise, the <b>pgnoaddr</b> parameter is the page to
create or retrieve.
<p><b>Page numbers begin at 0; that is, the first page in the file is page
number 0, not page number 1.</b></p>
</dl>
<h3>Errors</h3>
<p>The DB_MPOOLFILE-&gt;get method
may fail and return one of the following non-zero errors:</p>
<p><dl compact>
<p><dt>EAGAIN<dd>The page reference count has overflowed.  (This should never happen
unless there is a bug in the application.)
</dl>
<p><dl compact>
<p><dt>EINVAL<dd>If the DB_MPOOL_NEW flag was set, and the source file was not
opened for writing;
more than one of DB_MPOOL_CREATE, DB_MPOOL_LAST, and
DB_MPOOL_NEW was set; or if an
invalid flag value or parameter was specified.
</dl>
<p><dl compact>
<p><dt>ENOMEM<dd>The cache is full, and no more pages will fit in the pool.
</dl>
<hr size=1 noshade>
<h3>Class</h3>
<a href="../../db42-devel-4.2.52/api_c/env_class.html">DB_ENV</a>, <a href="../../db42-devel-4.2.52/api_c/mempfile_class.html">DB_MPOOLFILE</a>
<h3>See Also</h3>
<a href="../../db42-devel-4.2.52/api_c/memp_list.html">Memory Pools and Related Methods</a>
</tt>
<table width="100%"><tr><td><br></td><td align=right>
<a href="../../db42-devel-4.2.52/api_c/api_index.html"><img src="../../db42-4.2.52/images/api.gif" alt="API"></a><a href="../../db42-devel-4.2.52/ref/toc.html"><img src="../../db42-4.2.52/images/ref.gif" alt="Ref"></a>
</td></tr></table>
<p><font size=1><a href="../../db42-devel-4.2.52/sleepycat/legal.html">Copyright (c) 1996-2003</a> <a href="http://www.sleepycat.com">Sleepycat Software, Inc.</a> - All rights reserved.</font>
</body>
</html>