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

Function ippSetCollection

cups/ipp.c:2965–2997  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2963 */
2964
2965int /* O - 1 on success, 0 on failure */
2966ippSetCollection(
2967 ipp_t *ipp, /* I - IPP message */
2968 ipp_attribute_t **attr, /* IO - IPP attribute */
2969 int element, /* I - Value number (0-based) */
2970 ipp_t *colvalue) /* I - Collection value */
2971{
2972 _ipp_value_t *value; /* Current value */
2973
2974
2975 /*
2976 * Range check input...
2977 */
2978
2979 if (!ipp || !attr || !*attr || (*attr)->value_tag != IPP_TAG_BEGIN_COLLECTION ||
2980 element < 0 || element > (*attr)->num_values || !colvalue)
2981 return (0);
2982
2983 /*
2984 * Set the value and return...
2985 */
2986
2987 if ((value = ipp_set_value(ipp, attr, element)) != NULL)
2988 {
2989 if (value->collection)
2990 ippDelete(value->collection);
2991
2992 value->collection = colvalue;
2993 colvalue->use ++;
2994 }
2995
2996 return (value != NULL);
2997}
2998
2999
3000/*

Callers 6

load_legacy_attributesFunction · 0.85
load_ppd_attributesFunction · 0.85
show_mediaFunction · 0.85
load_ppdFunction · 0.85
_cupsEncodeOptionFunction · 0.85
parse_valueFunction · 0.85

Calls 2

ipp_set_valueFunction · 0.85
ippDeleteFunction · 0.85

Tested by

no test coverage detected