[PATCH] Add STD_InstanceMIStub to avoid warnings during compile time

# HG changeset patch # User Heidi Eckhart <heidieck@linux.vnet.ibm.com> # Date 1195471122 -3600 # Node ID 4a0c7a2052a8da4062177a29d5bd02c6b5a551d1 # Parent 18403e085eaab25596f65d3273ad56befeb46463 Add STD_InstanceMIStub to avoid warnings during compile time Signed-off-by: Heidi Eckhart <heidieck@linux.vnet.ibm.com> diff -r 18403e085eaa -r 4a0c7a2052a8 libcmpiutil.h --- a/libcmpiutil.h Fri Nov 16 08:49:15 2007 -0800 +++ b/libcmpiutil.h Mon Nov 19 12:18:42 2007 +0100 @@ -464,6 +464,52 @@ const char *cu_compare_ref(const CMPIObj const CMPIContext *ctx) \ { return; } +/** + * 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 /*

HE> # HG changeset patch HE> # User Heidi Eckhart <heidieck@linux.vnet.ibm.com> HE> # Date 1195471122 -3600 HE> # Node ID 4a0c7a2052a8da4062177a29d5bd02c6b5a551d1 HE> # Parent 18403e085eaab25596f65d3273ad56befeb46463 HE> Add STD_InstanceMIStub to avoid warnings during compile time HE> Signed-off-by: Heidi Eckhart <heidieck@linux.vnet.ibm.com> HE> libcmpiutil.h | 46 ++++++++++++++++++++++++++++++++++++++++++++++ HE> 1 file changed, 46 insertions(+) Actually, can we put this in a std_instance.h like the rest of them? I'll include this change in front of my updated patch set for comments. -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms@us.ibm.com

Dan Smith wrote:
HE> # HG changeset patch HE> # User Heidi Eckhart <heidieck@linux.vnet.ibm.com> HE> # Date 1195471122 -3600 HE> # Node ID 4a0c7a2052a8da4062177a29d5bd02c6b5a551d1 HE> # Parent 18403e085eaab25596f65d3273ad56befeb46463 HE> Add STD_InstanceMIStub to avoid warnings during compile time HE> Signed-off-by: Heidi Eckhart <heidieck@linux.vnet.ibm.com>
HE> libcmpiutil.h | 46 ++++++++++++++++++++++++++++++++++++++++++++++ HE> 1 file changed, 46 insertions(+)
Actually, can we put this in a std_instance.h like the rest of them? I'll include this change in front of my updated patch set for comments. Sure, much better than adding this to libcmpiutil.h :) !
-- Regards Heidi Eckhart Software Engineer Linux Technology Center - Open Hypervisor heidieck@linux.vnet.ibm.com ************************************************** IBM Deutschland Entwicklung GmbH Vorsitzender des Aufsichtsrats: Martin Jetter Geschaeftsfuehrung: Herbert Kircher Sitz der Gesellschaft: Boeblingen Registergericht: Amtsgericht Stuttgart, HRB 243294
participants (2)
-
Dan Smith
-
Heidi Eckhart