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

Function ippSetBoolean

cups/ipp.c:2923–2948  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2921 */
2922
2923int /* O - 1 on success, 0 on failure */
2924ippSetBoolean(ipp_t *ipp, /* I - IPP message */
2925 ipp_attribute_t **attr, /* IO - IPP attribute */
2926 int element, /* I - Value number (0-based) */
2927 int boolvalue)/* I - Boolean value */
2928{
2929 _ipp_value_t *value; /* Current value */
2930
2931
2932 /*
2933 * Range check input...
2934 */
2935
2936 if (!ipp || !attr || !*attr || (*attr)->value_tag != IPP_TAG_BOOLEAN ||
2937 element < 0 || element > (*attr)->num_values)
2938 return (0);
2939
2940 /*
2941 * Set the value and return...
2942 */
2943
2944 if ((value = ipp_set_value(ipp, attr, element)) != NULL)
2945 value->boolean = (char)boolvalue;
2946
2947 return (value != NULL);
2948}
2949
2950
2951/*

Callers 2

_cupsEncodeOptionFunction · 0.85
parse_valueFunction · 0.85

Calls 1

ipp_set_valueFunction · 0.85

Tested by

no test coverage detected