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_MPOOLFILE->put()</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="memp.html" title="Chapter 8. The DB_MPOOLFILE Handle" /> 11 <link rel="prev" href="mempfopen.html" title="DB_MPOOLFILE->open()" /> 12 <link rel="next" href="mempfsync.html" title="DB_MPOOLFILE->sync()" /> 13 </head> 14 <body> 15 <div class="navheader"> 16 <table width="100%" summary="Navigation header"> 17 <tr> 18 <th colspan="3" align="center">DB_MPOOLFILE->put()</th> 19 </tr> 20 <tr> 21 <td width="20%" align="left"><a accesskey="p" href="mempfopen.html">Prev</a> </td> 22 <th width="60%" align="center">Chapter 8. 23 The DB_MPOOLFILE Handle 24 </th> 25 <td width="20%" align="right"> <a accesskey="n" href="mempfsync.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="mempput"></a>DB_MPOOLFILE->put()</h2> 35 </div> 36 </div> 37 </div> 38 <pre class="programlisting">#include <db.h> 39 40int 41DB_MPOOLFILE->put(DB_MPOOLFILE *mpf, 42 void *pgaddr, DB_CACHE_PRIORITY priority, u_int32_t flags); </pre> 43 <p> 44 The <code class="methodname">DB_MPOOLFILE->put()</code> method returns a reference to a page in the 45 cache, setting the priority of the page as specified by the <span class="bold"><strong>priority</strong></span> parameter. 46 </p> 47 <p> 48 The <code class="methodname">DB_MPOOLFILE->put()</code> <span> 49 <span> 50 method returns a non-zero error value on failure and 0 on success. 51 </span> 52 53 </span> 54 </p> 55 <div class="sect2" lang="en" xml:lang="en"> 56 <div class="titlepage"> 57 <div> 58 <div> 59 <h3 class="title"><a id="id1689919"></a>Parameters</h3> 60 </div> 61 </div> 62 </div> 63 <div class="sect3" lang="en" xml:lang="en"> 64 <div class="titlepage"> 65 <div> 66 <div> 67 <h4 class="title"><a id="id1690356"></a>flags</h4> 68 </div> 69 </div> 70 </div> 71 <p> 72 The <span class="bold"><strong>flags</strong></span> parameter is currently 73 unused, and must be set to 0. 74 </p> 75 </div> 76 <div class="sect3" lang="en" xml:lang="en"> 77 <div class="titlepage"> 78 <div> 79 <div> 80 <h4 class="title"><a id="id1690578"></a>pgaddr</h4> 81 </div> 82 </div> 83 </div> 84 <p> 85 The <span class="bold"><strong>pgaddr</strong></span> parameter is the address 86 of the page to be returned to the cache. The <span class="bold"><strong>pgaddr</strong></span> parameter must be a value previously 87 returned by the 88 <a class="xref" href="mempfget.html" title="DB_MPOOLFILE->get()">DB_MPOOLFILE->get()</a> method. 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="id1690604"></a>priority</h4> 96 </div> 97 </div> 98 </div> 99 <p> 100 Set the page's <span class="bold"><strong>priority</strong></span> as follows: 101 </p> 102 <div class="itemizedlist"> 103 <ul type="disc"> 104 <li> 105 <p><a id="fput_DB_PRIORITY_UNCHANGED"></a> 106 <code class="literal">DB_PRIORITY_UNCHANGED</code> 107 </p> 108 <p> 109 The priority is unchanged. 110 </p> 111 </li> 112 <li> 113 <p> 114 <code class="literal">DB_PRIORITY_VERY_LOW</code> 115 </p> 116 <p> 117 The lowest priority: pages are the most likely to be discarded. 118 </p> 119 </li> 120 <li> 121 <p> 122 <code class="literal">DB_PRIORITY_LOW</code> 123 </p> 124 <p> 125 The next lowest priority. 126 </p> 127 </li> 128 <li> 129 <p> 130 <code class="literal">DB_PRIORITY_DEFAULT</code> 131 </p> 132 <p> 133 The default priority. 134 </p> 135 </li> 136 <li> 137 <p> 138 <code class="literal">DB_PRIORITY_HIGH</code> 139 </p> 140 <p> 141 The next highest priority. 142 </p> 143 </li> 144 <li> 145 <p> 146 <code class="literal">DB_PRIORITY_VERY_HIGH</code> 147 </p> 148 <p> 149 The highest priority: pages are the least likely to be discarded. 150 </p> 151 </li> 152 </ul> 153 </div> 154 </div> 155 </div> 156 <div class="sect2" lang="en" xml:lang="en"> 157 <div class="titlepage"> 158 <div> 159 <div> 160 <h3 class="title"><a id="id1690480"></a>Errors</h3> 161 </div> 162 </div> 163 </div> 164 <p> 165 The <code class="methodname">DB_MPOOLFILE->put()</code> <span> 166 <span> 167 method may fail and return one of the following non-zero errors: 168 </span> 169 170 </span> 171 </p> 172 <div class="sect3" lang="en" xml:lang="en"> 173 <div class="titlepage"> 174 <div> 175 <div> 176 <h4 class="title"><a id="id1690829"></a>EINVAL</h4> 177 </div> 178 </div> 179 </div> 180 <p> 181 An invalid flag value or parameter was specified. 182 </p> 183 </div> 184 </div> 185 <div class="sect2" lang="en" xml:lang="en"> 186 <div class="titlepage"> 187 <div> 188 <div> 189 <h3 class="title"><a id="id1690565"></a>Class</h3> 190 </div> 191 </div> 192 </div> 193 <p> 194 <a class="link" href="env.html" title="Chapter 5. The DB_ENV Handle">DB_ENV</a>, <a class="link" href="memp.html" title="Chapter 8. The DB_MPOOLFILE Handle">DB_MPOOLFILE</a> 195 </p> 196 </div> 197 <div class="sect2" lang="en" xml:lang="en"> 198 <div class="titlepage"> 199 <div> 200 <div> 201 <h3 class="title"><a id="id1690785"></a>See Also</h3> 202 </div> 203 </div> 204 </div> 205 <p> 206 <a class="xref" href="memp.html#memplist" title="Memory Pools and Related Methods">Memory Pools and Related Methods</a> 207 </p> 208 </div> 209 </div> 210 <div class="navfooter"> 211 <hr /> 212 <table width="100%" summary="Navigation footer"> 213 <tr> 214 <td width="40%" align="left"><a accesskey="p" href="mempfopen.html">Prev</a> </td> 215 <td width="20%" align="center"> 216 <a accesskey="u" href="memp.html">Up</a> 217 </td> 218 <td width="40%" align="right"> <a accesskey="n" href="mempfsync.html">Next</a></td> 219 </tr> 220 <tr> 221 <td width="40%" align="left" valign="top">DB_MPOOLFILE->open() </td> 222 <td width="20%" align="center"> 223 <a accesskey="h" href="index.html">Home</a> 224 </td> 225 <td width="40%" align="right" valign="top"> DB_MPOOLFILE->sync()</td> 226 </tr> 227 </table> 228 </div> 229 </body> 230</html> 231