From: Adrian S. <a3s...@us...> - 2005-06-20 15:04:28
|
Update of /cvsroot/sblim/sfcc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30283 Modified Files: cimXmlParser.c cimXmlParser.h cimXmlResp.c cimXmlResp.h cimXmlResp.y client.c test.c Log Message: Added VALUE.OBJECTWITHPATH support for execQuery Fixed some problems in test.c Index: cimXmlParser.h =================================================================== RCS file: /cvsroot/sblim/sfcc/cimXmlParser.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- cimXmlParser.h 13 Jun 2005 23:50:46 -0000 1.2 +++ cimXmlParser.h 20 Jun 2005 15:04:18 -0000 1.3 @@ -143,8 +143,6 @@ } XtokKeyBinding; - - typedef struct xtokQualifier { struct xtokQualifier *next; char *name; @@ -200,6 +198,11 @@ XtokInstance instance; } XtokNamedInstance; +typedef struct xtokObjectWithPath { + XtokInstancePath path; + XtokInstance instance; +} XtokObjectWithPath; + typedef struct xtokPropertyList { XtokValueArray list; } XtokPropertyList; Index: cimXmlResp.c =================================================================== RCS file: /cvsroot/sblim/sfcc/cimXmlResp.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- cimXmlResp.c 13 Jun 2005 23:50:46 -0000 1.3 +++ cimXmlResp.c 20 Jun 2005 15:04:18 -0000 1.4 @@ -118,14 +118,16 @@ ZTOK_CLASS = 320, XTOK_INSTANCE = 321, ZTOK_INSTANCE = 322, - XTOK_PARAMVALUE = 323, - ZTOK_PARAMVALUE = 324, - XTOK_INSTANCEPATH = 325, - ZTOK_INSTANCEPATH = 326, - XTOK_LOCALINSTANCEPATH = 327, - ZTOK_LOCALINSTANCEPATH = 328, - XTOK_LOCALCLASSPATH = 329, - ZTOK_LOCALCLASSPATH = 330 [...1082 lines suppressed...] { yyval.xtokKeyBinding.name=yyvsp[-2].xtokKeyBinding.name; yyval.xtokKeyBinding.value=NULL; @@ -2013,7 +2062,7 @@ } /* Line 999 of yacc.c. */ -#line 2016 "cimXmlResp.c" +#line 2065 "cimXmlResp.c" yyvsp -= yylen; yyssp -= yylen; @@ -2207,6 +2256,6 @@ } -#line 961 "cimXmlResp.y" +#line 1004 "cimXmlResp.y" Index: client.c =================================================================== RCS file: /cvsroot/sblim/sfcc/client.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- client.c 20 Jun 2005 06:05:32 -0000 1.13 +++ client.c 20 Jun 2005 15:04:18 -0000 1.14 @@ -864,12 +864,13 @@ return NULL; } - if (rh.rvArray->ft->getSimpleType(rh.rvArray,NULL) == CMPI_ref) { + int rv; + if ((rv=rh.rvArray->ft->getSimpleType(rh.rvArray,NULL)) == CMPI_instance) { CMPIEnumeration *enm = newCMPIEnumeration(rh.rvArray,NULL); CMSetStatus(rc, CMPI_RC_OK); return enm; } - + fprintf(stderr,"rv: %x %d\n",rv,rv); CMSetStatusWithChars(rc,CMPI_RC_ERR_FAILED,"Unexpected return value"); return NULL; } Index: cimXmlParser.c =================================================================== RCS file: /cvsroot/sblim/sfcc/cimXmlParser.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- cimXmlParser.c 13 Jun 2005 23:50:46 -0000 1.2 +++ cimXmlParser.c 20 Jun 2005 15:04:18 -0000 1.3 @@ -737,6 +737,21 @@ return 0; } +static int procValueObjectWithPath(YYSTYPE * lvalp, ParserControl * parm) +{ + static XmlElement elm[] = { + {NULL} + }; + XmlAttr attr[1]; + if (tagEquals(parm->xmb, "VALUE.OBJECTWITHPATH")) { + if (attrsOk(parm->xmb, elm, attr, "VALUE.OBJECTWITHPATH", + XTOK_VALUEOBJECTWITHPATH)) { + return XTOK_VALUEOBJECTWITHPATH; + } + } + return 0; +} + static int procQualifier(YYSTYPE * lvalp, ParserControl * parm) { static XmlElement elm[] = { {"NAME"}, @@ -1050,6 +1065,7 @@ {"VALUE.ARRAY", procValueArray, ZTOK_VALUEARRAY}, {"VALUE.NAMEDINSTANCE", procValueNamedInstance, ZTOK_VALUENAMEDINSTANCE}, {"VALUE.REFERENCE", procValueReference, ZTOK_VALUEREFERENCE}, + {"VALUE.OBJECTWITHPATH", procValueObjectWithPath, ZTOK_VALUEOBJECTWITHPATH}, {"VALUE", procValue, ZTOK_VALUE}, {"HOST", procHost, ZTOK_HOST}, {"KEYVALUE", procKeyValue, ZTOK_KEYVALUE}, Index: test.c =================================================================== RCS file: /cvsroot/sblim/sfcc/test.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- test.c 20 Jun 2005 06:04:52 -0000 1.9 +++ test.c 20 Jun 2005 15:04:18 -0000 1.10 @@ -418,12 +418,12 @@ enumeration = cc->ft->execQuery(cc, objectpath, query, "WQL", &status); /* Print the results */ - printf("enumInstanceNames() rc=%d, msg=%s\n", status.rc, (status.msg)? (char *)status.msg->hdl : NULL); + printf("execQuery() rc=%d, msg=%s\n", status.rc, (status.msg)? (char *)status.msg->hdl : NULL); if (!status.rc) { printf("result(s):\n"); while (enumeration->ft->hasNext(enumeration, NULL)) { CMPIData data = enumeration->ft->getNext(enumeration, NULL); - showObjectPath(data.value.ref); + showInstance(data.value.inst); } } if (enumeration) CMRelease(enumeration); Index: cimXmlResp.h =================================================================== RCS file: /cvsroot/sblim/sfcc/cimXmlResp.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- cimXmlResp.h 13 Jun 2005 23:50:46 -0000 1.3 +++ cimXmlResp.h 20 Jun 2005 15:04:18 -0000 1.4 @@ -94,14 +94,16 @@ ZTOK_CLASS = 320, XTOK_INSTANCE = 321, ZTOK_INSTANCE = 322, - XTOK_PARAMVALUE = 323, - ZTOK_PARAMVALUE = 324, - XTOK_INSTANCEPATH = 325, - ZTOK_INSTANCEPATH = 326, - XTOK_LOCALINSTANCEPATH = 327, - ZTOK_LOCALINSTANCEPATH = 328, - XTOK_LOCALCLASSPATH = 329, - ZTOK_LOCALCLASSPATH = 330 + XTOK_VALUEOBJECTWITHPATH = 323, + ZTOK_VALUEOBJECTWITHPATH = 324, + XTOK_PARAMVALUE = 325, + ZTOK_PARAMVALUE = 326, + XTOK_INSTANCEPATH = 327, + ZTOK_INSTANCEPATH = 328, + XTOK_LOCALINSTANCEPATH = 329, + ZTOK_LOCALINSTANCEPATH = 330, + XTOK_LOCALCLASSPATH = 331, + ZTOK_LOCALCLASSPATH = 332 }; #endif #define XTOK_XML 258 @@ -169,14 +171,16 @@ #define ZTOK_CLASS 320 #define XTOK_INSTANCE 321 #define ZTOK_INSTANCE 322 -#define XTOK_PARAMVALUE 323 -#define ZTOK_PARAMVALUE 324 -#define XTOK_INSTANCEPATH 325 -#define ZTOK_INSTANCEPATH 326 -#define XTOK_LOCALINSTANCEPATH 327 -#define ZTOK_LOCALINSTANCEPATH 328 -#define XTOK_LOCALCLASSPATH 329 -#define ZTOK_LOCALCLASSPATH 330 +#define XTOK_VALUEOBJECTWITHPATH 323 +#define ZTOK_VALUEOBJECTWITHPATH 324 +#define XTOK_PARAMVALUE 325 +#define ZTOK_PARAMVALUE 326 +#define XTOK_INSTANCEPATH 327 +#define ZTOK_INSTANCEPATH 328 +#define XTOK_LOCALINSTANCEPATH 329 +#define ZTOK_LOCALINSTANCEPATH 330 +#define XTOK_LOCALCLASSPATH 331 +#define ZTOK_LOCALCLASSPATH 332 @@ -203,7 +207,7 @@ XtokValue xtokValue; XtokValueArray xtokValueArray; XtokValueReference xtokValueReference; - + XtokObjectWithPath xtokObjectWithPath; XtokInstanceName xtokInstanceName; XtokKeyBinding xtokKeyBinding; XtokKeyBindings xtokKeyBindings; @@ -224,7 +228,7 @@ XtokParam xtokParam; } YYSTYPE; /* Line 1240 of yacc.c. */ -#line 227 "cimXmlResp.h" +#line 231 "cimXmlResp.h" # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_TRIVIAL 1 Index: cimXmlResp.y =================================================================== RCS file: /cvsroot/sblim/sfcc/cimXmlResp.y,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- cimXmlResp.y 13 Jun 2005 23:50:46 -0000 1.3 +++ cimXmlResp.y 20 Jun 2005 15:04:18 -0000 1.4 @@ -238,7 +238,7 @@ XtokValue xtokValue; XtokValueArray xtokValueArray; XtokValueReference xtokValueReference; - + XtokObjectWithPath xtokObjectWithPath; XtokInstanceName xtokInstanceName; XtokKeyBinding xtokKeyBinding; XtokKeyBindings xtokKeyBindings; @@ -384,6 +384,10 @@ %type <xtokInstance> instance %type <xtokInstanceData> instanceData +%token <xtokObjectWithPath> XTOK_VALUEOBJECTWITHPATH +%token <intValue> ZTOK_VALUEOBJECTWITHPATH +%type <xtokObjectWithPath> objectWithPath + //%type <xtokParamValue> paramValue %token <xtokParamValue> XTOK_PARAMVALUE %token <intValue> ZTOK_PARAMVALUE @@ -469,9 +473,6 @@ | XTOK_IRETVALUE valueObjectsWithPath ZTOK_IRETVALUE { } - | XTOK_IRETVALUE valueObjectsWithPath ZTOK_IRETVALUE - { - } | XTOK_IRETVALUE valueObjectsWithLocalPath ZTOK_IRETVALUE { } @@ -487,6 +488,9 @@ | XTOK_IRETVALUE valueRef ZTOK_IRETVALUE { } */ + | XTOK_IRETVALUE objectsWithPath ZTOK_IRETVALUE + { + } | XTOK_IRETVALUE classes ZTOK_IRETVALUE { } @@ -497,7 +501,9 @@ { } */ ; - + + + classes : /* empty */ | class @@ -521,7 +527,7 @@ | instance { PARM->curInstance=native_new_CMPIInstance(NULL,NULL); - setInstNsAndCn(PARM->curInstance,$1.className,PARM->nameSpace); + setInstNsAndCn(PARM->curInstance,PARM->nameSpace,$1.className); setInstProperties(PARM->curInstance,&PARM->properties); simpleArrayAdd(PARM->respHdr.rvArray,(CMPIValue*)&PARM->curInstance,CMPI_instance); PARM->curInstance=NULL; @@ -529,7 +535,7 @@ | instances instance { PARM->curInstance=native_new_CMPIInstance(NULL,NULL); - setInstNsAndCn(PARM->curInstance,$2.className,PARM->nameSpace); + setInstNsAndCn(PARM->curInstance,PARM->nameSpace,$2.className); simpleArrayAdd(PARM->respHdr.rvArray,(CMPIValue*)&PARM->curInstance,CMPI_instance); PARM->curInstance=NULL; } @@ -544,12 +550,32 @@ } | instanceNames instanceName { - setInstNsAndCn(PARM->curInstance,$2.className,PARM->nameSpace); +// setInstNsAndCn(PARM->curInstance,PARM->nameSpace,$2.className); simpleArrayAdd(PARM->respHdr.rvArray,(CMPIValue*)&PARM->curPath,CMPI_ref); PARM->curPath=NULL; } ; +objectsWithPath + : /* empty */ + | objectWithPath + { + PARM->curInstance=native_new_CMPIInstance(NULL,NULL); + setInstNsAndCn(PARM->curInstance,PARM->nameSpace,$1.instance.className); + setInstProperties(PARM->curInstance,&PARM->properties); + simpleArrayAdd(PARM->respHdr.rvArray,(CMPIValue*)&PARM->curInstance,CMPI_instance); + PARM->curInstance=NULL; + } + | objectsWithPath objectWithPath + { + PARM->curInstance=native_new_CMPIInstance(NULL,NULL); + setInstNsAndCn(PARM->curInstance,PARM->nameSpace,$2.instance.className); + simpleArrayAdd(PARM->respHdr.rvArray,(CMPIValue*)&PARM->curInstance,CMPI_instance); + PARM->curInstance=NULL; + } +; + + /* * valueNamedInstance */ @@ -564,6 +590,20 @@ /* + * objectWithPath +*/ + +objectWithPath + : XTOK_VALUEOBJECTWITHPATH instancePath instance ZTOK_VALUEOBJECTWITHPATH + { + $$.path=$2; + $$.instance=$3; + } +; + + + +/* * class */ @@ -900,6 +940,7 @@ ; + /* * instanceName */ @@ -912,12 +953,14 @@ $$.bindings.next=0; $$.bindings.keyBindings=NULL; PARM->curPath=NULL; + fprintf(stderr,"### instanceName 0\n"); } | XTOK_INSTANCENAME keyBindings ZTOK_INSTANCENAME { $$.className=$1.className; $$.bindings=$2; createPath(&(PARM->curPath), &$$); + fprintf(stderr,"### instanceName 1\n"); } ; |