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

Function filter_cb

tools/ippeveprinter.c:2327–2347  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2325 */
2326
2327static int /* O - 1 to copy, 0 to ignore */
2328filter_cb(ippeve_filter_t *filter, /* I - Filter parameters */
2329 ipp_t *dst, /* I - Destination (unused) */
2330 ipp_attribute_t *attr) /* I - Source attribute */
2331{
2332 /*
2333 * Filter attributes as needed...
2334 */
2335
2336#ifndef _WIN32 /* Avoid MS compiler bug */
2337 (void)dst;
2338#endif /* !_WIN32 */
2339
2340 ipp_tag_t group = ippGetGroupTag(attr);
2341 const char *name = ippGetName(attr);
2342
2343 if ((filter->group_tag != IPP_TAG_ZERO && group != filter->group_tag && group != IPP_TAG_ZERO) || !name || (!strcmp(name, "media-col-database") && !cupsArrayFind(filter->ra, (void *)name)))
2344 return (0);
2345
2346 return (!filter->ra || cupsArrayFind(filter->ra, (void *)name) != NULL);
2347}
2348
2349
2350/*

Callers

nothing calls this directly

Calls 3

ippGetGroupTagFunction · 0.85
ippGetNameFunction · 0.85
cupsArrayFindFunction · 0.85

Tested by

no test coverage detected