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

Function ippSetInteger

cups/ipp.c:3097–3126  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3095 */
3096
3097int /* O - 1 on success, 0 on failure */
3098ippSetInteger(ipp_t *ipp, /* I - IPP message */
3099 ipp_attribute_t **attr, /* IO - IPP attribute */
3100 int element, /* I - Value number (0-based) */
3101 int intvalue) /* I - Integer/enum value */
3102{
3103 _ipp_value_t *value; /* Current value */
3104
3105
3106 /*
3107 * Range check input...
3108 */
3109
3110 if (!ipp || !attr || !*attr || ((*attr)->value_tag != IPP_TAG_INTEGER && (*attr)->value_tag != IPP_TAG_ENUM && (*attr)->value_tag != IPP_TAG_NOVALUE && (*attr)->value_tag != IPP_TAG_UNKNOWN) || element < 0 || element > (*attr)->num_values)
3111 return (0);
3112
3113 /*
3114 * Set the value and return...
3115 */
3116
3117 if ((value = ipp_set_value(ipp, attr, element)) != NULL)
3118 {
3119 if ((*attr)->value_tag != IPP_TAG_ENUM)
3120 (*attr)->value_tag = IPP_TAG_INTEGER;
3121
3122 value->integer = intvalue;
3123 }
3124
3125 return (value != NULL);
3126}
3127
3128
3129/*

Callers 4

load_ppd_attributesFunction · 0.85
update_jobFunction · 0.85
_cupsEncodeOptionFunction · 0.85
parse_valueFunction · 0.85

Calls 1

ipp_set_valueFunction · 0.85

Tested by

no test coverage detected