| 2034 | */ |
| 2035 | |
| 2036 | static void |
| 2037 | debug_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 | /* |
no test coverage detected