File 0005-fix-argument-constness.patch of Package sblim-cmpi-smbios
From b9f498c3ac392ee8bca6db2cfb97e3f4fbfda10b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Klaus=20K=C3=A4mpf?= <kkaempf@gmail.com>
Date: Fri, 21 Feb 2025 19:11:53 +0100
Subject: [PATCH 5/5] fix argument constness
---
cmpiLinux_BIOSElement.c | 124 ++++++-------
cmpiLinux_BIOSFeature.c | 114 ++++++------
cmpiLinux_BIOSFeatureBIOSElements.c | 258 ++++++++++++++--------------
cmpiLinux_BIOSProduct.c | 118 +++++++------
cmpiLinux_BIOSProductBIOSFeatures.c | 258 ++++++++++++++--------------
5 files changed, 446 insertions(+), 426 deletions(-)
diff --git a/cmpiLinux_BIOSElement.c b/cmpiLinux_BIOSElement.c
index 503537e..e32af79 100644
--- a/cmpiLinux_BIOSElement.c
+++ b/cmpiLinux_BIOSElement.c
@@ -3,20 +3,20 @@
*
* (C) Copyright IBM Corp. 2003
*
- * THIS FILE IS PROVIDED UNDER THE TERMS OF THE COMMON PUBLIC LICENSE
- * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
+ * THIS FILE IS PROVIDED UNDER THE TERMS OF THE COMMON PUBLIC LICENSE
+ * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
* CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
*
* You can obtain a current copy of the Common Public License from
* http://oss.software.ibm.com/developerworks/opensource/license-cpl.html
*
- * Author: Viktor Mihajlovski <mihajlov@de.ibm.com>
+ * Author: Viktor Mihajlovski <mihajlov@de.ibm.com>
* Contributors: James Jeffers <jamesjef@us.ibm.com>
*
* Interface Type : Common Manageability Programming Interface ( CMPI )
*
* Description: BIOS Element. Contains BIOS Information.
- *
+ *
*/
#include <stdlib.h>
@@ -44,28 +44,28 @@ CMPIBroker * _broker;
static char * _ClassName = "Linux_BIOSElement";
-static CMPIObjectPath *makeObjectPath(DMI_BIOSELEMENT *be,CMPIObjectPath *op);
-static CMPIInstance *makeInstance(DMI_BIOSELEMENT *be,CMPIObjectPath *op);
+static CMPIObjectPath *makeObjectPath(DMI_BIOSELEMENT *be, const CMPIObjectPath *op);
+static CMPIInstance *makeInstance(DMI_BIOSELEMENT *be, const CMPIObjectPath *op);
/* ---------------------------------------------------------------------------*/
/* Instance Provider Interface */
/* ---------------------------------------------------------------------------*/
-CMPIStatus Linux_BIOSElementCleanup( CMPIInstanceMI * mi,
- CMPIContext * ctx) {
+CMPIStatus Linux_BIOSElementCleanup( CMPIInstanceMI * mi,
+ const CMPIContext * ctx, CMPIBoolean terminating) {
cimdmi_term();
CMReturn(CMPI_RC_OK);
}
-CMPIStatus Linux_BIOSElementEnumInstanceNames( CMPIInstanceMI * mi,
- CMPIContext * ctx,
- CMPIResult * rslt,
- CMPIObjectPath * ref) {
+CMPIStatus Linux_BIOSElementEnumInstanceNames( CMPIInstanceMI * mi,
+ const CMPIContext * ctx,
+ const CMPIResult * rslt,
+ const CMPIObjectPath * ref) {
CMPIObjectPath *op;
DMI_BIOSELEMENT *bioselem;
CMPIStatus rc = {CMPI_RC_OK, NULL};
-
+
if( _debug )
fprintf( stderr, "--- %s.c : CMPI EnumInstanceNames()\n", _ClassName );
@@ -88,11 +88,11 @@ CMPIStatus Linux_BIOSElementEnumInstanceNames( CMPIInstanceMI * mi,
return rc;
}
-CMPIStatus Linux_BIOSElementEnumInstances( CMPIInstanceMI * mi,
- CMPIContext * ctx,
- CMPIResult * rslt,
- CMPIObjectPath * ref,
- char ** properties) {
+CMPIStatus Linux_BIOSElementEnumInstances( CMPIInstanceMI * mi,
+ const CMPIContext * ctx,
+ const CMPIResult * rslt,
+ const CMPIObjectPath * ref,
+ const char ** properties) {
CMPIStatus rc = {CMPI_RC_OK, NULL};
CMPIInstance *inst;
DMI_BIOSELEMENT *bioselem;
@@ -125,11 +125,11 @@ CMPIStatus Linux_BIOSElementEnumInstances( CMPIInstanceMI * mi,
return rc;
}
-CMPIStatus Linux_BIOSElementGetInstance( CMPIInstanceMI * mi,
- CMPIContext * ctx,
- CMPIResult * rslt,
- CMPIObjectPath * cop,
- char ** properties) {
+CMPIStatus Linux_BIOSElementGetInstance( CMPIInstanceMI * mi,
+ const CMPIContext * ctx,
+ const CMPIResult * rslt,
+ const CMPIObjectPath * cop,
+ const char ** properties) {
CMPIInstance *inst;
DMI_BIOSELEMENT *bioselem;
CMPIStatus rc = {CMPI_RC_OK, NULL};
@@ -162,56 +162,60 @@ CMPIStatus Linux_BIOSElementGetInstance( CMPIInstanceMI * mi,
return rc;
}
-CMPIStatus Linux_BIOSElementCreateInstance( CMPIInstanceMI * mi,
- CMPIContext * ctx,
- CMPIResult * rslt,
- CMPIObjectPath * cop,
- CMPIInstance * ci) {
+CMPIStatus Linux_BIOSElementCreateInstance( CMPIInstanceMI * mi,
+ const CMPIContext * ctx,
+ const CMPIResult * rslt,
+ const CMPIObjectPath * cop,
+ const CMPIInstance * ci) {
CMPIStatus rc = {CMPI_RC_OK, NULL};
if( _debug )
- fprintf( stderr, "--- %s.c : CMPI CreateInstance()\n", _ClassName );
- CMSetStatusWithChars( _broker, &rc,
- CMPI_RC_ERR_NOT_SUPPORTED, "NOT_SUPPORTED" );
+ fprintf( stderr, "--- %s.c : CMPI CreateInstance()\n", _ClassName );
+ CMSetStatusWithChars( _broker, &rc,
+ CMPI_RC_ERR_NOT_SUPPORTED, "NOT_SUPPORTED" );
return rc;
}
-CMPIStatus Linux_BIOSElementSetInstance( CMPIInstanceMI * mi,
- CMPIContext * ctx,
- CMPIResult * rslt,
- CMPIObjectPath * cop,
- CMPIInstance * ci,
- char **properties) {
+#if defined(CMPI_VER_100)
+CMPIStatus Linux_BIOSElementModifyInstance( CMPIInstanceMI * mi,
+#else
+CMPIStatus Linux_BIOSElementSetInstance( CMPIInstanceMI * mi,
+#endif
+ const CMPIContext * ctx,
+ const CMPIResult * rslt,
+ const CMPIObjectPath * cop,
+ const CMPIInstance * ci,
+ const char **properties) {
CMPIStatus rc = {CMPI_RC_OK, NULL};
if( _debug )
- fprintf( stderr, "--- %s.c : CMPI SetInstance()\n", _ClassName );
- CMSetStatusWithChars( _broker, &rc,
- CMPI_RC_ERR_NOT_SUPPORTED, "NOT_SUPPORTED" );
+ fprintf( stderr, "--- %s.c : CMPI SetInstance()\n", _ClassName );
+ CMSetStatusWithChars( _broker, &rc,
+ CMPI_RC_ERR_NOT_SUPPORTED, "NOT_SUPPORTED" );
return rc;
}
-CMPIStatus Linux_BIOSElementDeleteInstance( CMPIInstanceMI * mi,
- CMPIContext * ctx,
- CMPIResult * rslt,
- CMPIObjectPath * cop) {
- CMPIStatus rc = {CMPI_RC_OK, NULL};
+CMPIStatus Linux_BIOSElementDeleteInstance( CMPIInstanceMI * mi,
+ const CMPIContext * ctx,
+ const CMPIResult * rslt,
+ const CMPIObjectPath * cop) {
+ CMPIStatus rc = {CMPI_RC_OK, NULL};
if( _debug )
- fprintf( stderr, "--- %s.c : CMPI DeleteInstance()\n", _ClassName );
- CMSetStatusWithChars( _broker, &rc,
- CMPI_RC_ERR_NOT_SUPPORTED, "NOT_SUPPORTED" );
+ fprintf( stderr, "--- %s.c : CMPI DeleteInstance()\n", _ClassName );
+ CMSetStatusWithChars( _broker, &rc,
+ CMPI_RC_ERR_NOT_SUPPORTED, "NOT_SUPPORTED" );
return rc;
}
-CMPIStatus Linux_BIOSElementExecQuery( CMPIInstanceMI * mi,
- CMPIContext * ctx,
- CMPIResult * rslt,
- CMPIObjectPath * ref,
- char * lang,
- char * query) {
+CMPIStatus Linux_BIOSElementExecQuery( CMPIInstanceMI * mi,
+ const CMPIContext * ctx,
+ const CMPIResult * rslt,
+ const CMPIObjectPath * ref,
+ const char * lang,
+ const char * query) {
CMPIStatus rc = {CMPI_RC_OK, NULL};
if( _debug )
- fprintf( stderr, "--- %s.c : CMPI ExecQuery()\n", _ClassName );
- CMSetStatusWithChars( _broker, &rc,
- CMPI_RC_ERR_NOT_SUPPORTED, "NOT_SUPPORTED" );
+ fprintf( stderr, "--- %s.c : CMPI ExecQuery()\n", _ClassName );
+ CMSetStatusWithChars( _broker, &rc,
+ CMPI_RC_ERR_NOT_SUPPORTED, "NOT_SUPPORTED" );
return rc;
}
@@ -220,7 +224,7 @@ CMPIStatus Linux_BIOSElementExecQuery( CMPIInstanceMI * mi,
/* ---------------------------------------------------------------------------*/
/* private methods */
/* ---------------------------------------------------------------------------*/
-static CMPIObjectPath *makeObjectPath(DMI_BIOSELEMENT *be,CMPIObjectPath *op)
+static CMPIObjectPath *makeObjectPath(DMI_BIOSELEMENT *be, const CMPIObjectPath *op)
{
CMPIObjectPath * iop=NULL;
@@ -241,7 +245,7 @@ static CMPIObjectPath *makeObjectPath(DMI_BIOSELEMENT *be,CMPIObjectPath *op)
return iop;
}
-static CMPIInstance *makeInstance(DMI_BIOSELEMENT *be,CMPIObjectPath *op)
+static CMPIInstance *makeInstance(DMI_BIOSELEMENT *be, const CMPIObjectPath *op)
{
CMPIObjectPath * iop=NULL;
CMPIInstance * inst=NULL;
@@ -266,7 +270,7 @@ static CMPIInstance *makeInstance(DMI_BIOSELEMENT *be,CMPIObjectPath *op)
CMSetProperty(inst,"SoftwareElementState",
&be->dmi_SWEState,CMPI_uint16);
CMSetProperty(inst,"TargetOperatingSystem",
- &be->dmi_TargetOS,CMPI_uint16);
+ &be->dmi_TargetOS,CMPI_uint16);
CMSetProperty(inst,"Manufacturer",
be->dmi_Manufacturer,CMPI_chars);
CMSetProperty(inst,"PrimaryBIOS",
diff --git a/cmpiLinux_BIOSFeature.c b/cmpiLinux_BIOSFeature.c
index 328e750..08f5571 100644
--- a/cmpiLinux_BIOSFeature.c
+++ b/cmpiLinux_BIOSFeature.c
@@ -3,8 +3,8 @@
*
* (C) Copyright IBM Corp. 2003
*
- * THIS FILE IS PROVIDED UNDER THE TERMS OF THE COMMON PUBLIC LICENSE
- * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
+ * THIS FILE IS PROVIDED UNDER THE TERMS OF THE COMMON PUBLIC LICENSE
+ * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
* CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
*
* You can obtain a current copy of the Common Public License from
@@ -16,7 +16,7 @@
* Interface Type : Common Manageability Programming Interface ( CMPI )
*
* Description: BIOS Feature.
- *
+ *
*/
#include <stdlib.h>
@@ -52,20 +52,20 @@ static CMPIInstance *makeInstance(DMI_BIOSFEATURE *bf,CMPIObjectPath *op);
/* ---------------------------------------------------------------------------*/
-CMPIStatus Linux_BIOSFeatureCleanup( CMPIInstanceMI * mi,
- CMPIContext * ctx) {
+CMPIStatus Linux_BIOSFeatureCleanup( CMPIInstanceMI * mi,
+ const CMPIContext * ctx, CMPIBoolean terminating) {
cimdmi_term();
CMReturn(CMPI_RC_OK);
}
-CMPIStatus Linux_BIOSFeatureEnumInstanceNames( CMPIInstanceMI * mi,
- CMPIContext * ctx,
- CMPIResult * rslt,
- CMPIObjectPath * ref) {
+CMPIStatus Linux_BIOSFeatureEnumInstanceNames( CMPIInstanceMI * mi,
+ const CMPIContext * ctx,
+ const CMPIResult * rslt,
+ const CMPIObjectPath * ref) {
CMPIStatus rc = {CMPI_RC_OK, NULL};
CMPIObjectPath *op;
DMI_BIOSFEATURE *biosfeat;
-
+
if( _debug )
fprintf( stderr, "--- %s.c : CMPI EnumInstanceNames()\n", _ClassName );
@@ -88,11 +88,11 @@ CMPIStatus Linux_BIOSFeatureEnumInstanceNames( CMPIInstanceMI * mi,
return rc;
}
-CMPIStatus Linux_BIOSFeatureEnumInstances( CMPIInstanceMI * mi,
- CMPIContext * ctx,
- CMPIResult * rslt,
- CMPIObjectPath * ref,
- char ** properties) {
+CMPIStatus Linux_BIOSFeatureEnumInstances( CMPIInstanceMI * mi,
+ const CMPIContext * ctx,
+ const CMPIResult * rslt,
+ const CMPIObjectPath * ref,
+ const char ** properties) {
CMPIStatus rc = {CMPI_RC_OK, NULL};
CMPIInstance *inst;
DMI_BIOSFEATURE *biosfeat;
@@ -125,11 +125,11 @@ CMPIStatus Linux_BIOSFeatureEnumInstances( CMPIInstanceMI * mi,
return rc;
}
-CMPIStatus Linux_BIOSFeatureGetInstance( CMPIInstanceMI * mi,
- CMPIContext * ctx,
- CMPIResult * rslt,
- CMPIObjectPath * cop,
- char ** properties) {
+CMPIStatus Linux_BIOSFeatureGetInstance( CMPIInstanceMI * mi,
+ const CMPIContext * ctx,
+ const CMPIResult * rslt,
+ const CMPIObjectPath * cop,
+ const char ** properties) {
CMPIStatus rc = {CMPI_RC_OK, NULL};
CMPIInstance *inst;
DMI_BIOSFEATURE *biosfeat;
@@ -156,56 +156,60 @@ CMPIStatus Linux_BIOSFeatureGetInstance( CMPIInstanceMI * mi,
return rc;
}
-CMPIStatus Linux_BIOSFeatureCreateInstance( CMPIInstanceMI * mi,
- CMPIContext * ctx,
- CMPIResult * rslt,
- CMPIObjectPath * cop,
- CMPIInstance * ci) {
+CMPIStatus Linux_BIOSFeatureCreateInstance( CMPIInstanceMI * mi,
+ const CMPIContext * ctx,
+ const CMPIResult * rslt,
+ const CMPIObjectPath * cop,
+ const CMPIInstance * ci) {
CMPIStatus rc = {CMPI_RC_OK, NULL};
if( _debug )
- fprintf( stderr, "--- %s.c : CMPI CreateInstance()\n", _ClassName );
- CMSetStatusWithChars( _broker, &rc,
- CMPI_RC_ERR_NOT_SUPPORTED, "NOT_SUPPORTED" );
+ fprintf( stderr, "--- %s.c : CMPI CreateInstance()\n", _ClassName );
+ CMSetStatusWithChars( _broker, &rc,
+ CMPI_RC_ERR_NOT_SUPPORTED, "NOT_SUPPORTED" );
return rc;
}
-CMPIStatus Linux_BIOSFeatureSetInstance( CMPIInstanceMI * mi,
- CMPIContext * ctx,
- CMPIResult * rslt,
- CMPIObjectPath * cop,
- CMPIInstance * ci,
- char **properties) {
+#if defined(CMPI_VER_100)
+CMPIStatus Linux_BIOSFeatureModifyInstance( CMPIInstanceMI * mi,
+#else
+CMPIStatus Linux_BIOSFeatureSetInstance( CMPIInstanceMI * mi,
+#endif
+ const CMPIContext * ctx,
+ const CMPIResult * rslt,
+ const CMPIObjectPath * cop,
+ const CMPIInstance * ci,
+ const char **properties) {
CMPIStatus rc = {CMPI_RC_OK, NULL};
if( _debug )
- fprintf( stderr, "--- %s.c : CMPI SetInstance()\n", _ClassName );
- CMSetStatusWithChars( _broker, &rc,
- CMPI_RC_ERR_NOT_SUPPORTED, "NOT_SUPPORTED" );
+ fprintf( stderr, "--- %s.c : CMPI SetInstance()\n", _ClassName );
+ CMSetStatusWithChars( _broker, &rc,
+ CMPI_RC_ERR_NOT_SUPPORTED, "NOT_SUPPORTED" );
return rc;
}
-CMPIStatus Linux_BIOSFeatureDeleteInstance( CMPIInstanceMI * mi,
- CMPIContext * ctx,
- CMPIResult * rslt,
- CMPIObjectPath * cop) {
- CMPIStatus rc = {CMPI_RC_OK, NULL};
+CMPIStatus Linux_BIOSFeatureDeleteInstance( CMPIInstanceMI * mi,
+ const CMPIContext * ctx,
+ const CMPIResult * rslt,
+ const CMPIObjectPath * cop) {
+ CMPIStatus rc = {CMPI_RC_OK, NULL};
if( _debug )
- fprintf( stderr, "--- %s.c : CMPI DeleteInstance()\n", _ClassName );
- CMSetStatusWithChars( _broker, &rc,
- CMPI_RC_ERR_NOT_SUPPORTED, "NOT_SUPPORTED" );
+ fprintf( stderr, "--- %s.c : CMPI DeleteInstance()\n", _ClassName );
+ CMSetStatusWithChars( _broker, &rc,
+ CMPI_RC_ERR_NOT_SUPPORTED, "NOT_SUPPORTED" );
return rc;
}
-CMPIStatus Linux_BIOSFeatureExecQuery( CMPIInstanceMI * mi,
- CMPIContext * ctx,
- CMPIResult * rslt,
- CMPIObjectPath * ref,
- char * lang,
- char * query) {
+CMPIStatus Linux_BIOSFeatureExecQuery( CMPIInstanceMI * mi,
+ const CMPIContext * ctx,
+ const CMPIResult * rslt,
+ const CMPIObjectPath * ref,
+ const char * lang,
+ const char * query) {
CMPIStatus rc = {CMPI_RC_OK, NULL};
if( _debug )
- fprintf( stderr, "--- %s.c : CMPI ExecQuery()\n", _ClassName );
- CMSetStatusWithChars( _broker, &rc,
- CMPI_RC_ERR_NOT_SUPPORTED, "NOT_SUPPORTED" );
+ fprintf( stderr, "--- %s.c : CMPI ExecQuery()\n", _ClassName );
+ CMSetStatusWithChars( _broker, &rc,
+ CMPI_RC_ERR_NOT_SUPPORTED, "NOT_SUPPORTED" );
return rc;
}
@@ -257,7 +261,7 @@ static CMPIInstance *makeInstance(DMI_BIOSFEATURE *bf,CMPIObjectPath *op)
bf->dmi_Vendor,CMPI_chars);
CMSetProperty(inst,"OperationalStatus",
&status,CMPI_uint16);
-
+
}
return inst;
}
diff --git a/cmpiLinux_BIOSFeatureBIOSElements.c b/cmpiLinux_BIOSFeatureBIOSElements.c
index eb089be..d938306 100644
--- a/cmpiLinux_BIOSFeatureBIOSElements.c
+++ b/cmpiLinux_BIOSFeatureBIOSElements.c
@@ -3,8 +3,8 @@
*
* (C) Copyright IBM Corp. 2003
*
- * THIS FILE IS PROVIDED UNDER THE TERMS OF THE COMMON PUBLIC LICENSE
- * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
+ * THIS FILE IS PROVIDED UNDER THE TERMS OF THE COMMON PUBLIC LICENSE
+ * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
* CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
*
* You can obtain a current copy of the Common Public License from
@@ -16,7 +16,7 @@
* Interface Type : Common Manageability Programming Interface ( CMPI )
*
* Description: Association between BIOS Feature and Element.
- *
+ *
*/
#include <stdlib.h>
@@ -31,7 +31,7 @@
unsigned char CMPI_true=1;
unsigned char CMPI_false=0;
-CMPIBroker * _broker;
+const CMPIBroker * _broker;
/* ---------------------------------------------------------------------------*/
/* private declarations */
@@ -60,20 +60,20 @@ static CMPIInstance *makeInstance(CMPIObjectPath *opLeft,
/* ---------------------------------------------------------------------------*/
-CMPIStatus Linux_BIOSFeatureBIOSElementsCleanup( CMPIInstanceMI * mi,
- CMPIContext * ctx) {
+CMPIStatus Linux_BIOSFeatureBIOSElementsCleanup( CMPIInstanceMI * mi,
+ const CMPIContext * ctx, CMPIBoolean terminating) {
CMReturn(CMPI_RC_OK);
}
-CMPIStatus Linux_BIOSFeatureBIOSElementsEnumInstanceNames( CMPIInstanceMI * mi,
- CMPIContext * ctx,
- CMPIResult * rslt,
- CMPIObjectPath * ref) {
+CMPIStatus Linux_BIOSFeatureBIOSElementsEnumInstanceNames( CMPIInstanceMI * mi,
+ const CMPIContext * ctx,
+ const CMPIResult * rslt,
+ const CMPIObjectPath * ref) {
CMPIStatus rc = {CMPI_RC_OK, NULL};
CMPIObjectPath *copLeft, *copRight;
CMPIData valLeft, valRight;
CMPIEnumeration *enmLeft, *enmRight;
-
+
if( _debug )
fprintf( stderr, "--- %s.c : CMPI EnumInstanceNames()\n", _ClassName );
@@ -102,11 +102,11 @@ CMPIStatus Linux_BIOSFeatureBIOSElementsEnumInstanceNames( CMPIInstanceMI * mi,
return rc;
}
-CMPIStatus Linux_BIOSFeatureBIOSElementsEnumInstances( CMPIInstanceMI * mi,
- CMPIContext * ctx,
- CMPIResult * rslt,
- CMPIObjectPath * ref,
- char ** properties) {
+CMPIStatus Linux_BIOSFeatureBIOSElementsEnumInstances( CMPIInstanceMI * mi,
+ const CMPIContext * ctx,
+ const CMPIResult * rslt,
+ const CMPIObjectPath * ref,
+ const char ** properties) {
CMPIStatus rc = {CMPI_RC_OK, NULL};
CMPIObjectPath *copLeft, *copRight;
CMPIData valLeft, valRight;
@@ -140,15 +140,15 @@ CMPIStatus Linux_BIOSFeatureBIOSElementsEnumInstances( CMPIInstanceMI * mi,
return rc;
}
-CMPIStatus Linux_BIOSFeatureBIOSElementsGetInstance( CMPIInstanceMI * mi,
- CMPIContext * ctx,
- CMPIResult * rslt,
- CMPIObjectPath * cop,
- char ** properties) {
+CMPIStatus Linux_BIOSFeatureBIOSElementsGetInstance( CMPIInstanceMI * mi,
+ const CMPIContext * ctx,
+ const CMPIResult * rslt,
+ const CMPIObjectPath * cop,
+ const char ** properties) {
CMPIStatus rc = {CMPI_RC_OK, NULL};
CMPIData valLeft, valRight;
CMPIInstance *instLeft, *instRight;
-
+
if( _debug )
fprintf( stderr, "--- %s.c : CMPI GetInstance()\n", _ClassName );
@@ -164,66 +164,70 @@ CMPIStatus Linux_BIOSFeatureBIOSElementsGetInstance( CMPIInstanceMI * mi,
} else {
rc.msg = CMNewString(_broker,"Failed to get REF variables.",NULL);
rc.rc = CMPI_RC_ERR_NOT_FOUND;
- }
+ }
} else {
rc.msg = CMNewString(_broker,"Failed to get REF class definitions.",NULL);
rc.rc = CMPI_RC_ERR_FAILED;
- }
+ }
CMReturnDone(rslt);
return rc;
}
-CMPIStatus Linux_BIOSFeatureBIOSElementsCreateInstance( CMPIInstanceMI * mi,
- CMPIContext * ctx,
- CMPIResult * rslt,
- CMPIObjectPath * cop,
- CMPIInstance * ci) {
+CMPIStatus Linux_BIOSFeatureBIOSElementsCreateInstance( CMPIInstanceMI * mi,
+ const CMPIContext * ctx,
+ const CMPIResult * rslt,
+ const CMPIObjectPath * cop,
+ const CMPIInstance * ci) {
CMPIStatus rc = {CMPI_RC_OK, NULL};
if( _debug )
- fprintf( stderr, "--- %s.c : CMPI CreateInstance()\n", _ClassName );
- CMSetStatusWithChars( _broker, &rc,
- CMPI_RC_ERR_NOT_SUPPORTED, "NOT_SUPPORTED" );
+ fprintf( stderr, "--- %s.c : CMPI CreateInstance()\n", _ClassName );
+ CMSetStatusWithChars( _broker, &rc,
+ CMPI_RC_ERR_NOT_SUPPORTED, "NOT_SUPPORTED" );
return rc;
}
-CMPIStatus Linux_BIOSFeatureBIOSElementsSetInstance( CMPIInstanceMI * mi,
- CMPIContext * ctx,
- CMPIResult * rslt,
- CMPIObjectPath * cop,
- CMPIInstance * ci,
- char **properties) {
+#if defined(CMPI_VER_100)
+CMPIStatus Linux_BIOSFeatureBIOSElementsModifyInstance( CMPIInstanceMI * mi,
+#else
+CMPIStatus Linux_BIOSFeatureBIOSElementsSetInstance( CMPIInstanceMI * mi,
+#endif
+ const CMPIContext * ctx,
+ const CMPIResult * rslt,
+ const CMPIObjectPath * cop,
+ const CMPIInstance * ci,
+ const char **properties) {
CMPIStatus rc = {CMPI_RC_OK, NULL};
if( _debug )
- fprintf( stderr, "--- %s.c : CMPI SetInstance()\n", _ClassName );
- CMSetStatusWithChars( _broker, &rc,
- CMPI_RC_ERR_NOT_SUPPORTED, "NOT_SUPPORTED" );
+ fprintf( stderr, "--- %s.c : CMPI SetInstance()\n", _ClassName );
+ CMSetStatusWithChars( _broker, &rc,
+ CMPI_RC_ERR_NOT_SUPPORTED, "NOT_SUPPORTED" );
return rc;
}
-CMPIStatus Linux_BIOSFeatureBIOSElementsDeleteInstance( CMPIInstanceMI * mi,
- CMPIContext * ctx,
- CMPIResult * rslt,
- CMPIObjectPath * cop) {
- CMPIStatus rc = {CMPI_RC_OK, NULL};
+CMPIStatus Linux_BIOSFeatureBIOSElementsDeleteInstance( CMPIInstanceMI * mi,
+ const CMPIContext * ctx,
+ const CMPIResult * rslt,
+ const CMPIObjectPath * cop) {
+ CMPIStatus rc = {CMPI_RC_OK, NULL};
if( _debug )
- fprintf( stderr, "--- %s.c : CMPI DeleteInstance()\n", _ClassName );
- CMSetStatusWithChars( _broker, &rc,
- CMPI_RC_ERR_NOT_SUPPORTED, "NOT_SUPPORTED" );
+ fprintf( stderr, "--- %s.c : CMPI DeleteInstance()\n", _ClassName );
+ CMSetStatusWithChars( _broker, &rc,
+ CMPI_RC_ERR_NOT_SUPPORTED, "NOT_SUPPORTED" );
return rc;
}
-CMPIStatus Linux_BIOSFeatureBIOSElementsExecQuery( CMPIInstanceMI * mi,
- CMPIContext * ctx,
- CMPIResult * rslt,
- CMPIObjectPath * ref,
- char * lang,
- char * query) {
+CMPIStatus Linux_BIOSFeatureBIOSElementsExecQuery( CMPIInstanceMI * mi,
+ const CMPIContext * ctx,
+ const CMPIResult * rslt,
+ const CMPIObjectPath * ref,
+ const char * lang,
+ const char * query) {
CMPIStatus rc = {CMPI_RC_OK, NULL};
if( _debug )
- fprintf( stderr, "--- %s.c : CMPI ExecQuery()\n", _ClassName );
- CMSetStatusWithChars( _broker, &rc,
- CMPI_RC_ERR_NOT_SUPPORTED, "NOT_SUPPORTED" );
+ fprintf( stderr, "--- %s.c : CMPI ExecQuery()\n", _ClassName );
+ CMSetStatusWithChars( _broker, &rc,
+ CMPI_RC_ERR_NOT_SUPPORTED, "NOT_SUPPORTED" );
return rc;
}
@@ -234,21 +238,21 @@ CMPIStatus Linux_BIOSFeatureBIOSElementsExecQuery( CMPIInstanceMI * mi,
CMPIStatus Linux_BIOSFeatureBIOSElementsAssociationCleanup( CMPIAssociationMI * mi,
- CMPIContext * ctx) {
+ const CMPIContext * ctx, CMPIBoolean terminating) {
if( _debug )
- fprintf( stderr, "--- %s.c : CMPI AssociationCleanup()\n", _ClassName );
+ fprintf( stderr, "--- %s.c : CMPI AssociationCleanup()\n", _ClassName );
CMReturn(CMPI_RC_OK);
}
-/*
+/*
* The intention of associations is to show the relations between different
- * classes and their instances. Therefore an association has two properties.
+ * classes and their instances. Therefore an association has two properties.
* Each one representing a reference to a certain instance of the specified
- * class. We can say, that an association has a left and the right "end".
- *
- * Linux_BIOSFeatureBIOSElements :
+ * class. We can say, that an association has a left and the right "end".
+ *
+ * Linux_BIOSFeatureBIOSElements :
* < role > -> < class >
- * "_RefLeft" -> "_RefLeftClass"
+ * "_RefLeft" -> "_RefLeftClass"
* "_RefRight" -> "_RefRightClass"
*
*/
@@ -257,15 +261,15 @@ CMPIStatus Linux_BIOSFeatureBIOSElementsAssociationCleanup( CMPIAssociationMI *
* general API information
*
* cop :
- * Specifies the CMPIObjectPath to the CMPIInstance of the known end of
+ * Specifies the CMPIObjectPath to the CMPIInstance of the known end of
* the association. Its absolutelly necessary to define this anchor point,
* from where the evaluation of the association starts.
- * assocPath :
- * If not NULL, it contains the name of the association the caller is
- * looking for. The provider should only return values, when the assocPath
+ * assocPath :
+ * If not NULL, it contains the name of the association the caller is
+ * looking for. The provider should only return values, when the assocPath
* contains the name(s) of the association(s) he is responsible for !
* role :
- * The caller can specify that the source instance ( cop ) has to play
+ * The caller can specify that the source instance ( cop ) has to play
* a certain <role> in the association. The <role> is specified by the
* association definition (see above). That means, role has to contain
* the same value as the <role> the source instance plays in this assoc.
@@ -275,40 +279,40 @@ CMPIStatus Linux_BIOSFeatureBIOSElementsAssociationCleanup( CMPIAssociationMI *
/*
* specification of associators() and associatorNames()
*
- * These methods return CMPIInstance ( in the case of associators() ) or
- * CMPIObjectPath ( in the case of associatorNames() ) object(s) of the
+ * These methods return CMPIInstance ( in the case of associators() ) or
+ * CMPIObjectPath ( in the case of associatorNames() ) object(s) of the
* opposite end of the association.
*
* resultRole :
- * The caller can specify that the target instance(s) has/have to play
+ * The caller can specify that the target instance(s) has/have to play
* a certain <role> in the association. The <role> is specified by the
- * association definition (see above). That means, resultRole has to
+ * association definition (see above). That means, resultRole has to
* contain the same value as the <role> the target instance(s) plays
- * in this assoc. If this requirement is not true, the provider returns
+ * in this assoc. If this requirement is not true, the provider returns
* nothing.
* resultClass :
- * The caller can specify that the target instance(s) has/have to be
+ * The caller can specify that the target instance(s) has/have to be
* instances of a certain <class>. The <class> is specified by the
- * association definition (see above). That means, resultClass has to
+ * association definition (see above). That means, resultClass has to
* contain the same value as the <class> of the target instance(s).
* If this requirement is not true, the provider returns nothing.
*/
CMPIStatus Linux_BIOSFeatureBIOSElementsAssociators( CMPIAssociationMI * mi,
- CMPIContext * ctx,
- CMPIResult * rslt,
- CMPIObjectPath * cop,
- char * assocClass,
- char * resultClass,
- char * role,
- char * resultRole,
- char ** propertyList ) {
+ const CMPIContext * ctx,
+ const CMPIResult * rslt,
+ const CMPIObjectPath * cop,
+ const char * assocClass,
+ const char * resultClass,
+ const char * role,
+ const char * resultRole,
+ const char ** propertyList ) {
CMPIStatus rc = {CMPI_RC_OK, NULL};
CMPIObjectPath * op = NULL;
if( _debug )
- fprintf( stderr, "--- %s.c : CMPI Associators()\n", _ClassName );
-
+ fprintf( stderr, "--- %s.c : CMPI Associators()\n", _ClassName );
+
if( assocClass ) {
op = CMNewObjectPath( _broker, CMGetCharPtr(CMGetNameSpace(cop,&rc)),
_ClassName, &rc );
@@ -317,7 +321,7 @@ CMPIStatus Linux_BIOSFeatureBIOSElementsAssociators( CMPIAssociationMI * mi,
if( ( assocClass==NULL ) || ( CMClassPathIsA(_broker,op,assocClass,&rc) == 1 ) ) {
if (CMClassPathIsA(_broker,cop,_RefLeftClass,&rc)) {
/* source is left hand side - retrieve right hand side */
- CMPIObjectPath *copRight =
+ CMPIObjectPath *copRight =
CMNewObjectPath(_broker,CMGetCharPtr(CMGetNameSpace(cop,&rc)),
_RefRightClass, &rc);
if (copRight) {
@@ -334,7 +338,7 @@ CMPIStatus Linux_BIOSFeatureBIOSElementsAssociators( CMPIAssociationMI * mi,
}
} else if (CMClassPathIsA(_broker,cop,_RefRightClass,&rc)) {
/* source is left hand side - retrieve right hand side */
- CMPIObjectPath *copLeft =
+ CMPIObjectPath *copLeft =
CMNewObjectPath(_broker,CMGetCharPtr(CMGetNameSpace(cop,&rc)),
_RefLeftClass, &rc);
if (copLeft) {
@@ -357,19 +361,19 @@ CMPIStatus Linux_BIOSFeatureBIOSElementsAssociators( CMPIAssociationMI * mi,
}
CMPIStatus Linux_BIOSFeatureBIOSElementsAssociatorNames( CMPIAssociationMI * mi,
- CMPIContext * ctx,
- CMPIResult * rslt,
- CMPIObjectPath * cop,
- char * assocClass,
- char * resultClass,
- char * role,
- char * resultRole) {
+ const CMPIContext * ctx,
+ const CMPIResult * rslt,
+ const CMPIObjectPath * cop,
+ const char * assocClass,
+ const char * resultClass,
+ const char * role,
+ const char * resultRole) {
CMPIStatus rc = {CMPI_RC_OK, NULL};
CMPIObjectPath * op = NULL;
if( _debug )
- fprintf( stderr, "--- %s.c : CMPI AssociatorNames()\n", _ClassName );
-
+ fprintf( stderr, "--- %s.c : CMPI AssociatorNames()\n", _ClassName );
+
if( assocClass ) {
op = CMNewObjectPath( _broker, CMGetCharPtr(CMGetNameSpace(cop,&rc)),
_ClassName, &rc );
@@ -378,11 +382,11 @@ CMPIStatus Linux_BIOSFeatureBIOSElementsAssociatorNames( CMPIAssociationMI * mi,
if( ( assocClass==NULL ) || ( CMClassPathIsA(_broker,op,assocClass,&rc) == 1 ) ) {
if (CMClassPathIsA(_broker,cop,_RefLeftClass,&rc)) {
/* source is left hand side - retrieve right hand side */
- CMPIObjectPath *copRight =
+ CMPIObjectPath *copRight =
CMNewObjectPath(_broker,CMGetCharPtr(CMGetNameSpace(cop,&rc)),
_RefRightClass, &rc);
if (copRight) {
- CMPIEnumeration *enm =
+ CMPIEnumeration *enm =
CBEnumInstanceNames(_broker,ctx,copRight,&rc);
if (enm) {
while(CMHasNext(enm,&rc)) {
@@ -396,11 +400,11 @@ CMPIStatus Linux_BIOSFeatureBIOSElementsAssociatorNames( CMPIAssociationMI * mi,
}
} else if (CMClassPathIsA(_broker,cop,_RefRightClass,&rc)) {
/* source is right hand side - retrieve left hand side */
- CMPIObjectPath *copLeft =
+ CMPIObjectPath *copLeft =
CMNewObjectPath(_broker,CMGetCharPtr(CMGetNameSpace(cop,&rc)),
_RefLeftClass, &rc);
if (copLeft) {
- CMPIEnumeration *enm =
+ CMPIEnumeration *enm =
CBEnumInstanceNames(_broker,ctx,copLeft,&rc);
if (enm) {
while(CMHasNext(enm,&rc)) {
@@ -414,7 +418,7 @@ CMPIStatus Linux_BIOSFeatureBIOSElementsAssociatorNames( CMPIAssociationMI * mi,
}
}
}
-
+
CMReturnDone( rslt );
CMReturn(CMPI_RC_OK);
}
@@ -423,63 +427,63 @@ CMPIStatus Linux_BIOSFeatureBIOSElementsAssociatorNames( CMPIAssociationMI * mi,
/*
* specification of references() and referenceNames()
*
- * These methods return CMPIInstance ( in the case of references() ) or
- * CMPIObjectPath ( in the case of referenceNames() ) object(s) of th
+ * These methods return CMPIInstance ( in the case of references() ) or
+ * CMPIObjectPath ( in the case of referenceNames() ) object(s) of th
* association itself.
*/
CMPIStatus Linux_BIOSFeatureBIOSElementsReferences( CMPIAssociationMI * mi,
- CMPIContext * ctx,
- CMPIResult * rslt,
- CMPIObjectPath * cop,
- char * assocClass,
- char * role,
- char ** propertyList ) {
+ const CMPIContext * ctx,
+ const CMPIResult * rslt,
+ const CMPIObjectPath * cop,
+ const char * assocClass,
+ const char * role,
+ const char ** propertyList ) {
CMPIStatus rc = {CMPI_RC_OK, NULL};
CMPIObjectPath * op = NULL;
if( _debug )
- fprintf( stderr, "--- %s.c : CMPI References()\n", _ClassName );
-
+ fprintf( stderr, "--- %s.c : CMPI References()\n", _ClassName );
+
op = CMNewObjectPath( _broker, CMGetCharPtr(CMGetNameSpace(cop,&rc)),
_ClassName, &rc );
-
+
if( ( assocClass==NULL ) || ( CMClassPathIsA(_broker,op,assocClass,&rc) == 1 ) ) {
- if (CMClassPathIsA(_broker,cop,_RefLeftClass,&rc) ||
+ if (CMClassPathIsA(_broker,cop,_RefLeftClass,&rc) ||
CMClassPathIsA(_broker,cop,_RefRightClass,&rc) ) {
return Linux_BIOSFeatureBIOSElementsEnumInstances((CMPIInstanceMI*)mi,
ctx,rslt,op,
propertyList);
}
}
-
+
CMReturnDone( rslt );
CMReturn(CMPI_RC_OK);
}
CMPIStatus Linux_BIOSFeatureBIOSElementsReferenceNames( CMPIAssociationMI * mi,
- CMPIContext * ctx,
- CMPIResult * rslt,
- CMPIObjectPath * cop,
- char * assocClass,
- char * role) {
+ const CMPIContext * ctx,
+ const CMPIResult * rslt,
+ const CMPIObjectPath * cop,
+ const char * assocClass,
+ const char * role) {
CMPIStatus rc = {CMPI_RC_OK, NULL};
CMPIObjectPath * op = NULL;
if( _debug )
- fprintf( stderr, "--- %s.c : CMPI ReferenceNames()\n", _ClassName );
-
+ fprintf( stderr, "--- %s.c : CMPI ReferenceNames()\n", _ClassName );
+
op = CMNewObjectPath( _broker, CMGetCharPtr(CMGetNameSpace(cop,&rc)),
_ClassName, &rc );
-
+
if( ( assocClass==NULL ) || ( CMClassPathIsA(_broker,op,assocClass,&rc) == 1 ) ) {
- if (CMClassPathIsA(_broker,cop,_RefLeftClass,&rc) ||
+ if (CMClassPathIsA(_broker,cop,_RefLeftClass,&rc) ||
CMClassPathIsA(_broker,cop,_RefRightClass,&rc) ) {
return Linux_BIOSFeatureBIOSElementsEnumInstanceNames((CMPIInstanceMI*)mi,
ctx,rslt,op);
}
}
-
+
CMReturnDone( rslt );
CMReturn(CMPI_RC_OK);
}
diff --git a/cmpiLinux_BIOSProduct.c b/cmpiLinux_BIOSProduct.c
index bc998bc..5a25279 100644
--- a/cmpiLinux_BIOSProduct.c
+++ b/cmpiLinux_BIOSProduct.c
@@ -3,8 +3,8 @@
*
* (C) Copyright IBM Corp. 2003
*
- * THIS FILE IS PROVIDED UNDER THE TERMS OF THE COMMON PUBLIC LICENSE
- * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
+ * THIS FILE IS PROVIDED UNDER THE TERMS OF THE COMMON PUBLIC LICENSE
+ * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
* CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
*
* You can obtain a current copy of the Common Public License from
@@ -16,16 +16,16 @@
* Interface Type : Common Manageability Programming Interface ( CMPI )
*
* Description: The Product Class. Anchor for BIOS Feature.
- *
+ *
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
-#include "cmpidt.h"
-#include "cmpift.h"
-#include "cmpimacs.h"
+#include <cmpidt.h>
+#include <cmpift.h>
+#include <cmpimacs.h>
#include "dmiinfo.h"
@@ -52,23 +52,23 @@ static CMPIInstance *makeInstance(DMI_BIOSPRODUCT *bp,CMPIObjectPath *op);
/* ---------------------------------------------------------------------------*/
-CMPIStatus Linux_BIOSProductCleanup( CMPIInstanceMI * mi,
- CMPIContext * ctx) {
+CMPIStatus Linux_BIOSProductCleanup( CMPIInstanceMI * mi,
+ const CMPIContext * ctx, CMPIBoolean terminating) {
cimdmi_term();
CMReturn(CMPI_RC_OK);
}
-CMPIStatus Linux_BIOSProductEnumInstanceNames( CMPIInstanceMI * mi,
- CMPIContext * ctx,
- CMPIResult * rslt,
- CMPIObjectPath * ref) {
+CMPIStatus Linux_BIOSProductEnumInstanceNames( CMPIInstanceMI * mi,
+ const CMPIContext * ctx,
+ const CMPIResult * rslt,
+ const CMPIObjectPath * ref) {
CMPIStatus rc = {CMPI_RC_OK, NULL};
CMPIObjectPath *op;
DMI_BIOSPRODUCT *biosprod;
if( _debug )
fprintf( stderr, "--- %s.c : CMPI EnumInstanceNames()\n", _ClassName );
-
+
biosprod=cimdmi_getBiosProduct();
if (biosprod) {
op = makeObjectPath(biosprod,ref);
@@ -88,11 +88,11 @@ CMPIStatus Linux_BIOSProductEnumInstanceNames( CMPIInstanceMI * mi,
return rc;;
}
-CMPIStatus Linux_BIOSProductEnumInstances( CMPIInstanceMI * mi,
- CMPIContext * ctx,
- CMPIResult * rslt,
- CMPIObjectPath * ref,
- char ** properties) {
+CMPIStatus Linux_BIOSProductEnumInstances( CMPIInstanceMI * mi,
+ const CMPIContext * ctx,
+ const CMPIResult * rslt,
+ const CMPIObjectPath * ref,
+ const char ** properties) {
CMPIStatus rc = {CMPI_RC_OK, NULL};
CMPIInstance *inst;
DMI_BIOSPRODUCT *biosprod;
@@ -119,11 +119,11 @@ CMPIStatus Linux_BIOSProductEnumInstances( CMPIInstanceMI * mi,
return rc;
}
-CMPIStatus Linux_BIOSProductGetInstance( CMPIInstanceMI * mi,
- CMPIContext * ctx,
- CMPIResult * rslt,
- CMPIObjectPath * cop,
- char ** properties) {
+CMPIStatus Linux_BIOSProductGetInstance( CMPIInstanceMI * mi,
+ const CMPIContext * ctx,
+ const CMPIResult * rslt,
+ const CMPIObjectPath * cop,
+ const char ** properties) {
CMPIStatus rc = {CMPI_RC_OK, NULL};
CMPIInstance *inst;
DMI_BIOSPRODUCT *biosprod;
@@ -150,56 +150,60 @@ CMPIStatus Linux_BIOSProductGetInstance( CMPIInstanceMI * mi,
return rc;
}
-CMPIStatus Linux_BIOSProductCreateInstance( CMPIInstanceMI * mi,
- CMPIContext * ctx,
- CMPIResult * rslt,
- CMPIObjectPath * cop,
- CMPIInstance * ci) {
+CMPIStatus Linux_BIOSProductCreateInstance( CMPIInstanceMI * mi,
+ const CMPIContext * ctx,
+ const CMPIResult * rslt,
+ const CMPIObjectPath * cop,
+ const CMPIInstance * ci) {
CMPIStatus rc = {CMPI_RC_OK, NULL};
if( _debug )
- fprintf( stderr, "--- %s.c : CMPI CreateInstance()\n", _ClassName );
- CMSetStatusWithChars( _broker, &rc,
- CMPI_RC_ERR_NOT_SUPPORTED, "NOT_SUPPORTED" );
+ fprintf( stderr, "--- %s.c : CMPI CreateInstance()\n", _ClassName );
+ CMSetStatusWithChars( _broker, &rc,
+ CMPI_RC_ERR_NOT_SUPPORTED, "NOT_SUPPORTED" );
return rc;
}
-CMPIStatus Linux_BIOSProductSetInstance( CMPIInstanceMI * mi,
- CMPIContext * ctx,
- CMPIResult * rslt,
- CMPIObjectPath * cop,
- CMPIInstance * ci,
- char **properties) {
+#if defined(CMPI_VER_100)
+CMPIStatus Linux_BIOSProductModifyInstance( CMPIInstanceMI * mi,
+#else
+CMPIStatus Linux_BIOSProductSetInstance( CMPIInstanceMI * mi,
+#endif
+ const CMPIContext * ctx,
+ const CMPIResult * rslt,
+ const CMPIObjectPath * cop,
+ const CMPIInstance * ci,
+ const char **properties) {
CMPIStatus rc = {CMPI_RC_OK, NULL};
if( _debug )
- fprintf( stderr, "--- %s.c : CMPI SetInstance()\n", _ClassName );
- CMSetStatusWithChars( _broker, &rc,
- CMPI_RC_ERR_NOT_SUPPORTED, "NOT_SUPPORTED" );
+ fprintf( stderr, "--- %s.c : CMPI SetInstance()\n", _ClassName );
+ CMSetStatusWithChars( _broker, &rc,
+ CMPI_RC_ERR_NOT_SUPPORTED, "NOT_SUPPORTED" );
return rc;
}
-CMPIStatus Linux_BIOSProductDeleteInstance( CMPIInstanceMI * mi,
- CMPIContext * ctx,
- CMPIResult * rslt,
- CMPIObjectPath * cop) {
- CMPIStatus rc = {CMPI_RC_OK, NULL};
+CMPIStatus Linux_BIOSProductDeleteInstance( CMPIInstanceMI * mi,
+ const CMPIContext * ctx,
+ const CMPIResult * rslt,
+ const CMPIObjectPath * cop) {
+ CMPIStatus rc = {CMPI_RC_OK, NULL};
if( _debug )
- fprintf( stderr, "--- %s.c : CMPI DeleteInstance()\n", _ClassName );
- CMSetStatusWithChars( _broker, &rc,
- CMPI_RC_ERR_NOT_SUPPORTED, "NOT_SUPPORTED" );
+ fprintf( stderr, "--- %s.c : CMPI DeleteInstance()\n", _ClassName );
+ CMSetStatusWithChars( _broker, &rc,
+ CMPI_RC_ERR_NOT_SUPPORTED, "NOT_SUPPORTED" );
return rc;
}
-CMPIStatus Linux_BIOSProductExecQuery( CMPIInstanceMI * mi,
- CMPIContext * ctx,
- CMPIResult * rslt,
- CMPIObjectPath * ref,
- char * lang,
- char * query) {
+CMPIStatus Linux_BIOSProductExecQuery( CMPIInstanceMI * mi,
+ const CMPIContext * ctx,
+ const CMPIResult * rslt,
+ const CMPIObjectPath * ref,
+ const char * lang,
+ const char * query) {
CMPIStatus rc = {CMPI_RC_OK, NULL};
if( _debug )
- fprintf( stderr, "--- %s.c : CMPI ExecQuery()\n", _ClassName );
- CMSetStatusWithChars( _broker, &rc,
- CMPI_RC_ERR_NOT_SUPPORTED, "NOT_SUPPORTED" );
+ fprintf( stderr, "--- %s.c : CMPI ExecQuery()\n", _ClassName );
+ CMSetStatusWithChars( _broker, &rc,
+ CMPI_RC_ERR_NOT_SUPPORTED, "NOT_SUPPORTED" );
return rc;
}
diff --git a/cmpiLinux_BIOSProductBIOSFeatures.c b/cmpiLinux_BIOSProductBIOSFeatures.c
index fb2475b..0114966 100644
--- a/cmpiLinux_BIOSProductBIOSFeatures.c
+++ b/cmpiLinux_BIOSProductBIOSFeatures.c
@@ -3,8 +3,8 @@
*
* (C) Copyright IBM Corp. 2003
*
- * THIS FILE IS PROVIDED UNDER THE TERMS OF THE COMMON PUBLIC LICENSE
- * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
+ * THIS FILE IS PROVIDED UNDER THE TERMS OF THE COMMON PUBLIC LICENSE
+ * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
* CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
*
* You can obtain a current copy of the Common Public License from
@@ -16,7 +16,7 @@
* Interface Type : Common Manageability Programming Interface ( CMPI )
*
* Description: Association between BIOS Product and Feature.
- *
+ *
*/
#include <stdlib.h>
@@ -31,7 +31,7 @@
unsigned char CMPI_true=1;
unsigned char CMPI_false=0;
-CMPIBroker * _broker;
+const CMPIBroker * _broker;
/* ---------------------------------------------------------------------------*/
/* private declarations */
@@ -60,23 +60,23 @@ static CMPIInstance *makeInstance(CMPIObjectPath *opLeft,
/* ---------------------------------------------------------------------------*/
-CMPIStatus Linux_BIOSProductBIOSFeaturesCleanup( CMPIInstanceMI * mi,
- CMPIContext * ctx) {
+CMPIStatus Linux_BIOSProductBIOSFeaturesCleanup( CMPIInstanceMI * mi,
+ const CMPIContext * ctx, CMPIBoolean terminating) {
CMReturn(CMPI_RC_OK);
}
-CMPIStatus Linux_BIOSProductBIOSFeaturesEnumInstanceNames( CMPIInstanceMI * mi,
- CMPIContext * ctx,
- CMPIResult * rslt,
- CMPIObjectPath * ref) {
+CMPIStatus Linux_BIOSProductBIOSFeaturesEnumInstanceNames( CMPIInstanceMI * mi,
+ const CMPIContext * ctx,
+ const CMPIResult * rslt,
+ const CMPIObjectPath * ref) {
CMPIStatus rc = {CMPI_RC_OK, NULL};
CMPIObjectPath *copLeft, *copRight;
CMPIData valLeft, valRight;
CMPIEnumeration *enmLeft, *enmRight;
-
+
if( _debug )
fprintf( stderr, "--- %s.c : CMPI EnumInstanceNames()\n", _ClassName );
-
+
copLeft = CMNewObjectPath(_broker,"",_RefLeftClass,NULL);
copRight = CMNewObjectPath(_broker,"",_RefRightClass,NULL);
if (copLeft && copRight) {
@@ -97,16 +97,16 @@ CMPIStatus Linux_BIOSProductBIOSFeaturesEnumInstanceNames( CMPIInstanceMI * mi,
rc.msg = CMNewString(_broker,"Failed to get REF class definitions.",NULL);
rc.rc = CMPI_RC_ERR_FAILED;
}
-
+
CMReturnDone( rslt );
return rc;
}
-CMPIStatus Linux_BIOSProductBIOSFeaturesEnumInstances( CMPIInstanceMI * mi,
- CMPIContext * ctx,
- CMPIResult * rslt,
- CMPIObjectPath * ref,
- char ** properties) {
+CMPIStatus Linux_BIOSProductBIOSFeaturesEnumInstances( CMPIInstanceMI * mi,
+ const CMPIContext * ctx,
+ const CMPIResult * rslt,
+ const CMPIObjectPath * ref,
+ const char ** properties) {
CMPIStatus rc = {CMPI_RC_OK, NULL};
CMPIObjectPath *copLeft, *copRight;
CMPIData valLeft, valRight;
@@ -140,15 +140,15 @@ CMPIStatus Linux_BIOSProductBIOSFeaturesEnumInstances( CMPIInstanceMI * mi,
return rc;
}
-CMPIStatus Linux_BIOSProductBIOSFeaturesGetInstance( CMPIInstanceMI * mi,
- CMPIContext * ctx,
- CMPIResult * rslt,
- CMPIObjectPath * cop,
- char ** properties) {
+CMPIStatus Linux_BIOSProductBIOSFeaturesGetInstance( CMPIInstanceMI * mi,
+ const CMPIContext * ctx,
+ const CMPIResult * rslt,
+ const CMPIObjectPath * cop,
+ const char ** properties) {
CMPIStatus rc = {CMPI_RC_OK, NULL};
CMPIData valLeft, valRight;
CMPIInstance *instLeft, *instRight;
-
+
if( _debug )
fprintf( stderr, "--- %s.c : CMPI GetInstance()\n", _ClassName );
@@ -164,67 +164,71 @@ CMPIStatus Linux_BIOSProductBIOSFeaturesGetInstance( CMPIInstanceMI * mi,
} else {
rc.msg = CMNewString(_broker,"Failed to get REF variables.",NULL);
rc.rc = CMPI_RC_ERR_NOT_FOUND;
- }
+ }
} else {
rc.msg = CMNewString(_broker,"Failed to get REF class definitions.",NULL);
rc.rc = CMPI_RC_ERR_FAILED;
}
-
+
CMReturnDone( rslt );
return rc;
}
-CMPIStatus Linux_BIOSProductBIOSFeaturesCreateInstance( CMPIInstanceMI * mi,
- CMPIContext * ctx,
- CMPIResult * rslt,
- CMPIObjectPath * cop,
- CMPIInstance * ci) {
+CMPIStatus Linux_BIOSProductBIOSFeaturesCreateInstance( CMPIInstanceMI * mi,
+ const CMPIContext * ctx,
+ const CMPIResult * rslt,
+ const CMPIObjectPath * cop,
+ const CMPIInstance * ci) {
CMPIStatus rc = {CMPI_RC_OK, NULL};
if( _debug )
- fprintf( stderr, "--- %s.c : CMPI CreateInstance()\n", _ClassName );
- CMSetStatusWithChars( _broker, &rc,
- CMPI_RC_ERR_NOT_SUPPORTED, "NOT_SUPPORTED" );
+ fprintf( stderr, "--- %s.c : CMPI CreateInstance()\n", _ClassName );
+ CMSetStatusWithChars( _broker, &rc,
+ CMPI_RC_ERR_NOT_SUPPORTED, "NOT_SUPPORTED" );
return rc;
}
-CMPIStatus Linux_BIOSProductBIOSFeaturesSetInstance( CMPIInstanceMI * mi,
- CMPIContext * ctx,
- CMPIResult * rslt,
- CMPIObjectPath * cop,
- CMPIInstance * ci,
- char **properties) {
+#if defined(CMPI_VER_100)
+CMPIStatus Linux_BIOSProductBIOSFeaturesModifyInstance( CMPIInstanceMI * mi,
+#else
+CMPIStatus Linux_BIOSProductBIOSFeaturesSetInstance( CMPIInstanceMI * mi,
+#endif
+ const CMPIContext * ctx,
+ const CMPIResult * rslt,
+ const CMPIObjectPath * cop,
+ const CMPIInstance * ci,
+ const char **properties) {
CMPIStatus rc = {CMPI_RC_OK, NULL};
if( _debug )
- fprintf( stderr, "--- %s.c : CMPI SetInstance()\n", _ClassName );
- CMSetStatusWithChars( _broker, &rc,
- CMPI_RC_ERR_NOT_SUPPORTED, "NOT_SUPPORTED" );
+ fprintf( stderr, "--- %s.c : CMPI SetInstance()\n", _ClassName );
+ CMSetStatusWithChars( _broker, &rc,
+ CMPI_RC_ERR_NOT_SUPPORTED, "NOT_SUPPORTED" );
return rc;
}
-CMPIStatus Linux_BIOSProductBIOSFeaturesDeleteInstance( CMPIInstanceMI * mi,
- CMPIContext * ctx,
- CMPIResult * rslt,
- CMPIObjectPath * cop) {
- CMPIStatus rc = {CMPI_RC_OK, NULL};
+CMPIStatus Linux_BIOSProductBIOSFeaturesDeleteInstance( CMPIInstanceMI * mi,
+ const CMPIContext * ctx,
+ const CMPIResult * rslt,
+ const CMPIObjectPath * cop) {
+ CMPIStatus rc = {CMPI_RC_OK, NULL};
if( _debug )
- fprintf( stderr, "--- %s.c : CMPI DeleteInstance()\n", _ClassName );
- CMSetStatusWithChars( _broker, &rc,
- CMPI_RC_ERR_NOT_SUPPORTED, "NOT_SUPPORTED" );
+ fprintf( stderr, "--- %s.c : CMPI DeleteInstance()\n", _ClassName );
+ CMSetStatusWithChars( _broker, &rc,
+ CMPI_RC_ERR_NOT_SUPPORTED, "NOT_SUPPORTED" );
return rc;
}
-CMPIStatus Linux_BIOSProductBIOSFeaturesExecQuery( CMPIInstanceMI * mi,
- CMPIContext * ctx,
- CMPIResult * rslt,
- CMPIObjectPath * ref,
- char * lang,
- char * query) {
+CMPIStatus Linux_BIOSProductBIOSFeaturesExecQuery( CMPIInstanceMI * mi,
+ const CMPIContext * ctx,
+ const CMPIResult * rslt,
+ const CMPIObjectPath * ref,
+ const char * lang,
+ const char * query) {
CMPIStatus rc = {CMPI_RC_OK, NULL};
if( _debug )
- fprintf( stderr, "--- %s.c : CMPI ExecQuery()\n", _ClassName );
- CMSetStatusWithChars( _broker, &rc,
- CMPI_RC_ERR_NOT_SUPPORTED, "NOT_SUPPORTED" );
+ fprintf( stderr, "--- %s.c : CMPI ExecQuery()\n", _ClassName );
+ CMSetStatusWithChars( _broker, &rc,
+ CMPI_RC_ERR_NOT_SUPPORTED, "NOT_SUPPORTED" );
return rc;
}
@@ -235,21 +239,21 @@ CMPIStatus Linux_BIOSProductBIOSFeaturesExecQuery( CMPIInstanceMI * mi,
CMPIStatus Linux_BIOSProductBIOSFeaturesAssociationCleanup( CMPIAssociationMI * mi,
- CMPIContext * ctx) {
+ const CMPIContext * ctx, CMPIBoolean terminating) {
if( _debug )
- fprintf( stderr, "--- %s.c : CMPI AssociationCleanup()\n", _ClassName );
+ fprintf( stderr, "--- %s.c : CMPI AssociationCleanup()\n", _ClassName );
CMReturn(CMPI_RC_OK);
}
-/*
+/*
* The intention of associations is to show the relations between different
- * classes and their instances. Therefore an association has two properties.
+ * classes and their instances. Therefore an association has two properties.
* Each one representing a reference to a certain instance of the specified
- * class. We can say, that an association has a left and the right "end".
- *
- * Linux_BIOSProductBIOSFeatures :
+ * class. We can say, that an association has a left and the right "end".
+ *
+ * Linux_BIOSProductBIOSFeatures :
* < role > -> < class >
- * "_RefLeft" -> "_RefLeftClass"
+ * "_RefLeft" -> "_RefLeftClass"
* "_RefRight" -> "_RefRightClass"
*
*/
@@ -258,15 +262,15 @@ CMPIStatus Linux_BIOSProductBIOSFeaturesAssociationCleanup( CMPIAssociationMI *
* general API information
*
* cop :
- * Specifies the CMPIObjectPath to the CMPIInstance of the known end of
+ * Specifies the CMPIObjectPath to the CMPIInstance of the known end of
* the association. Its absolutelly necessary to define this anchor point,
* from where the evaluation of the association starts.
- * assocPath :
- * If not NULL, it contains the name of the association the caller is
- * looking for. The provider should only return values, when the assocPath
+ * assocPath :
+ * If not NULL, it contains the name of the association the caller is
+ * looking for. The provider should only return values, when the assocPath
* contains the name(s) of the association(s) he is responsible for !
* role :
- * The caller can specify that the source instance ( cop ) has to play
+ * The caller can specify that the source instance ( cop ) has to play
* a certain <role> in the association. The <role> is specified by the
* association definition (see above). That means, role has to contain
* the same value as the <role> the source instance plays in this assoc.
@@ -276,40 +280,40 @@ CMPIStatus Linux_BIOSProductBIOSFeaturesAssociationCleanup( CMPIAssociationMI *
/*
* specification of associators() and associatorNames()
*
- * These methods return CMPIInstance ( in the case of associators() ) or
- * CMPIObjectPath ( in the case of associatorNames() ) object(s) of the
+ * These methods return CMPIInstance ( in the case of associators() ) or
+ * CMPIObjectPath ( in the case of associatorNames() ) object(s) of the
* opposite end of the association.
*
* resultRole :
- * The caller can specify that the target instance(s) has/have to play
+ * The caller can specify that the target instance(s) has/have to play
* a certain <role> in the association. The <role> is specified by the
- * association definition (see above). That means, resultRole has to
+ * association definition (see above). That means, resultRole has to
* contain the same value as the <role> the target instance(s) plays
- * in this assoc. If this requirement is not true, the provider returns
+ * in this assoc. If this requirement is not true, the provider returns
* nothing.
* resultClass :
- * The caller can specify that the target instance(s) has/have to be
+ * The caller can specify that the target instance(s) has/have to be
* instances of a certain <class>. The <class> is specified by the
- * association definition (see above). That means, resultClass has to
+ * association definition (see above). That means, resultClass has to
* contain the same value as the <class> of the target instance(s).
* If this requirement is not true, the provider returns nothing.
*/
CMPIStatus Linux_BIOSProductBIOSFeaturesAssociators( CMPIAssociationMI * mi,
- CMPIContext * ctx,
- CMPIResult * rslt,
- CMPIObjectPath * cop,
- char * assocClass,
- char * resultClass,
- char * role,
- char * resultRole,
- char ** propertyList ) {
+ const CMPIContext * ctx,
+ const CMPIResult * rslt,
+ const CMPIObjectPath * cop,
+ const char * assocClass,
+ const char * resultClass,
+ const char * role,
+ const char * resultRole,
+ const char ** propertyList ) {
CMPIStatus rc = {CMPI_RC_OK, NULL};
CMPIObjectPath * op = NULL;
if( _debug )
- fprintf( stderr, "--- %s.c : CMPI Associators()\n", _ClassName );
-
+ fprintf( stderr, "--- %s.c : CMPI Associators()\n", _ClassName );
+
if( assocClass ) {
op = CMNewObjectPath( _broker, CMGetCharPtr(CMGetNameSpace(cop,&rc)),
_ClassName, &rc );
@@ -318,7 +322,7 @@ CMPIStatus Linux_BIOSProductBIOSFeaturesAssociators( CMPIAssociationMI * mi,
if( ( assocClass==NULL ) || ( CMClassPathIsA(_broker,op,assocClass,&rc) == 1 ) ) {
if (CMClassPathIsA(_broker,cop,_RefLeftClass,&rc)) {
/* source is left hand side - retrieve right hand side */
- CMPIObjectPath *copRight =
+ CMPIObjectPath *copRight =
CMNewObjectPath(_broker,CMGetCharPtr(CMGetNameSpace(cop,&rc)),
_RefRightClass, &rc);
if (copRight) {
@@ -335,7 +339,7 @@ CMPIStatus Linux_BIOSProductBIOSFeaturesAssociators( CMPIAssociationMI * mi,
}
} else if (CMClassPathIsA(_broker,cop,_RefRightClass,&rc)) {
/* source is left hand side - retrieve right hand side */
- CMPIObjectPath *copLeft =
+ CMPIObjectPath *copLeft =
CMNewObjectPath(_broker,CMGetCharPtr(CMGetNameSpace(cop,&rc)),
_RefLeftClass, &rc);
if (copLeft) {
@@ -358,19 +362,19 @@ CMPIStatus Linux_BIOSProductBIOSFeaturesAssociators( CMPIAssociationMI * mi,
}
CMPIStatus Linux_BIOSProductBIOSFeaturesAssociatorNames( CMPIAssociationMI * mi,
- CMPIContext * ctx,
- CMPIResult * rslt,
- CMPIObjectPath * cop,
- char * assocClass,
- char * resultClass,
- char * role,
- char * resultRole) {
+ const CMPIContext * ctx,
+ const CMPIResult * rslt,
+ const CMPIObjectPath * cop,
+ const char * assocClass,
+ const char * resultClass,
+ const char * role,
+ const char * resultRole) {
CMPIStatus rc = {CMPI_RC_OK, NULL};
CMPIObjectPath * op = NULL;
if( _debug )
- fprintf( stderr, "--- %s.c : CMPI AssociatorNames()\n", _ClassName );
-
+ fprintf( stderr, "--- %s.c : CMPI AssociatorNames()\n", _ClassName );
+
if( assocClass ) {
op = CMNewObjectPath( _broker, CMGetCharPtr(CMGetNameSpace(cop,&rc)),
_ClassName, &rc );
@@ -379,11 +383,11 @@ CMPIStatus Linux_BIOSProductBIOSFeaturesAssociatorNames( CMPIAssociationMI * mi,
if( ( assocClass==NULL ) || ( CMClassPathIsA(_broker,op,assocClass,&rc) == 1 ) ) {
if (CMClassPathIsA(_broker,cop,_RefLeftClass,&rc)) {
/* source is left hand side - retrieve right hand side */
- CMPIObjectPath *copRight =
+ CMPIObjectPath *copRight =
CMNewObjectPath(_broker,CMGetCharPtr(CMGetNameSpace(cop,&rc)),
_RefRightClass, &rc);
if (copRight) {
- CMPIEnumeration *enm =
+ CMPIEnumeration *enm =
CBEnumInstanceNames(_broker,ctx,copRight,&rc);
if (enm) {
while(CMHasNext(enm,&rc)) {
@@ -397,11 +401,11 @@ CMPIStatus Linux_BIOSProductBIOSFeaturesAssociatorNames( CMPIAssociationMI * mi,
}
} else if (CMClassPathIsA(_broker,cop,_RefRightClass,&rc)) {
/* source is right hand side - retrieve left hand side */
- CMPIObjectPath *copLeft =
+ CMPIObjectPath *copLeft =
CMNewObjectPath(_broker,CMGetCharPtr(CMGetNameSpace(cop,&rc)),
_RefLeftClass, &rc);
if (copLeft) {
- CMPIEnumeration *enm =
+ CMPIEnumeration *enm =
CBEnumInstanceNames(_broker,ctx,copLeft,&rc);
if (enm) {
while(CMHasNext(enm,&rc)) {
@@ -424,57 +428,57 @@ CMPIStatus Linux_BIOSProductBIOSFeaturesAssociatorNames( CMPIAssociationMI * mi,
/*
* specification of references() and referenceNames()
*
- * These methods return CMPIInstance ( in the case of references() ) or
- * CMPIObjectPath ( in the case of referenceNames() ) object(s) of th
+ * These methods return CMPIInstance ( in the case of references() ) or
+ * CMPIObjectPath ( in the case of referenceNames() ) object(s) of th
* association itself.
*/
CMPIStatus Linux_BIOSProductBIOSFeaturesReferences( CMPIAssociationMI * mi,
- CMPIContext * ctx,
- CMPIResult * rslt,
- CMPIObjectPath * cop,
- char * assocClass,
- char * role,
- char ** propertyList ) {
+ const CMPIContext * ctx,
+ const CMPIResult * rslt,
+ const CMPIObjectPath * cop,
+ const char * assocClass,
+ const char * role,
+ const char ** propertyList ) {
CMPIStatus rc = {CMPI_RC_OK, NULL};
CMPIObjectPath * op = NULL;
if( _debug )
- fprintf( stderr, "--- %s.c : CMPI References()\n", _ClassName );
-
+ fprintf( stderr, "--- %s.c : CMPI References()\n", _ClassName );
+
op = CMNewObjectPath( _broker, CMGetCharPtr(CMGetNameSpace(cop,&rc)),
_ClassName, &rc );
-
+
if( ( assocClass==NULL ) || ( CMClassPathIsA(_broker,op,assocClass,&rc) == 1 ) ) {
- if (CMClassPathIsA(_broker,cop,_RefLeftClass,&rc) ||
+ if (CMClassPathIsA(_broker,cop,_RefLeftClass,&rc) ||
CMClassPathIsA(_broker,cop,_RefRightClass,&rc) ) {
return Linux_BIOSProductBIOSFeaturesEnumInstances((CMPIInstanceMI*)mi,
ctx,rslt,op,
propertyList);
}
-
+
}
-
+
CMReturnDone( rslt );
CMReturn(CMPI_RC_OK);
}
CMPIStatus Linux_BIOSProductBIOSFeaturesReferenceNames( CMPIAssociationMI * mi,
- CMPIContext * ctx,
- CMPIResult * rslt,
- CMPIObjectPath * cop,
- char * assocClass,
- char * role) {
+ const CMPIContext * ctx,
+ const CMPIResult * rslt,
+ const CMPIObjectPath * cop,
+ const char * assocClass,
+ const char * role) {
CMPIStatus rc = {CMPI_RC_OK, NULL};
CMPIObjectPath * op = NULL;
if( _debug )
- fprintf( stderr, "--- %s.c : CMPI ReferenceNames()\n", _ClassName );
-
+ fprintf( stderr, "--- %s.c : CMPI ReferenceNames()\n", _ClassName );
+
op = CMNewObjectPath( _broker, CMGetCharPtr(CMGetNameSpace(cop,&rc)),
_ClassName, &rc );
if( ( assocClass==NULL ) || ( CMClassPathIsA(_broker,op,assocClass,&rc) == 1 ) ) {
- if (CMClassPathIsA(_broker,cop,_RefLeftClass,&rc) ||
+ if (CMClassPathIsA(_broker,cop,_RefLeftClass,&rc) ||
CMClassPathIsA(_broker,cop,_RefRightClass,&rc) ) {
return Linux_BIOSProductBIOSFeaturesEnumInstanceNames((CMPIInstanceMI*)mi,
ctx,rslt,op);
--
2.48.1