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

Function debug_attributes

tools/ippeveprinter.c:2036–2079  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2034 */
2035
2036static void
2037debug_attributes(const char *title, /* I - Title */
2038 ipp_t *ipp, /* I - Request/response */
2039 int type) /* I - 0 = object, 1 = request, 2 = response */
2040{
2041 ipp_tag_t group_tag; /* Current group */
2042 ipp_attribute_t *attr; /* Current attribute */
2043 char buffer[2048]; /* String buffer for value */
2044 int major, minor; /* Version */
2045
2046
2047 if (Verbosity <= 1)
2048 return;
2049
2050 fprintf(stderr, "%s:\n", title);
2051 major = ippGetVersion(ipp, &minor);
2052 fprintf(stderr, " version=%d.%d\n", major, minor);
2053 if (type == 1)
2054 fprintf(stderr, " operation-id=%s(%04x)\n",
2055 ippOpString(ippGetOperation(ipp)), ippGetOperation(ipp));
2056 else if (type == 2)
2057 fprintf(stderr, " status-code=%s(%04x)\n",
2058 ippErrorString(ippGetStatusCode(ipp)), ippGetStatusCode(ipp));
2059 fprintf(stderr, " request-id=%d\n\n", ippGetRequestId(ipp));
2060
2061 for (attr = ippFirstAttribute(ipp), group_tag = IPP_TAG_ZERO;
2062 attr;
2063 attr = ippNextAttribute(ipp))
2064 {
2065 if (ippGetGroupTag(attr) != group_tag)
2066 {
2067 group_tag = ippGetGroupTag(attr);
2068 fprintf(stderr, " %s\n", ippTagString(group_tag));
2069 }
2070
2071 if (ippGetName(attr))
2072 {
2073 ippAttributeString(attr, buffer, sizeof(buffer));
2074 fprintf(stderr, " %s (%s%s) %s\n", ippGetName(attr),
2075 ippGetCount(attr) > 1 ? "1setOf " : "",
2076 ippTagString(ippGetValueTag(attr)), buffer);
2077 }
2078 }
2079}
2080
2081
2082/*

Callers 3

create_printerFunction · 0.70
process_ippFunction · 0.70
respond_httpFunction · 0.70

Calls 14

ippGetVersionFunction · 0.85
ippOpStringFunction · 0.85
ippGetOperationFunction · 0.85
ippErrorStringFunction · 0.85
ippGetStatusCodeFunction · 0.85
ippGetRequestIdFunction · 0.85
ippFirstAttributeFunction · 0.85
ippNextAttributeFunction · 0.85
ippGetGroupTagFunction · 0.85
ippTagStringFunction · 0.85
ippGetNameFunction · 0.85
ippAttributeStringFunction · 0.85

Tested by

no test coverage detected