/alps/pcitool

To get this branch, use:
bzr branch http://suren.me/webbzr/alps/pcitool

« back to all changes in this revision

Viewing changes to pcilib/xml.c

  • Committer: Suren A. Chilingaryan
  • Date: 2015-10-18 01:47:47 UTC
  • Revision ID: csa@suren.me-20151018014747-9ji2ygdhz1l9wnt5
Support properties of arbitrary type

Show diffs side-by-side

added added

removed removed

Lines of Context:
479
479
    xmlAttrPtr cur;
480
480
    const char *value, *name;
481
481
 
482
 
    desc->type = PCILIB_TYPE_STRING;
483
 
 
484
482
    for (cur = node->properties; cur != NULL; cur = cur->next) {
485
483
        if (!cur->children) continue;
486
484
        if (!xmlNodeIsText(cur->children)) continue;
517
515
    pcilib_transform_view_description_t desc = {0};
518
516
 
519
517
    desc.base.api = &pcilib_transform_view_api;
 
518
    desc.base.type = PCILIB_TYPE_DOUBLE;
520
519
 
521
520
    err = pcilib_xml_parse_view(ctx, xpath, doc, node, (pcilib_view_description_t*)&desc);
522
521
    if (err) return err;
531
530
 
532
531
        if (!strcasecmp(name, "read_from_register")) {
533
532
            desc.read_from_reg = value;
 
533
            if ((value)&&(*value)) desc.base.mode |= PCILIB_ACCESS_R;
534
534
        } else if (!strcasecmp(name, "write_to_register")) {
535
535
            desc.write_to_reg = value;
 
536
            if ((value)&&(*value)) desc.base.mode |= PCILIB_ACCESS_W;
536
537
        } 
537
538
    }
538
539
 
610
611
 
611
612
    pcilib_enum_view_description_t desc = {0};
612
613
 
 
614
    desc.base.type = PCILIB_TYPE_STRING;
613
615
    desc.base.unit = pcilib_xml_enum_view_unit;
614
616
    desc.base.api = &pcilib_enum_view_xml_api;
 
617
    desc.base.mode = PCILIB_ACCESS_RW;
615
618
 
616
619
    err = pcilib_xml_parse_view(ctx, xpath, doc, node, (pcilib_view_description_t*)&desc);
617
620
    if (err) return err;