1<!--$Id: repmgr_site_list.so,v 1.7 2006/09/11 16:57:54 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: DB_ENV-&gt;repmgr_site_list</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>DB_ENV-&gt;repmgr_site_list</b>
14</td>
15<td align=right>
16<a href="../api_c/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 &lt;db.h&gt;
23<p>
24int
25DB_ENV-&gt;repmgr_site_list(DB_ENV *env,
26    u_int *countp, DB_REPMGR_SITE **listp);
27</pre></b>
28<hr size=1 noshade>
29<b>Description: DB_ENV-&gt;repmgr_site_list</b>
30<p>The DB_ENV-&gt;repmgr_site_list method returns the status of the sites currently
31known by the replication manager.</p>
32<p>The DB_ENV-&gt;repmgr_site_list method creates a statistical structure of type
33DB_REPMGR_SITE and copies a pointer to it into a user-specified memory
34location.</p>
35<p>Statistical structures are stored in allocated memory.  If application-specific allocation
36routines have been declared (see <a href="../api_c/env_set_alloc.html">DB_ENV-&gt;set_alloc</a> for more
37information), they are used to allocate the memory; otherwise, the
38standard C library <b>malloc</b>(3) is used.  The caller is
39responsible for deallocating the memory.  To deallocate the memory, free
40the memory reference; references inside the returned memory need not be
41individually freed.</p>
42<p>The following DB_REPMGR_SITE fields will be filled in:</p>
43<br>
44<b>int eid;</b><ul compact><li>Environment ID assigned by the replication manager.
45This is the same value that is passed to the application's
46event notification function for the <a href="../api_c/env_event_notify.html#DB_EVENT_REP_NEWMASTER">DB_EVENT_REP_NEWMASTER</a> event.</ul>
47<b>char host[];</b><ul compact><li>Nul-terminated host name.</ul>
48<b>u_int port;</b><ul compact><li>TCP/IP port number.</ul>
49<b>u_int32_t status;</b><ul compact><li>One of the following list of constants: <a name="DB_REPMGR_CONNECTED">DB_REPMGR_CONNECTED</a>,
50<a name="DB_REPMGR_DISCONNECTED">DB_REPMGR_DISCONNECTED</a>.</ul>
51<br>
52<p>The DB_ENV-&gt;repmgr_site_list method may be called at any time during the life of the
53application.</p>
54<p>The DB_ENV-&gt;repmgr_site_list method
55returns a non-zero error value on failure
56and 0 on success.
57</p>
58<b>Parameters</b> <br>
59 <b>countp</b><ul compact><li>A count of the returned structures will be stored into the memory
60referenced by <b>countp</b>.</ul>
61 <b>listp</b><ul compact><li>A reference to an array of structures will be stored into the memory
62referenced by <b>listp</b>.</ul>
63<br>
64<hr size=1 noshade>
65<br><b>Class</b>
66<a href="../api_c/env_class.html">DB_ENV</a>
67<br><b>See Also</b>
68<a href="../api_c/rep_list.html">Replication and Related Methods</a>
69</tt>
70<table width="100%"><tr><td><br></td><td align=right>
71<a href="../api_c/api_core.html"><img src="../images/api.gif" alt="API"></a><a href="../ref/toc.html"><img src="../images/ref.gif" alt="Ref"></a>
72</td></tr></table>
73<p><font size=1>Copyright (c) 1996,2008 Oracle.  All rights reserved.</font>
74</body>
75</html>
76