# HG changeset patch
# User Dan Smith <danms(a)us.ibm.com>
# Date 1195488042 28800
# Node ID 25497386647b6e757ed5c8893f2a4c648543829b
# Parent 18403e085eaab25596f65d3273ad56befeb46463
Add std_instance.h with updated MIStub macro
Signed-off-by: Heidi Eckhart <heidieck(a)linux.vnet.ibm.com>
Signed-off-by: Dan Smith <danms(a)us.ibm.com>
diff -r 18403e085eaa -r 25497386647b Makefile.am
--- a/Makefile.am Fri Nov 16 08:49:15 2007 -0800
+++ b/Makefile.am Mon Nov 19 08:00:42 2007 -0800
@@ -13,7 +13,8 @@ libcmpiutilinc_HEADERS = libcmpiutil.h \
libcmpiutilinc_HEADERS = libcmpiutil.h \
std_invokemethod.h \
std_association.h \
- std_indication.h
+ std_indication.h \
+ std_instance.h
libcmpiutil_la_SOURCES = args_util.c instance_util.c std_invokemethod.c \
std_association.c inst_list.c std_indication.c \
diff -r 18403e085eaa -r 25497386647b std_instance.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/std_instance.h Mon Nov 19 08:00:42 2007 -0800
@@ -0,0 +1,72 @@
+/*
+ * Copyright IBM Corp. 2007
+ *
+ * Authors:
+ * Heidi Eckhart <heidieck(a)linux.vnet.ibm.com>
+ * Dan Smith <danms(a)us.ibm.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef __STD_INSTANCE_H
+#define __STD_INSTANCE_H
+
+/**
+ * Generates the function table and initialization stub for an
+ * instance provider.
+ * @param pfx The prefix for all mandatory association provider
+ * functions.
+ * @param pn The provider name under which this provider is
+ * registered.
+ * @param broker The CMPIBroker pointer.
+ * @param hook Perform additional initialization functions.
+ * @return The function table of this instance provider.
+ */
+#define STD_InstanceMIStub(pfx, pn, broker, hook) \
+ static CMPIInstanceMIFT instMIFT__={ \
+ CMPICurrentVersion, \
+ CMPICurrentVersion, \
+ "instance" #pn, \
+ pfx##Cleanup, \
+ pfx##EnumInstanceNames, \
+ pfx##EnumInstances, \
+ pfx##GetInstance, \
+ pfx##CreateInstance, \
+ pfx##ModifyInstance, \
+ pfx##DeleteInstance, \
+ pfx##ExecQuery, \
+ }; \
+ \
+ CMPIInstanceMI * \
+ pn##_Create_InstanceMI(const CMPIBroker *, \
+ const CMPIContext *, \
+ CMPIStatus *rc); \
+ \
+ \
+ CMPI_EXTERN_C \
+ CMPIInstanceMI* pn##_Create_InstanceMI(const CMPIBroker* brkr, \
+ const CMPIContext *ctx, \
+ CMPIStatus *rc) \
+ { \
+ static CMPIInstanceMI mi={ \
+ NULL, \
+ &instMIFT__, \
+ }; \
+ broker=brkr; \
+ hook; \
+ return &mi; \
+ }
+
+ #endif