4
0

cpg_iteration_initialize.3.in 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. .\"/*
  2. .\" * Copyright (c) 2012 Red Hat, Inc.
  3. .\" *
  4. .\" * All rights reserved.
  5. .\" *
  6. .\" * Author: Jan Friesse (jfriesse@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 Red Hat, 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 "CPG_ITERATION_INITIALIZE" 3 "05/03/2012" "corosync Man Page" "Corosync Cluster Engine Programmer's Manual"
  35. .SH NAME
  36. .P
  37. cpg_iteration_initialize \- Initialize iterator for members of CPG
  38. .SH SYNOPSIS
  39. .P
  40. \fB#include <corosync/cpg.h>\fR
  41. .P
  42. \fBcs_error_t
  43. cpg_iteration_initialize (cpg_handle_t \fIhandle\fB, cpg_iteration_type_t \fIiteration_type\fB,
  44. const struct cpg_name *\fIgroup\fB, cpg_iteration_handle_t *\fIcpg_iteration_handle\fB);\fR
  45. .SH DESCRIPTION
  46. .P
  47. The
  48. .B cpg_iteration_initialize
  49. function is used to initialize iteration of CPG members.
  50. The
  51. .I handle
  52. argument is connection to CPG database obtained by calling
  53. .B cpg_initialize(3)
  54. function.
  55. .I iteration_type
  56. is used for limit number of returned items and can be one of:
  57. .PP
  58. \fBCPG_ITERATION_NAME_ONLY\fR - only name of used groups are returned
  59. .PP
  60. \fBCPG_ITERATION_ONE_GROUP\fR - only members group with name \fIgroup\fR are returned
  61. .PP
  62. \fBCPG_ITERATION_ALL\fR - all members are returned
  63. The
  64. .I group
  65. parameter is used only with \fBCPG_ITERATION_ONE_GROUP\fR and it's name of group with
  66. members to iterate. For other \fIiteration_type\fR, this parameter must be NULL.
  67. .B cpg_iteration_initialize
  68. is used only for initialize context for future
  69. .B cpg_iteration_next(3)
  70. calls and handle needed for that function is returned in
  71. .I cpg_iteration_handle
  72. variable. When you have finished iteration over objects, call
  73. .B cpg_iteration_finalize(3)
  74. function to free up memory associated with iteration.
  75. .SH RETURN VALUE
  76. This call returns the CS_OK value if successful. If \fIcpg_iteration_handle\fR is NULL,
  77. \fBCS_ERR_INVALID_PARAM\fR error is returned. Same error is returned when \fIiteration_type\fR
  78. is \fBCPG_ITERATION_ONE_GROUP\fR, but \fIgroup\fR is NULL, or when \fIgroup\fR is not NULL and
  79. \fIiteration_type\fR is not \fBCPG_ITERATION_ONE_GROUP\fR. If there is not enough memory
  80. for internal store of data, \fBCS_ERR_NO_MEMORY\fR is returned. \fBCS_ERR_BAD_HANDLE\fR can
  81. be returned, if \fIhandle\fR is not valid handle.
  82. .SH COMMON IPC ERRORS
  83. @COMMONIPCERRORS@
  84. .SH "SEE ALSO"
  85. .BR cpg_iteration_next (3),
  86. .BR cpg_iteration_finalize (3),
  87. .BR cpg_initialize (3),
  88. .BR cpg_overview (3)