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

Function ippAddInteger

cups/ipp.c:371–418  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

369 */
370
371ipp_attribute_t * /* O - New attribute */
372ippAddInteger(ipp_t *ipp, /* I - IPP message */
373 ipp_tag_t group, /* I - IPP group */
374 ipp_tag_t value_tag, /* I - Type of attribute */
375 const char *name, /* I - Name of attribute */
376 int value) /* I - Value of attribute */
377{
378 ipp_attribute_t *attr; /* New attribute */
379
380
381 DEBUG_printf(("ippAddInteger(ipp=%p, group=%02x(%s), type=%02x(%s), name=\"%s\", value=%d)", (void *)ipp, group, ippTagString(group), value_tag, ippTagString(value_tag), name, value));
382
383 value_tag &= IPP_TAG_CUPS_MASK;
384
385 /*
386 * Special-case for legacy usage: map out-of-band attributes to new ippAddOutOfBand
387 * function...
388 */
389
390 if (value_tag >= IPP_TAG_UNSUPPORTED_VALUE && value_tag <= IPP_TAG_ADMINDEFINE)
391 return (ippAddOutOfBand(ipp, group, value_tag, name));
392
393 /*
394 * Range check input...
395 */
396
397#if 0
398 if (!ipp || !name || group < IPP_TAG_ZERO ||
399 group == IPP_TAG_END || group >= IPP_TAG_UNSUPPORTED_VALUE ||
400 (value_tag != IPP_TAG_INTEGER && value_tag != IPP_TAG_ENUM))
401 return (NULL);
402#else
403 if (!ipp || !name || group < IPP_TAG_ZERO ||
404 group == IPP_TAG_END || group >= IPP_TAG_UNSUPPORTED_VALUE)
405 return (NULL);
406#endif /* 0 */
407
408 /*
409 * Create the attribute...
410 */
411
412 if ((attr = ipp_add_attr(ipp, name, group, value_tag, 1)) == NULL)
413 return (NULL);
414
415 attr->values[0].integer = value;
416
417 return (attr);
418}
419
420
421/*

Callers 15

copy_job_attributesFunction · 0.85
create_jobFunction · 0.85
create_media_colFunction · 0.85
create_media_sizeFunction · 0.85
create_printerFunction · 0.85
load_legacy_attributesFunction · 0.85
load_ppd_attributesFunction · 0.85
cupsdAddEventFunction · 0.85
mainFunction · 0.85
get_job_fileFunction · 0.85
add_jobFunction · 0.85

Calls 3

ippTagStringFunction · 0.85
ippAddOutOfBandFunction · 0.85
ipp_add_attrFunction · 0.85

Tested by 4

mainFunction · 0.68
mainFunction · 0.68
monitor_printerFunction · 0.68
run_clientFunction · 0.68