MCPcopy Create free account
hub / github.com/OpenPrinting/cups / ippAddResolution

Function ippAddResolution

cups/ipp.c:723–759  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

721 */
722
723ipp_attribute_t * /* O - New attribute */
724ippAddResolution(ipp_t *ipp, /* I - IPP message */
725 ipp_tag_t group, /* I - IPP group */
726 const char *name, /* I - Name of attribute */
727 ipp_res_t units, /* I - Units for resolution */
728 int xres, /* I - X resolution */
729 int yres) /* I - Y resolution */
730{
731 ipp_attribute_t *attr; /* New attribute */
732
733
734 DEBUG_printf(("ippAddResolution(ipp=%p, group=%02x(%s), name=\"%s\", units=%d, xres=%d, yres=%d)", (void *)ipp, group,
735 ippTagString(group), name, units, xres, yres));
736
737 /*
738 * Range check input...
739 */
740
741 if (!ipp || !name || group < IPP_TAG_ZERO ||
742 group == IPP_TAG_END || group >= IPP_TAG_UNSUPPORTED_VALUE ||
743 units < IPP_RES_PER_INCH || units > IPP_RES_PER_CM ||
744 xres < 0 || yres < 0)
745 return (NULL);
746
747 /*
748 * Create the attribute...
749 */
750
751 if ((attr = ipp_add_attr(ipp, name, group, IPP_TAG_RESOLUTION, 1)) == NULL)
752 return (NULL);
753
754 attr->values[0].resolution.xres = xres;
755 attr->values[0].resolution.yres = yres;
756 attr->values[0].resolution.units = units;
757
758 return (attr);
759}
760
761
762/*

Callers 4

load_legacy_attributesFunction · 0.85
load_ppd_attributesFunction · 0.85
load_ppdFunction · 0.85
mainFunction · 0.85

Calls 2

ippTagStringFunction · 0.85
ipp_add_attrFunction · 0.85

Tested by

no test coverage detected