Changeset 3390

Show
Ignore:
Timestamp:
02/24/10 09:32:23 (7 months ago)
Author:
kkaempf
Message:

access CMPIString through macro, not by casted member access

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • openwsman/trunk/src/plugins/cim/sfcc-interface.c

    r3379 r3390  
    192192                        WSA_REFERENCE_PARAMETERS, 
    193193                        NULL); 
    194         _path_res_uri = cim_find_namespace_for_class(client, NULL, 
    195                         (char *) classname->hdl); 
     194        _path_res_uri = cim_find_namespace_for_class(client, NULL, CMGetCharPtr(classname)); 
    196195        ws_xml_add_child_format(refparam, XML_NS_WS_MAN, WSM_RESOURCE_URI, 
    197196                        "%s", _path_res_uri); 
     
    211210                s = ws_xml_add_child(wsman_selector_set, XML_NS_WS_MAN, 
    212211                                WSM_SELECTOR, cv ); 
    213                 ws_xml_add_node_attr(s, NULL, "Name", (char *) keyname->hdl); 
     212                ws_xml_add_node_attr(s, NULL, "Name", CMGetCharPtr(keyname)); 
    214213                if (cv) 
    215214                        u_free(cv); 
     
    217216                        CMRelease(keyname); 
    218217        } 
    219         if (namespace->hdl != NULL) { 
     218        if (CMGetCharPtr(namespace) != NULL) { 
    220219                cimns = ws_xml_add_child(wsman_selector_set, 
    221220                                XML_NS_WS_MAN, WSM_SELECTOR, 
    222                                 (char *) namespace->hdl); 
     221                                CMGetCharPtr(namespace)); 
    223222                ws_xml_add_node_attr(cimns, NULL, "Name", 
    224223                                CIM_NAMESPACE_SELECTOR); 
     
    684683                class->ft->getPropertyAt(class, i, &propertyname, NULL); 
    685684                data = class->ft->getPropertyQualifier(class, 
    686                                 (char *) propertyname-> 
    687                                 hdl, "Key", &rc); 
     685                                CMGetCharPtr(propertyname), "Key", &rc); 
    688686                if ((data.state != CMPI_nullValue) && (data.value.boolean)) { 
    689687                        ccount++; 
     
    767765        opcount = CMGetKeyCount(objectpath, &rc); 
    768766        debug("getKeyCount rc=%d, msg=%s", 
    769                         rc.rc, (rc.msg) ? (char *) rc.msg->hdl : NULL); 
     767                        rc.rc, (rc.msg) ? CMGetCharPtr(rc.msg) : NULL); 
    770768 
    771769 
     
    830828cleanup: 
    831829        debug("getKey rc=%d, msg=%s", 
    832                         rc.rc, (rc.msg) ? (char *) rc.msg->hdl : NULL); 
     830                        rc.rc, (rc.msg) ? CMGetCharPtr(rc.msg) : NULL); 
    833831        return statusP->fault_code; 
    834832} 
     
    850848 
    851849        debug("getClass() rc=%d, msg=%s", 
    852                         rc.rc, (rc.msg) ? (char *) rc.msg->hdl : "<NULL>"); 
     850                        rc.rc, (rc.msg) ? CMGetCharPtr(rc.msg) : "<NULL>"); 
    853851        cim_to_wsman_status(rc, status); 
    854852        if (op) 
     
    904902        classname = objectpath->ft->getClassName(objectpath, NULL); 
    905903        class_namespace = cim_find_namespace_for_class(client, enumInfo, 
    906                         (char *) classname->hdl); 
     904                        CMGetCharPtr(classname)); 
    907905 
    908906        final_class = u_strdup(strrchr(class_namespace, '/') + 1); 
     
    935933                        _class->ft->getPropertyAt(_class, i, &propertyname, 
    936934                                        NULL); 
    937                         data = instance->ft->getProperty(instance, (char *) propertyname->hdl
     935                        data = instance->ft->getProperty(instance, CMGetCharPtr(propertyname)
    938936                                        NULL); 
    939937                } else { 
     
    942940                                        NULL); 
    943941                } 
    944                 if(propertystr && strcmp(propertystr, propertyname->hdl)) { 
     942                if(propertystr && strcmp(propertystr, CMGetCharPtr(propertyname))) { 
    945943                        CMRelease(propertyname); 
    946944                        continue; 
    947945                } 
    948                 objectpath->ft->getKey(objectpath, (char *) propertyname->hdl, &is_key); 
    949                 property2xml(client, &data, (char *) propertyname->hdl, xmlr, 
     946                objectpath->ft->getKey(objectpath, CMGetCharPtr(propertyname), &is_key); 
     947                property2xml(client, &data, CMGetCharPtr(propertyname), xmlr, 
    950948                                class_namespace, frag_type, is_key.rc); 
    951949                CMRelease(propertyname); 
     
    10031001                        &rc); 
    10041002        debug("enumInstanceNames rc=%d, msg=%s", rc.rc, 
    1005                         (rc.msg) ? (char *) rc.msg->hdl : NULL); 
     1003                        (rc.msg) ? CMGetCharPtr(rc.msg) : NULL); 
    10061004 
    10071005        if (rc.rc != 0) { 
     
    10211019                        CMPIObjectPath *op = CMClone(data.value.ref, NULL); 
    10221020                        CMPIString *opstr = CMObjectPathToString(op, NULL); 
    1023                         debug("objectpath: %s", (char *) opstr->hdl); 
     1021                        debug("objectpath: %s", CMGetCharPtr(opstr)); 
    10241022                        if (cim_verify_keys(op, client->selectors, statusP) != 0) { 
    10251023                                if (opstr) 
     
    11321130 
    11331131        debug("enumInstances() rc=%d, msg=%s", 
    1134                         rc.rc, (rc.msg) ? (char *) rc.msg->hdl : NULL); 
     1132                        rc.rc, (rc.msg) ? CMGetCharPtr(rc.msg) : NULL); 
    11351133 
    11361134        if (rc.rc) { 
     
    11971195 
    11981196        if (enumInfo && (enumInfo->flags & WSMAN_ENUMINFO_POLY_NONE ) && 
    1199                         (strcmp((char *) classname->hdl, client->requested_class) != 0)) { 
     1197                        (strcmp(CMGetCharPtr(classname), client->requested_class) != 0)) { 
    12001198                retval = 0; 
    12011199        } 
     
    12351233 
    12361234        if (enumInfo && (enumInfo->flags & WSMAN_ENUMINFO_POLY_NONE) 
    1237                         && (strcmp((char *) classname->hdl, client->requested_class) != 0)) { 
     1235                        && (strcmp(CMGetCharPtr(classname), client->requested_class) != 0)) { 
    12381236                retval = 0; 
    12391237        } 
    1240         uri = cim_find_namespace_for_class(client, enumInfo, 
    1241                         (char *) classname->hdl); 
     1238        uri = cim_find_namespace_for_class(client, enumInfo, CMGetCharPtr(classname)); 
    12421239        if (retval) { 
    12431240                cim_add_epr(client, itemsNode, uri, objectpath); 
     
    12691266 
    12701267        if (enumInfo && (enumInfo->flags & WSMAN_ENUMINFO_POLY_NONE) && 
    1271                         (strcmp((char *) classname->hdl, client->requested_class) != 0)) { 
     1268                        (strcmp(CMGetCharPtr(classname), client->requested_class) != 0)) { 
    12721269                retval = 0; 
    12731270        } 
    1274         uri = cim_find_namespace_for_class(client, enumInfo, 
    1275                         (char *) classname->hdl); 
     1271        uri = cim_find_namespace_for_class(client, enumInfo, CMGetCharPtr(classname)); 
    12761272 
    12771273        if (retval) { 
     
    13181314                                i, &propertyname, 
    13191315                                NULL); 
    1320                 debug("working on property: %s", (char *) propertyname->hdl ); 
     1316                debug("working on property: %s", CMGetCharPtr(propertyname) ); 
    13211317                if(fragment_flag == 0) { 
    13221318                        child = ws_xml_get_child(resource, 0, resource_uri, 
    1323                                         (char *) propertyname->hdl); 
     1319                                        CMGetCharPtr(propertyname)); 
    13241320                        if (child) { 
    13251321                                value = ws_xml_get_node_text(child); 
     
    13351331                                if (value) { 
    13361332                                        xml2property(instance, &data, 
    1337                                                         (char *) propertyname->hdl
     1333                                                        CMGetCharPtr(propertyname)
    13381334                                                        value); 
    13391335                                } 
     
    13501346                } 
    13511347                else { 
    1352                         if(strcmp(element, (char *) propertyname->hdl ) == 0) { 
     1348                        if(strcmp(element, CMGetCharPtr(propertyname) ) == 0) { 
    13531349                          debug("release %s", element); 
    13541350                                CMRelease(propertyname); 
     
    14101406 
    14111407        numproperties = instance->ft->getPropertyCount(instance, NULL); 
    1412         r = ws_xml_get_child(body, 0, resourceUri,(char *) classname->hdl); 
     1408        r = ws_xml_get_child(body, 0, resourceUri, CMGetCharPtr(classname)); 
    14131409 
    14141410        if (numproperties) { 
     
    14271423                        if (value) { 
    14281424                                xml2property(instance, &data, 
    1429                                                 (char *) propertyname->hdl
     1425                                                CMGetCharPtr(propertyname)
    14301426                                                value); 
    14311427                        } 
     
    14721468                CMPIString * cim_namespace = objectpath->ft->getNameSpace(objectpath, NULL); 
    14731469                char *str_namespace = client->cim_namespace; 
    1474                 if (NULL != cim_namespace && NULL != cim_namespace->hdl) { 
    1475                         str_namespace = (char *)cim_namespace->hdl
     1470                if (NULL != cim_namespace && NULL != CMGetCharPtr(cim_namespace)) { 
     1471                        str_namespace = CMGetCharPtr(cim_namespace)
    14761472                } 
    14771473                if (str_namespace != NULL) { 
     
    15071503                                free(valuestr); 
    15081504                } 
    1509                 ws_xml_add_node_attr(s, NULL, WSM_NAME, 
    1510                                 (char *) keyname->hdl); 
     1505                ws_xml_add_node_attr(s, NULL, WSM_NAME, CMGetCharPtr(keyname)); 
    15111506 
    15121507 
     
    17331728           
    17341729                        debug("invokeMethod(%s) rc=%d, msg=%s", 
    1735                                 client->method, rc.rc, (rc.msg) ? (char *) rc.msg->hdl : "<NULL>"); 
     1730                                client->method, rc.rc, (rc.msg) ? CMGetCharPtr(rc.msg) : "<NULL>"); 
    17361731 
    17371732                        method_node = ws_xml_add_empty_child_format(body, 
     
    17541749                                        data = CMGetArgAt(argsout, i, &argname, NULL); 
    17551750                                        property2xml(client, &data, 
    1756                                                         (char *) argname->hdl
     1751                                                        CMGetCharPtr(argname)
    17571752                                                        method_node, client->resource_uri, 0, 0); 
    17581753                                        CMRelease(argname); 
     
    17991794                } 
    18001795                debug("deleteInstance rc=%d, msg=%s", rc.rc, 
    1801                                 (rc.msg) ? (char *) rc.msg->hdl : NULL); 
     1796                                (rc.msg) ? CMGetCharPtr(rc.msg) : NULL); 
    18021797        } 
    18031798 
     
    18411836                } 
    18421837                debug("getInstance rc=%d, msg=%s", rc.rc, 
    1843                                 (rc.msg) ? (char *) rc.msg->hdl : NULL); 
     1838                                (rc.msg) ? CMGetCharPtr(rc.msg) : NULL); 
    18441839                if (instance) 
    18451840                        CMRelease(instance); 
     
    19071902        if (status->fault_code == 0 && instance ) { 
    19081903                CMPIString *opstr = CMObjectPathToString(objectpath, NULL); 
    1909                 debug("objectpath: %s", (char *)opstr->hdl ); 
     1904                debug("objectpath: %s", CMGetCharPtr(opstr) ); 
    19101905                rc = cc->ft->setInstance(cc, objectpath, instance, 0, NULL); 
    19111906                debug("modifyInstance() rc=%d, msg=%s", rc.rc, 
    1912                                 (rc.msg) ? (char *) rc.msg-> hdl : NULL); 
     1907                                (rc.msg) ? (char *) CMGetCharPtr(rc.msg) : NULL); 
    19131908                if (rc.rc == CMPI_RC_ERR_FAILED) { 
    19141909                        status->fault_code = 
     
    19941989                /* retrieve property type (in data) and name (in propertyname) */ 
    19951990                CMPIData data = class->ft->getPropertyAt(class, i, &propertyname, NULL); 
    1996                 class->ft->getPropertyQualifier(class, (char *) propertyname->hdl, "KEY", &rc); 
     1991                class->ft->getPropertyQualifier(class, CMGetCharPtr(propertyname), "KEY", &rc); 
    19971992 
    19981993                if (rc.rc == 0 
     
    20001995                    && !ws_xml_get_child(resource, 0, 
    20011996                                        resource_xsd ? resource_xsd : client->resource_uri, 
    2002                                         (char *) propertyname->hdl)) { 
     1997                                        CMGetCharPtr(propertyname))) { 
    20031998                        debug("WXF_INVALID_REPRESENTATION"); 
    2004                         debug("No <%s:%s>", resource_xsd ? resource_xsd : client->resource_uri,(char *) propertyname->hdl); 
     1999                        debug("No <%s:%s>", resource_xsd ? resource_xsd : client->resource_uri, CMGetCharPtr(propertyname)); 
    20052000                        status->fault_code = WXF_INVALID_REPRESENTATION; 
    20062001                        status->fault_detail_code = WSMAN_DETAIL_MISSING_VALUES; 
     
    20092004                        if(fragstr == NULL) { 
    20102005                                child = ws_xml_get_child(resource, 0, 
    2011                                                          resource_xsd ? resource_xsd : client->resource_uri, (char *)propertyname->hdl); 
     2006                                                         resource_xsd ? resource_xsd : client->resource_uri, CMGetCharPtr(propertyname)); 
    20122007                        } 
    20132008                        else { 
    2014                                 if(strcmp(element, (char *)propertyname->hdl)) { 
     2009                                if(strcmp(element, CMGetCharPtr(propertyname))) { 
    20152010                                        CMRelease(propertyname); 
    20162011                                        continue; 
     
    20212016 
    20222017                        /* assemble objectpath, passing value with correct type */ 
    2023                         xml2objectpath(objectpath, &data, (char *) propertyname->hdl, ws_xml_get_node_text(child)); 
    2024  
    2025                         if(fragstr && strcmp(element, (char *)propertyname->hdl) == 0) { 
     2018                        xml2objectpath(objectpath, &data, CMGetCharPtr(propertyname), ws_xml_get_node_text(child)); 
     2019 
     2020                        if(fragstr && strcmp(element, CMGetCharPtr(propertyname)) == 0) { 
    20262021                          debug("fragstr, early break"); 
    20272022                                CMRelease(propertyname); 
     
    20522047                objectpath_r = cc->ft->createInstance(cc, objectpath, instance, &rc); 
    20532048                debug("createInstance() rc=%d, msg=%s", rc.rc, 
    2054                                 (rc.msg) ? (char *) rc.msg->hdl : NULL); 
     2049                                (rc.msg) ? CMGetCharPtr(rc.msg) : NULL); 
    20552050                if (objectpath_r) { 
    20562051                        WsXmlNodeH epr = ws_xml_add_child(body, XML_NS_TRANSFER, 
     
    21062101        /* Print the results */ 
    21072102        debug("deleteInstance() rc=%d, msg=%s", 
    2108                         rc.rc, (rc.msg) ? (char *) rc.msg->hdl : NULL); 
     2103                        rc.rc, (rc.msg) ? CMGetCharPtr(rc.msg) : NULL); 
    21092104        cim_to_wsman_status(rc, status); 
    21102105        if (rc.msg) 
     
    21482143        /* Print the results */ 
    21492144        debug("getInstance() rc=%d, msg=%s", 
    2150                         rc.rc, (rc.msg) ? (char *) rc.msg->hdl : NULL); 
     2145                        rc.rc, (rc.msg) ? CMGetCharPtr(rc.msg) : NULL); 
    21512146        cim_to_wsman_status(rc, status); 
    21522147        if (rc.msg) 
     
    22642259        /* Print the results */ 
    22652260        debug("create CIM_IndicationFilter() rc=%d, msg=%s", 
    2266                         rc.rc, (rc.msg) ? (char *) rc.msg->hdl : NULL); 
     2261                        rc.rc, (rc.msg) ? CMGetCharPtr(rc.msg) : NULL); 
    22672262        if (rc.rc == CMPI_RC_ERR_FAILED) { 
    22682263                status->fault_code = WSA_ACTION_NOT_SUPPORTED; 
     
    23292324        /* Print the results */ 
    23302325        debug("create CIM_IndicationHandlerCIMXML() rc=%d, msg=%s", 
    2331                         rc.rc, (rc.msg) ? (char *) rc.msg->hdl : NULL); 
     2326                        rc.rc, (rc.msg) ? CMGetCharPtr(rc.msg) : NULL); 
    23322327        if (rc.rc == CMPI_RC_ERR_FAILED) { 
    23332328                status->fault_code = WSA_ACTION_NOT_SUPPORTED; 
     
    23932388        /* Print the results */ 
    23942389        debug("create CIM_IndicationSubscription() rc=%d, msg=%s", 
    2395                         rc.rc, (rc.msg) ? (char *) rc.msg->hdl : NULL); 
     2390                        rc.rc, (rc.msg) ? CMGetCharPtr(rc.msg) : NULL); 
    23962391        if (rc.rc == CMPI_RC_ERR_FAILED) { 
    23972392                status->fault_code = WSA_ACTION_NOT_SUPPORTED; 
     
    24532448        } 
    24542449        debug("cim_update_indication_subscription() rc=%d, msg=%s", 
    2455                         rc.rc, (rc.msg) ? (char *) rc.msg->hdl : NULL); 
     2450                        rc.rc, (rc.msg) ? CMGetCharPtr(rc.msg) : NULL); 
    24562451        if (rc.msg) 
    24572452                CMRelease(rc.msg); 
     
    25142509        } 
    25152510        debug("cim_delete_indication_subscription() rc=%d, msg=%s", 
    2516                         rc.rc, (rc.msg) ? (char *) rc.msg->hdl : NULL); 
     2511                        rc.rc, (rc.msg) ? CMGetCharPtr(rc.msg) : NULL); 
    25172512        if (rc.msg) 
    25182513                CMRelease(rc.msg); 
     
    25422537                break; 
    25432538        case CMPI_RC_ERR_FAILED: 
    2544                 if (rc.msg && strcmp((char *) rc.msg->hdl, "CURL error: 7") == 0) 
     2539                if (rc.msg && strcmp(CMGetCharPtr(rc.msg), "CURL error: 7") == 0) 
    25452540                        status->fault_code = WSA_DESTINATION_UNREACHABLE; 
    25462541                else 
     
    26382633        enumeration = cc->ft->enumInstanceNames(cc, objectpath, &rc); 
    26392634        debug("enumInstanceNames() rc=%d, msg=%s", 
    2640                         rc.rc, (rc.msg) ? (char *) rc.msg->hdl : NULL); 
     2635                        rc.rc, (rc.msg) ? CMGetCharPtr(rc.msg) : NULL); 
    26412636 
    26422637        if (rc.rc) {