Skip to content

Commit

Permalink
[ 1379315 ] sfcb CMPI version outdated. Changed a bunch of function s…
Browse files Browse the repository at this point in the history
…ignatures

to achieve better CMPI 1.0 compliance. There are still a couple of warnings to
investigate.
  • Loading branch information
mihajlov committed Dec 13, 2005
1 parent 383c91b commit 74a635e
Show file tree
Hide file tree
Showing 38 changed files with 1,159 additions and 964 deletions.
4 changes: 2 additions & 2 deletions Makefile.am
@@ -1,4 +1,4 @@
# $Id: Makefile.am,v 1.40 2005/11/20 17:43:54 bestorga-oss Exp $
# $Id: Makefile.am,v 1.41 2005/12/13 08:56:48 mihajlov Exp $
#
# Makefile.am
#
Expand Down Expand Up @@ -222,7 +222,7 @@ noinst_HEADERS=array.h httpComm.h control.h providerMgr.h \
cimXmlRequest.h genericlist.h objectImpl.h trace.h \
hashtable.h utilft.h mlog.h \
cmpidt.h cmpift.h cmpiftx.h cmpimacs.h cmpimacsx.h cmpios.h \
fileRepository.h \
fileRepository.h internalProvider.h \
selectexp.h queryOperation.h \
sfcVersion.h mrwlock.h sqlStatement.h avltree.h

Expand Down
12 changes: 6 additions & 6 deletions args.c
Expand Up @@ -72,7 +72,7 @@ static CMPIStatus __aft_release(CMPIArgs * args)
}


static CMPIArgs *__aft_clone(CMPIArgs * args, CMPIStatus * rc)
static CMPIArgs *__aft_clone(const CMPIArgs * args, CMPIStatus * rc)
{
struct native_args *a = (struct native_args *) args;
struct native_args *na = __new_empty_args(MEM_NOT_TRACKED, rc);
Expand All @@ -85,8 +85,8 @@ static CMPIArgs *__aft_clone(CMPIArgs * args, CMPIStatus * rc)
}


static CMPIStatus __aft_addArg(CMPIArgs * args, const char *name,
CMPIValue * value, CMPIType type)
static CMPIStatus __aft_addArg(const CMPIArgs * args, const char *name,
const CMPIValue * value, CMPIType type)
{
ClArgs *ca = (ClArgs *) args->hdl;
CMPIData data = { type, CMPI_goodValue, {0} };
Expand All @@ -109,7 +109,7 @@ static CMPIStatus __aft_addArg(CMPIArgs * args, const char *name,
}


static CMPIData __aft_getArgAt(CMPIArgs * args,
static CMPIData __aft_getArgAt(const CMPIArgs * args,
unsigned int i,
CMPIString ** name, CMPIStatus * rc)
{
Expand Down Expand Up @@ -144,7 +144,7 @@ static CMPIData __aft_getArgAt(CMPIArgs * args,
return rv;
}

static CMPIData __aft_getArg(CMPIArgs * args, const char *name, CMPIStatus * rc)
static CMPIData __aft_getArg(const CMPIArgs * args, const char *name, CMPIStatus * rc)
{
ClArgs *ca = (ClArgs *) args->hdl;
ClSection *prps = &ca->properties;
Expand All @@ -161,7 +161,7 @@ static CMPIData __aft_getArg(CMPIArgs * args, const char *name, CMPIStatus * rc)
}


static unsigned int __aft_getArgCount(CMPIArgs * args, CMPIStatus * rc)
static unsigned int __aft_getArgCount(const CMPIArgs * args, CMPIStatus * rc)
{
ClArgs *ca = (ClArgs *) args->hdl;
if (rc)
Expand Down
16 changes: 8 additions & 8 deletions array.c
Expand Up @@ -75,7 +75,7 @@ static CMPIStatus __aft_release(CMPIArray * array)
}


static CMPIArray *__aft_clone(CMPIArray * array, CMPIStatus * rc)
static CMPIArray *__aft_clone(const CMPIArray * array, CMPIStatus * rc)
{
CMPIStatus tmp;
struct native_array *a = (struct native_array *) array;
Expand All @@ -102,7 +102,7 @@ static CMPIArray *__aft_clone(CMPIArray * array, CMPIStatus * rc)
}


static CMPICount __aft_getSize(CMPIArray * array, CMPIStatus * rc)
static CMPICount __aft_getSize(const CMPIArray * array, CMPIStatus * rc)
{
struct native_array *a = (struct native_array *) array;

Expand All @@ -112,7 +112,7 @@ static CMPICount __aft_getSize(CMPIArray * array, CMPIStatus * rc)
}


static CMPIType __aft_getSimpleType(CMPIArray * array, CMPIStatus * rc)
static CMPIType __aft_getSimpleType(const CMPIArray * array, CMPIStatus * rc)
{
struct native_array *a = (struct native_array *) array;

Expand All @@ -122,7 +122,7 @@ static CMPIType __aft_getSimpleType(CMPIArray * array, CMPIStatus * rc)
}


static CMPIData __aft_getElementAt(CMPIArray * array,
static CMPIData __aft_getElementAt(const CMPIArray * array,
CMPICount index, CMPIStatus * rc)
{
struct native_array *a = (struct native_array *) array;
Expand Down Expand Up @@ -187,7 +187,7 @@ static CMPIStatus __aft_setElementAt(CMPIArray * array,
CMReturn(CMPI_RC_ERR_FAILED);
}
*/
static CMPIStatus setElementAt ( CMPIArray * array, CMPICount index, CMPIValue * val,
static CMPIStatus setElementAt ( CMPIArray * array, CMPICount index, const CMPIValue * val,
CMPIType type, int opt )
{
struct native_array * a = (struct native_array *) array;
Expand Down Expand Up @@ -224,7 +224,7 @@ static CMPIStatus setElementAt ( CMPIArray * array, CMPICount index, CMPIValue *
CMReturn ( CMPI_RC_ERR_FAILED );
}

static CMPIStatus __aft_setElementAt ( CMPIArray * array, CMPICount index, CMPIValue * val,
static CMPIStatus __aft_setElementAt ( CMPIArray * array, CMPICount index, const CMPIValue * val,
CMPIType type )
{
return setElementAt(array,index,val,type,0);
Expand Down Expand Up @@ -265,7 +265,7 @@ CMPIStatus arraySetElementNotTrackedAt(CMPIArray * array,



void native_array_increase_size(CMPIArray * array, CMPICount increment)
void native_array_increase_size(const CMPIArray * array, CMPICount increment)
{
struct native_array *a = (struct native_array *) array;

Expand All @@ -280,7 +280,7 @@ void native_array_increase_size(CMPIArray * array, CMPICount increment)
}


void native_array_reset_size(CMPIArray * array, CMPICount increment)
void native_array_reset_size(const CMPIArray * array, CMPICount increment)
{
struct native_array *a = (struct native_array *) array;
a->size = increment;
Expand Down
100 changes: 48 additions & 52 deletions brokerEnc.c
Expand Up @@ -26,8 +26,8 @@
#include "constClass.h"
#include "utilft.h"

extern const char *opGetClassNameChars(CMPIObjectPath * cop);
extern const char *opGetNameSpaceChars(CMPIObjectPath * cop);
extern const char *opGetClassNameChars(const CMPIObjectPath * cop);
extern const char *opGetNameSpaceChars(const CMPIObjectPath * cop);
extern CMPIConstClass *getConstClass(const char *ns, const char *cn);
extern CMPIObjectPathFT *CMPI_ObjectPath_FT;
extern CMPIInstanceFT *CMPI_Instance_FT;
Expand All @@ -39,16 +39,16 @@ extern CMPISelectExp *TrackedCMPISelectExp(const char *queryString,



static CMPIInstance *__beft_newInstance(CMPIBroker * broker,
CMPIObjectPath * cop, CMPIStatus * rc)
static CMPIInstance *__beft_newInstance(const CMPIBroker * broker,
const CMPIObjectPath * cop, CMPIStatus * rc)
{
_SFCB_ENTER(TRACE_ENCCALLS,"newInstance");
CMPIInstance *inst=TrackedCMPIInstance(cop, rc);
_SFCB_RETURN(inst);
}


static CMPIObjectPath *__beft_newObjectPath(CMPIBroker * broker,
static CMPIObjectPath *__beft_newObjectPath(const CMPIBroker * broker,
const char *namespace,
const char *classname,
CMPIStatus * rc)
Expand All @@ -59,15 +59,15 @@ static CMPIObjectPath *__beft_newObjectPath(CMPIBroker * broker,
}


static CMPIArgs *__beft_newArgs(CMPIBroker * broker, CMPIStatus * rc)
static CMPIArgs *__beft_newArgs(const CMPIBroker * broker, CMPIStatus * rc)
{
_SFCB_ENTER(TRACE_ENCCALLS,"newArgs");
CMPIArgs *args=TrackedCMPIArgs(rc);
_SFCB_RETURN(args);
}


static CMPIString *__beft_newString(CMPIBroker * broker,
static CMPIString *__beft_newString(const CMPIBroker * broker,
const char *str, CMPIStatus * rc)
{
_SFCB_ENTER(TRACE_ENCCALLS,"newString");
Expand All @@ -76,7 +76,7 @@ static CMPIString *__beft_newString(CMPIBroker * broker,
}


static CMPIArray *__beft_newArray(CMPIBroker * broker,
static CMPIArray *__beft_newArray(const CMPIBroker * broker,
CMPICount size,
CMPIType type, CMPIStatus * rc)
{
Expand All @@ -86,15 +86,15 @@ static CMPIArray *__beft_newArray(CMPIBroker * broker,
}


static CMPIDateTime *__beft_newDateTime(CMPIBroker * broker, CMPIStatus * rc)
static CMPIDateTime *__beft_newDateTime(const CMPIBroker * broker, CMPIStatus * rc)
{
_SFCB_ENTER(TRACE_ENCCALLS,"newDateTime");
CMPIDateTime *dt=native_new_CMPIDateTime(rc);
_SFCB_RETURN(dt);
}


static CMPIDateTime *__beft_newDateTimeFromBinary(CMPIBroker * broker,
static CMPIDateTime *__beft_newDateTimeFromBinary(const CMPIBroker * broker,
CMPIUint64 time,
CMPIBoolean interval,
CMPIStatus * rc)
Expand All @@ -105,16 +105,16 @@ static CMPIDateTime *__beft_newDateTimeFromBinary(CMPIBroker * broker,
}


static CMPIDateTime *__beft_newDateTimeFromChars(CMPIBroker * broker,
char *string, CMPIStatus * rc)
static CMPIDateTime *__beft_newDateTimeFromChars(const CMPIBroker * broker,
const char *string, CMPIStatus * rc)
{
_SFCB_ENTER(TRACE_ENCCALLS,"newDateTimeFromChars");
CMPIDateTime *dt=native_new_CMPIDateTime_fromChars(string, rc);
_SFCB_RETURN(dt);
}


static CMPISelectExp *__beft_newSelectExp(CMPIBroker * broker,
static CMPISelectExp *__beft_newSelectExp(const CMPIBroker * broker,
const char *queryString,
const char *language,
CMPIArray ** projection,
Expand All @@ -126,8 +126,8 @@ static CMPISelectExp *__beft_newSelectExp(CMPIBroker * broker,
}


static CMPIBoolean __beft_classPathIsA(CMPIBroker * broker,
CMPIObjectPath * cop,
static CMPIBoolean __beft_classPathIsA(const CMPIBroker * broker,
const CMPIObjectPath * cop,
const char *type, CMPIStatus * rc)
{
CMPIConstClass *cc;
Expand Down Expand Up @@ -155,8 +155,8 @@ static CMPIBoolean __beft_classPathIsA(CMPIBroker * broker,
_SFCB_RETURN(0);
}

static CMPIString *__beft_toString(CMPIBroker * broker,
void *object, CMPIStatus * rc)
static CMPIString *__beft_toString(const CMPIBroker * broker,
const void *object, CMPIStatus * rc)
{
CMPIString *str;
_SFCB_ENTER(TRACE_ENCCALLS,"toString");
Expand All @@ -178,8 +178,8 @@ static CMPIString *__beft_toString(CMPIBroker * broker,
}


static CMPIBoolean __beft_isOfType(CMPIBroker * broker,
void *object,
static CMPIBoolean __beft_isOfType(const CMPIBroker * broker,
const void *object,
const char *type, CMPIStatus * rc)
{
char *t = *((char **) object);
Expand All @@ -191,54 +191,49 @@ static CMPIBoolean __beft_isOfType(CMPIBroker * broker,
}


static CMPIString *__beft_getType(CMPIBroker * broker,
void *object, CMPIStatus * rc)
static CMPIString *__beft_getType(const CMPIBroker * broker,
const void *object, CMPIStatus * rc)
{
_SFCB_ENTER(TRACE_ENCCALLS,"getType");
_SFCB_RETURN(__beft_newString(broker, *((char **) object), rc));
}


static CMPIString *__beft_getMessage(CMPIBroker * broker,
static CMPIString *__beft_getMessage(const CMPIBroker * broker,
const char *msgId, const char *defMsg,
CMPIStatus * rc, unsigned int count, ...)
{
CMPIStatus nrc;
CMPIString *msg;
va_list argptr;
va_start(argptr, count);

msg =
((NativeCMPIBrokerFT *) (broker->bft))->getMessage(broker, msgId,
defMsg, &nrc,
count, argptr);
if (rc)
*rc = nrc;
return msg;
if (rc) CMSetStatus(rc,CMPI_RC_ERR_NOT_SUPPORTED);
_SFCB_ENTER(TRACE_ENCCALLS,"getMessage");
_SFCB_TRACE(1,("This operation is not yet supported."));
_SFCB_RETURN(__beft_newString(broker,defMsg,NULL));
}

static CMPIStatus __beft_logMessage
(const CMPIBroker* broker,int severity ,const char *id,const char *text,
const CMPIString *string)
{
CMPIStatus rc = {CMPI_RC_ERR_NOT_SUPPORTED,NULL};
_SFCB_ENTER(TRACE_ENCCALLS,"logMessage");
_SFCB_TRACE(1,("This operation is not yet supported."));
_SFCB_RETURN(rc);
}

static CMPIArray *__beft_getKeyNames(CMPIBroker * broker,
CMPIContext * context,
CMPIObjectPath * cop, CMPIStatus * rc)
static CMPIStatus __beft_trace
(const CMPIBroker* broker, int level,const char *component,const char *text,
const CMPIString *string)
{
CMPIArray *ar;
CMPIConstClass *cc;

cc = (CMPIConstClass *)
getConstClass(opGetNameSpaceChars(cop), opGetClassNameChars(cop));
if (cc) {
ar=cc->ft->getKeyList(cc);
// cc->ft->release(cc);
return ar;
}
else return NewCMPIArray(0, CMPI_string, NULL);
CMPIStatus rc = {CMPI_RC_ERR_NOT_SUPPORTED,NULL};
_SFCB_ENTER(TRACE_ENCCALLS,"trace");
_SFCB_TRACE(1,("This operation is not yet supported."));
_SFCB_RETURN(rc);
}


CMPIArray *getKeyListAndVerifyPropertyList(CMPIObjectPath * cop,
char **props,
int *ok,
CMPIStatus * rc)
char **props,
int *ok,
CMPIStatus * rc)
{
CMPIArray *ar;
CMPIConstClass *cc;
Expand Down Expand Up @@ -272,7 +267,8 @@ CMPIBrokerEncFT native_brokerEncFT = {
__beft_isOfType,
__beft_getType,
__beft_getMessage,
__beft_getKeyNames,
__beft_logMessage,
__beft_trace
};

CMPIBrokerEncFT *BrokerEncFT = &native_brokerEncFT;
Expand Down

0 comments on commit 74a635e

Please sign in to comment.