confdb_initialize.3 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. .\"/*
  2. .\" * Copyright (c) 2008 Red Hat, Inc.
  3. .\" *
  4. .\" * All rights reserved.
  5. .\" *
  6. .\" * Author: Christine Caulfield <ccaulfie@redhat.com>
  7. .\" *
  8. .\" * This software licensed under BSD license, the text of which follows:
  9. .\" *
  10. .\" * Redistribution and use in source and binary forms, with or without
  11. .\" * modification, are permitted provided that the following conditions are met:
  12. .\" *
  13. .\" * - Redistributions of source code must retain the above copyright notice,
  14. .\" * this list of conditions and the following disclaimer.
  15. .\" * - Redistributions in binary form must reproduce the above copyright notice,
  16. .\" * this list of conditions and the following disclaimer in the documentation
  17. .\" * and/or other materials provided with the distribution.
  18. .\" * - Neither the name of the MontaVista Software, Inc. nor the names of its
  19. .\" * contributors may be used to endorse or promote products derived from this
  20. .\" * software without specific prior written permission.
  21. .\" *
  22. .\" * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  23. .\" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  24. .\" * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  25. .\" * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
  26. .\" * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  27. .\" * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  28. .\" * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  29. .\" * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  30. .\" * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  31. .\" * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
  32. .\" * THE POSSIBILITY OF SUCH DAMAGE.
  33. .\" */
  34. .TH CONFDB_INITIALIZE 3 2004-08-31 "corosync Man Page" "Corosync Cluster Engine Programmer's Manual"
  35. .SH NAME
  36. confdb_initialize \- Create a new connection to the ConfDb service
  37. .SH SYNOPSIS
  38. .B #include <corosync/confdb.h>
  39. .sp
  40. .BI "int confdb_initialize(confdb_handle_t *" handle ", confdb_callbacks_t *" callbacks ");
  41. .SH DESCRIPTION
  42. The
  43. .B confdb_initialize
  44. function is used to initialize a connection to the configuration database API.
  45. .PP
  46. Each application may have several connections to the CONFDB API. Each application
  47. uses the
  48. .I handle
  49. argument to uniquely identify the connection. The
  50. .I handle
  51. argument is then used in other function calls to identify the connection to be used
  52. for communication with the CONFDB service.
  53. .PP
  54. Every time the configuration database is updated, the callback is called.
  55. The callback function is described by the following type definitions:
  56. .PP
  57. .PP
  58. .IP
  59. .RS
  60. .ne 18
  61. .nf
  62. .ta 4n 20n 32n
  63. typedef void (*confdb_change_notify_fn_t) (
  64. confdb_handle_t handle,
  65. unsigned int parent_object_handle,
  66. unsigned int object_handle,
  67. void *object_name,
  68. int object_name_len,
  69. void *key_name,
  70. int key_name_len,
  71. void *key_value,
  72. int key_value_len);
  73. .ta
  74. .fi
  75. .RE
  76. .IP
  77. .PP
  78. .PP
  79. The
  80. .I callbacks
  81. argument is of the type:
  82. .IP
  83. .RS
  84. .ne 18
  85. .nf
  86. .PP
  87. typedef struct {
  88. confdb_change_notify_fn_t confdb_change_notify_fn;
  89. } confdb_callbacks_t;
  90. .ta
  91. .fi
  92. .RE
  93. .IP
  94. .PP
  95. When a configuration change occurs, the callback
  96. is called from the
  97. .B confdb_dispatch()
  98. function.
  99. .PP
  100. .SH RETURN VALUE
  101. This call returns the CONFDB_OK value if successful, otherwise an error is returned.
  102. .PP
  103. .SH BUGS
  104. Callbacks are not support at the moment.
  105. .PP
  106. .SH ERRORS
  107. The errors are undocumented.
  108. .SH "SEE ALSO"
  109. .BR confdb_overview (8),
  110. .BR confdb_finalize (3),
  111. .BR confdb_fd_get (3),
  112. .BR confdb_dispatch (3),
  113. .PP