diff --git a/include/crm/common/xml_internal.h b/include/crm/common/xml_internal.h index 5643be6..c60fa51 100644 --- a/include/crm/common/xml_internal.h +++ b/include/crm/common/xml_internal.h @@ -235,4 +235,7 @@ pcmk__xe_next(const xmlNode *child) return next; } +void +pcmk__xe_set_propv(xmlNodePtr node, va_list pairs); + #endif // PCMK__XML_INTERNAL__H diff --git a/lib/common/xml.c b/lib/common/xml.c index bed6854..61cac9f 100644 --- a/lib/common/xml.c +++ b/lib/common/xml.c @@ -2935,6 +2935,26 @@ pcmk__xml_artefact_path(enum pcmk__xml_artefact_ns ns, const char *filespec) return ret; } +void +pcmk__xe_set_propv(xmlNodePtr node, va_list pairs) +{ + while (true) { + const char *name, *value; + + name = va_arg(pairs, const char *); + if (name == NULL) { + return; + } + + value = va_arg(pairs, const char *); + if (value == NULL) { + return; + } + + crm_xml_add(node, name, value); + } +} + // Deprecated functions kept only for backward API compatibility xmlNode *find_entity(xmlNode *parent, const char *node_name, const char *id);