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->repmgr_site_list()</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="rep.html" title="Chapter��10.�� Replication Methods" /> 11 <link rel="prev" href="repmgrlocal_site.html" title="DB_ENV->repmgr_set_local_site()" /> 12 <link rel="next" href="repmgrstart.html" title="DB_ENV->repmgr_start()" /> 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->repmgr_site_list()</th> 19 </tr> 20 <tr> 21 <td width="20%" align="left"><a accesskey="p" href="repmgrlocal_site.html">Prev</a>��</td> 22 <th width="60%" align="center">Chapter��10.�� 23 Replication Methods 24 </th> 25 <td width="20%" align="right">��<a accesskey="n" href="repmgrstart.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="repmgrsite_list"></a>DB_ENV->repmgr_site_list()</h2> 35 </div> 36 </div> 37 </div> 38 <pre class="programlisting">#include <db.h> 39 40int 41DB_ENV->repmgr_site_list(DB_ENV *env, 42 u_int *countp, DB_REPMGR_SITE **listp); 43 </pre> 44 <p> 45 The <code class="methodname">DB_ENV->repmgr_site_list()</code> method returns the status of the 46 sites currently known by the Replication Manager. 47 </p> 48 <p> 49 The <code class="methodname">DB_ENV->repmgr_site_list()</code> method creates a statistical 50 structure of type <code class="literal">DB_REPMGR_SITE</code> and copies a pointer to it into a 51 user-specified memory location. 52 </p> 53 <p> 54 Statistical structures are stored in allocated memory. If application-specific allocation routines have been 55 declared (see <a class="xref" href="envset_alloc.html" title="DB_ENV->set_alloc()">DB_ENV->set_alloc()</a> for more information), 56 they are used to allocate the memory; otherwise, the standard C library 57 <span class="bold"><strong>malloc</strong></span>(3) is used. The caller is responsible for deallocating 58 the memory. To deallocate the memory, free the memory reference; references inside the returned 59 memory need not be individually freed. 60 </p> 61 <p> 62 The following <code class="literal">DB_REPMGR_SITE</code> fields will be filled in: 63 </p> 64 <div class="itemizedlist"> 65 <ul type="disc"> 66 <li> 67 <p> 68 <span class="bold"><strong>int eid;</strong></span> 69 </p> 70 <p> 71 Environment ID assigned by the Replication Manager. This is the same value that is passed to 72 the application's event notification function for the 73 <a class="link" href="envevent_notify.html#event_notify_DB_EVENT_REP_NEWMASTER">DB_EVENT_REP_NEWMASTER</a> 74 event. 75 </p> 76 </li> 77 <li> 78 <p> 79 <span class="bold"><strong>char host[];</strong></span> 80 </p> 81 <p> 82 Null-terminated host name. 83 </p> 84 </li> 85 <li> 86 <p> 87 <span class="bold"><strong>u_int port;</strong></span> 88 </p> 89 <p> 90 TCP/IP port number. 91 </p> 92 </li> 93 <li> 94 <p> 95 <span class="bold"><strong>u_int32_t status;</strong></span> 96 </p> 97 <p> 98 Zero (if unknown), or one of the following 99 constants: <code class="literal">DB_REPMGR_CONNECTED</code>, 100 <code class="literal">DB_REPMGR_DISCONNECTED</code>. 101 </p> 102 </li> 103 </ul> 104 </div> 105 <p> 106 The <code class="methodname">DB_ENV->repmgr_site_list()</code> method may be called at any time 107 during the life of the application. 108 </p> 109 <p> 110 The <code class="methodname">DB_ENV->repmgr_site_list()</code> <span> 111 <span> 112 method returns a non-zero error value on failure and 0 on success. 113 </span> 114 115 </span> 116 </p> 117 <div class="sect2" lang="en" xml:lang="en"> 118 <div class="titlepage"> 119 <div> 120 <div> 121 <h3 class="title"><a id="id1703152"></a>Parameters</h3> 122 </div> 123 </div> 124 </div> 125 <div class="sect3" lang="en" xml:lang="en"> 126 <div class="titlepage"> 127 <div> 128 <div> 129 <h4 class="title"><a id="id1703317"></a>countp</h4> 130 </div> 131 </div> 132 </div> 133 <p> 134 A count of the returned structures will be stored into the memory referenced by 135 <span class="bold"><strong>countp</strong></span>. 136 </p> 137 </div> 138 <div class="sect3" lang="en" xml:lang="en"> 139 <div class="titlepage"> 140 <div> 141 <div> 142 <h4 class="title"><a id="id1703541"></a>listp</h4> 143 </div> 144 </div> 145 </div> 146 <p> 147 A reference to an array of structures will be stored into the memory referenced by 148 <span class="bold"><strong>listp</strong></span>. 149 </p> 150 </div> 151 </div> 152 <div class="sect2" lang="en" xml:lang="en"> 153 <div class="titlepage"> 154 <div> 155 <div> 156 <h3 class="title"><a id="id1702884"></a>Class</h3> 157 </div> 158 </div> 159 </div> 160 <p> 161 <a class="link" href="env.html" title="Chapter��5.�� The DB_ENV Handle">DB_ENV</a> 162 </p> 163 </div> 164 <div class="sect2" lang="en" xml:lang="en"> 165 <div class="titlepage"> 166 <div> 167 <div> 168 <h3 class="title"><a id="id1703333"></a>See Also</h3> 169 </div> 170 </div> 171 </div> 172 <p> 173 <a class="xref" href="rep.html#replist" title="Replication and Related Methods">Replication and Related Methods</a> 174 </p> 175 </div> 176 </div> 177 <div class="navfooter"> 178 <hr /> 179 <table width="100%" summary="Navigation footer"> 180 <tr> 181 <td width="40%" align="left"><a accesskey="p" href="repmgrlocal_site.html">Prev</a>��</td> 182 <td width="20%" align="center"> 183 <a accesskey="u" href="rep.html">Up</a> 184 </td> 185 <td width="40%" align="right">��<a accesskey="n" href="repmgrstart.html">Next</a></td> 186 </tr> 187 <tr> 188 <td width="40%" align="left" valign="top">DB_ENV->repmgr_set_local_site()��</td> 189 <td width="20%" align="center"> 190 <a accesskey="h" href="index.html">Home</a> 191 </td> 192 <td width="40%" align="right" valign="top">��DB_ENV->repmgr_start()</td> 193 </tr> 194 </table> 195 </div> 196 </body> 197</html> 198