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_set_func_dirlist</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="setfunc.html" title="Appendix 3. Berkeley DB Application Space Static Functions" /> 11 <link rel="prev" href="db_env_set_func_dirfree.html" title="db_env_set_func_dirfree" /> 12 <link rel="next" href="db_env_set_func_exists.html" title="db_env_set_func_exists" /> 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_set_func_dirlist</th> 19 </tr> 20 <tr> 21 <td width="20%" align="left"><a accesskey="p" href="db_env_set_func_dirfree.html">Prev</a> </td> 22 <th width="60%" align="center">Appendix 3. 23 Berkeley DB Application Space Static Functions 24 </th> 25 <td width="20%" align="right"> <a accesskey="n" href="db_env_set_func_exists.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="db_env_set_func_dirlist"></a>db_env_set_func_dirlist</h2> 35 </div> 36 </div> 37 </div> 38 <pre class="programlisting">#include <db.h> 39 40int 41db_env_set_func_dirlist(int (*func_dirlist)(const char *dir, 42 char ***namesp, int *cntp)); </pre> 43 <p> 44 The Berkeley DB library requires the ability to read through a 45 directory and create a list of files that the directory contains. 46 </p> 47 <p> 48 The db_env_set_func_dirlist method configures all operations performed 49 by a process and all of its threads of control, not operations 50 confined to a single database environment. 51 </p> 52 <p> 53 Although the db_env_set_func_dirlist method may be called at any time 54 during the life of the application, it should normally be called 55 before making calls to the <a class="xref" href="envcreate.html" title="db_env_create">db_env_create</a> or 56 <a class="xref" href="dbcreate.html" title="db_create">db_create</a> methods. 57 </p> 58 <p> 59 The <code class="function">db_env_set_func_dirlist()</code> <span> 60 function returns a non-zero error value on failure and 0 on success. 61 </span> 62 </p> 63 <div class="sect2" lang="en" xml:lang="en"> 64 <div class="titlepage"> 65 <div> 66 <div> 67 <h3 class="title"><a id="id1718553"></a>Parameters</h3> 68 </div> 69 </div> 70 </div> 71 <div class="sect3" lang="en" xml:lang="en"> 72 <div class="titlepage"> 73 <div> 74 <div> 75 <h4 class="title"><a id="id1718688"></a>func_dirlist</h4> 76 </div> 77 </div> 78 </div> 79 <p> 80 The <span class="bold"><strong>func_dirlist</strong></span> parameter is the 81 function which reads through a directory and returns a list of the 82 files it contains. 83 </p> 84 <p> 85 The <span class="bold"><strong>dir</strong></span> parameter to this function is 86 the name of the directory to be searched. 87 </p> 88 <p> 89 The function must return a pointer to an array of nul-terminated file 90 names into the memory location to which the <span class="bold"><strong>namesp</strong></span> parameter refers, and a count of the 91 number of elements in the array into the memory location to which 92 <span class="bold"><strong>cntp</strong></span> refers. 93 </p> 94 </div> 95 </div> 96 <div class="sect2" lang="en" xml:lang="en"> 97 <div class="titlepage"> 98 <div> 99 <div> 100 <h3 class="title"><a id="id1718876"></a>See Also</h3> 101 </div> 102 </div> 103 </div> 104 <p> 105 <a href="../../programmer_reference/program_runtime.html" class="olink">Run-time configuration</a> 106 107 </p> 108 </div> 109 </div> 110 <div class="navfooter"> 111 <hr /> 112 <table width="100%" summary="Navigation footer"> 113 <tr> 114 <td width="40%" align="left"><a accesskey="p" href="db_env_set_func_dirfree.html">Prev</a> </td> 115 <td width="20%" align="center"> 116 <a accesskey="u" href="setfunc.html">Up</a> 117 </td> 118 <td width="40%" align="right"> <a accesskey="n" href="db_env_set_func_exists.html">Next</a></td> 119 </tr> 120 <tr> 121 <td width="40%" align="left" valign="top">db_env_set_func_dirfree </td> 122 <td width="20%" align="center"> 123 <a accesskey="h" href="index.html">Home</a> 124 </td> 125 <td width="40%" align="right" valign="top"> db_env_set_func_exists</td> 126 </tr> 127 </table> 128 </div> 129 </body> 130</html> 131