[Libvirt-cim] [PATCH] Add DECLARE_INST_LIST() macro

Dan Smith danms at us.ibm.com
Wed Jan 16 14:43:50 UTC 2008


# HG changeset patch
# User Dan Smith <danms at us.ibm.com>
# Date 1200494010 28800
# Node ID ef0dd32ef7faf101f97acfa0f0268bf18c22dcac
# Parent  2948ecbed2674aee61a994b06468c2ce9c763bb3
Add DECLARE_INST_LIST() macro
to allow declarations of pre-initialized inst_list structures

Signed-off-by: Dan Smith <danms at us.ibm.com>

diff -r 2948ecbed267 -r ef0dd32ef7fa libcmpiutil.h
--- a/libcmpiutil.h	Tue Jan 15 12:54:04 2008 +0100
+++ b/libcmpiutil.h	Wed Jan 16 06:33:30 2008 -0800
@@ -366,6 +366,13 @@ void inst_list_free(struct inst_list *li
  * @returns nonzero on success, zero on failure
  */
 int inst_list_add(struct inst_list *list, CMPIInstance *inst);
+
+/**
+ * Define a pre-initialized inst_list
+ *
+ * @param x The variable name for the list.
+ */
+#define DECLARE_INST_LIST(x) struct inst_list x = {NULL, 0, 0};
 
 /**
  * Compare key values in a reference to properties in an instance,




More information about the Libvirt-cim mailing list