static stp_curve_t * xml_doc_get_curve(stp_mxml_node_t *doc) { stp_mxml_node_t *cur; stp_mxml_node_t *xmlcurve; stp_curve_t *curve = NULL; if (doc == NULL ) { stp_deprintf(STP_DBG_CURVE_ERRORS, "xml_doc_get_curve: XML file not parsed successfully.\n"); return NULL; } cur = doc->child; if (cur == NULL) { stp_deprintf(STP_DBG_CURVE_ERRORS, "xml_doc_get_curve: empty document\n"); return NULL; } xmlcurve = stp_xml_get_node(cur, "gutenprint", "curve", NULL); if (xmlcurve) curve = stp_curve_create_from_xmltree(xmlcurve); return curve; }
static stp_array_t * xml_doc_get_dither_array(stp_mxml_node_t *doc) { stp_mxml_node_t *cur; stp_mxml_node_t *xmlseq; if (doc == NULL ) { stp_erprintf("xml_doc_get_dither_array: XML file not parsed successfully.\n"); return NULL; } cur = doc->child; if (cur == NULL) { stp_erprintf("xml_doc_get_dither_array: empty document\n"); return NULL; } xmlseq = stp_xml_get_node(cur, "gutenprint", "dither-matrix", NULL); if (xmlseq == NULL ) { stp_erprintf("xml-doc-get-dither-array: XML file is not a dither matrix.\n"); return NULL; } return stpi_dither_array_create_from_xmltree(xmlseq); }