| 2300 | */ |
| 2301 | |
| 2302 | void * /* O - Pointer to octetString data */ |
| 2303 | ippGetOctetString( |
| 2304 | ipp_attribute_t *attr, /* I - IPP attribute */ |
| 2305 | int element, /* I - Value number (0-based) */ |
| 2306 | int *datalen) /* O - Length of octetString data */ |
| 2307 | { |
| 2308 | /* |
| 2309 | * Range check input... |
| 2310 | */ |
| 2311 | |
| 2312 | if (!attr || attr->value_tag != IPP_TAG_STRING || |
| 2313 | element < 0 || element >= attr->num_values) |
| 2314 | { |
| 2315 | if (datalen) |
| 2316 | *datalen = 0; |
| 2317 | |
| 2318 | return (NULL); |
| 2319 | } |
| 2320 | |
| 2321 | /* |
| 2322 | * Return the values... |
| 2323 | */ |
| 2324 | |
| 2325 | if (datalen) |
| 2326 | *datalen = attr->values[element].unknown.length; |
| 2327 | |
| 2328 | return (attr->values[element].unknown.data); |
| 2329 | } |
| 2330 | |
| 2331 | |
| 2332 | /* |
no outgoing calls