Changeset 6f0b2ab04b6e742c4bac93acdc575612ceabcae1
- Timestamp:
- 09/18/09 00:23:15
(4 years ago)
- Author:
- Theo Schlossnagle <jesus@omniti.com>
- git-committer:
- Theo Schlossnagle <jesus@omniti.com> 1253233395 +0000
- git-parent:
[57cd7b0a283390410c6f4deca487bd80097826ee]
- git-author:
- Theo Schlossnagle <jesus@omniti.com> 1253233395 +0000
- Message:
refs #171, supports inherit flags on config stanzas
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| ra4484cb |
r6f0b2ab |
|
| 1 | 1 | /* |
|---|
| 2 | | * Copyright (c) 2007, OmniTI Computer Consulting, Inc. |
|---|
| | 2 | * Copyright (c) 2009, OmniTI Computer Consulting, Inc. |
|---|
| 3 | 3 | * All rights reserved. |
|---|
| 4 | 4 | * |
|---|
| … | … | |
| 248 | 248 | for(tl = root->children; tl; tl = tl->next) { |
|---|
| 249 | 249 | if(!strcmp((char *)tl->name, "attributes")) { |
|---|
| 250 | | *a = tl->children; |
|---|
| | 250 | *a = tl; |
|---|
| 251 | 251 | for(an = tl->children; an; an = an->next) { |
|---|
| 252 | 252 | #define CHECK_N_SET(a) if(!strcmp((char *)an->name, #a)) |
|---|
| … | … | |
| 314 | 314 | } |
|---|
| 315 | 315 | else if(!strcmp((char *)tl->name, "config")) { |
|---|
| 316 | | *c = tl->children; |
|---|
| | 316 | *c = tl; |
|---|
| 317 | 317 | /* Noop, anything goes */ |
|---|
| 318 | 318 | } |
|---|
| … | … | |
| 326 | 326 | configure_xml_check(xmlNodePtr check, xmlNodePtr a, xmlNodePtr c) { |
|---|
| 327 | 327 | xmlNodePtr n, config, oldconfig; |
|---|
| 328 | | for(n = a; n; n = n->next) { |
|---|
| | 328 | for(n = a->children; n; n = n->next) { |
|---|
| 329 | 329 | #define ATTR2PROP(attr) do { \ |
|---|
| 330 | 330 | if(!strcmp((char *)n->name, #attr)) { \ |
|---|
| … | … | |
| 346 | 346 | if(!strcmp((char *)oldconfig->name, "config")) break; |
|---|
| 347 | 347 | config = xmlNewNode(NULL, (xmlChar *)"config"); |
|---|
| 348 | | for(n = c; n; n = n->next) { |
|---|
| 349 | | xmlNodePtr co = xmlNewNode(NULL, n->name); |
|---|
| 350 | | xmlNodeAddContent(co, XML_GET_CONTENT(n)); |
|---|
| 351 | | xmlAddChild(config, co); |
|---|
| | 348 | if(c) { |
|---|
| | 349 | xmlAttrPtr inherit; |
|---|
| | 350 | if((inherit = xmlHasProp(c, (xmlChar *)"inherit")) != NULL && |
|---|
| | 351 | inherit->children && inherit->children->content) |
|---|
| | 352 | xmlSetProp(config, (xmlChar *)"inherit", inherit->children->content); |
|---|
| | 353 | for(n = c->children; n; n = n->next) { |
|---|
| | 354 | xmlNodePtr co = xmlNewNode(NULL, n->name); |
|---|
| | 355 | xmlNodeAddContent(co, XML_GET_CONTENT(n)); |
|---|
| | 356 | xmlAddChild(config, co); |
|---|
| | 357 | } |
|---|
| 352 | 358 | } |
|---|
| 353 | 359 | if(oldconfig) { |
|---|
| … | … | |
| 513 | 519 | xmlNodePtr newcheck, a; |
|---|
| 514 | 520 | /* make sure this isn't a dup */ |
|---|
| 515 | | for(a = attr; a; a = a->next) { |
|---|
| | 521 | for(a = attr->children; a; a = a->next) { |
|---|
| 516 | 522 | if(!strcmp((char *)a->name, "target")) |
|---|
| 517 | 523 | target = (char *)xmlNodeGetContent(a); |
|---|
| … | … | |
| 551 | 557 | |
|---|
| 552 | 558 | /* make sure this isn't a dup */ |
|---|
| 553 | | for(a = attr; a; a = a->next) { |
|---|
| | 559 | for(a = attr->children; a; a = a->next) { |
|---|
| 554 | 560 | if(!strcmp((char *)a->name, "target")) |
|---|
| 555 | 561 | target = (char *)xmlNodeGetContent(a); |
|---|