1<!--$Id: memp_set_clear_len.so,v 10.18 2005/11/30 19:46:21 bostic Exp $--> 2<!--Copyright (c) 1997,2008 Oracle. All rights reserved.--> 3<!--See the file LICENSE for redistribution information.--> 4<html> 5<head> 6<title>Berkeley DB: DbMpoolFile::set_clear_len</title> 7<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit."> 8<meta name="keywords" content="embedded,database,programmatic,toolkit,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,Java,C,C++"> 9</head> 10<body bgcolor=white> 11<table width="100%"><tr valign=top> 12<td> 13<b>DbMpoolFile::set_clear_len</b> 14</td> 15<td align=right> 16<a href="../api_cxx/api_core.html"><img src="../images/api.gif" alt="API"></a> 17<a href="../ref/toc.html"><img src="../images/ref.gif" alt="Ref"></a></td> 18</tr></table> 19<hr size=1 noshade> 20<tt> 21<b><pre> 22#include <db_cxx.h> 23<p> 24int 25DbMpoolFile::set(u_int32_t len); 26<p> 27int 28DbMpoolFile::get_clear_len(u_int32_t *lenp); 29</pre></b> 30<hr size=1 noshade> 31<b>Description: DbMpoolFile::set_clear_len</b> 32<p>The DbMpoolFile::set_clear_len method sets the number of initial bytes in a 33page that should be set to nul when the page is created as a result of 34the <a href="../api_cxx/memp_fget.html#DB_MPOOL_CREATE">DB_MPOOL_CREATE</a> or <a href="../api_cxx/memp_fget.html#DB_MPOOL_NEW">DB_MPOOL_NEW</a> flags being 35specified to <a href="../api_cxx/memp_fget.html">DbMpoolFile::get</a>. If no clear length is specified, the 36entire page is cleared when it is created.</p> 37<p>The DbMpoolFile::set_clear_len method configures a file in the memory pool, not only 38operations performed using the specified <a href="../api_cxx/mempfile_class.html">DbMpoolFile</a> handle.</p> 39<p>The DbMpoolFile::set_clear_len method may not be called after the <a href="../api_cxx/memp_fopen.html">DbMpoolFile::open</a> method is 40called. 41If the file is already open in the memory pool when 42<a href="../api_cxx/memp_fopen.html">DbMpoolFile::open</a> is called, the information specified to DbMpoolFile::set_clear_len 43must be consistent with the existing file or an error will be 44returned. 45</p> 46<p>The DbMpoolFile::set_clear_len method 47either returns a non-zero error value 48or throws an exception that encapsulates a non-zero error value on 49failure, and returns 0 on success. 50</p> 51<b>Parameters</b> <br> 52 <b>len</b><ul compact><li>The <b>len</b> parameter is the number of initial bytes in a page that 53should be set to nul when the page is created. A value of 0 results in 54the entire page being set to nul bytes.</ul> 55<br> 56<hr size=1 noshade> 57<b>Description: DbMpoolFile::get_clear_len</b> 58<p>The DbMpoolFile::get_clear_len method returns the bytes to be cleared.</p> 59<p>The DbMpoolFile::get_clear_len method may be called at any time during the life of the 60application.</p> 61<p>The DbMpoolFile::get_clear_len method 62either returns a non-zero error value 63or throws an exception that encapsulates a non-zero error value on 64failure, and returns 0 on success. 65</p> 66<b>Parameters</b> <br> 67 <b>lenp</b><ul compact><li>The DbMpoolFile::get_clear_len method returns the 68bytes to be cleared in <b>lenp</b>.</ul> 69<br> 70<hr size=1 noshade> 71<br><b>Class</b> 72<a href="../api_cxx/env_class.html">DbEnv</a>, <a href="../api_cxx/mempfile_class.html">DbMpoolFile</a> 73<br><b>See Also</b> 74<a href="../api_cxx/memp_list.html">Memory Pools and Related Methods</a> 75</tt> 76<table width="100%"><tr><td><br></td><td align=right> 77<a href="../api_cxx/api_core.html"><img src="../images/api.gif" alt="API"></a><a href="../ref/toc.html"><img src="../images/ref.gif" alt="Ref"></a> 78</td></tr></table> 79<p><font size=1>Copyright (c) 1996,2008 Oracle. All rights reserved.</font> 80</body> 81</html> 82