| 321 | */ |
| 322 | |
| 323 | ipp_attribute_t * /* O - New attribute */ |
| 324 | ippAddDate(ipp_t *ipp, /* I - IPP message */ |
| 325 | ipp_tag_t group, /* I - IPP group */ |
| 326 | const char *name, /* I - Name of attribute */ |
| 327 | const ipp_uchar_t *value) /* I - Value */ |
| 328 | { |
| 329 | ipp_attribute_t *attr; /* New attribute */ |
| 330 | |
| 331 | |
| 332 | DEBUG_printf(("ippAddDate(ipp=%p, group=%02x(%s), name=\"%s\", value=%p)", (void *)ipp, group, ippTagString(group), name, (void *)value)); |
| 333 | |
| 334 | /* |
| 335 | * Range check input... |
| 336 | */ |
| 337 | |
| 338 | if (!ipp || !name || !value || group < IPP_TAG_ZERO || |
| 339 | group == IPP_TAG_END || group >= IPP_TAG_UNSUPPORTED_VALUE) |
| 340 | return (NULL); |
| 341 | |
| 342 | /* |
| 343 | * Create the attribute... |
| 344 | */ |
| 345 | |
| 346 | if ((attr = ipp_add_attr(ipp, name, group, IPP_TAG_DATE, 1)) == NULL) |
| 347 | return (NULL); |
| 348 | |
| 349 | memcpy(attr->values[0].date, value, 11); |
| 350 | |
| 351 | return (attr); |
| 352 | } |
| 353 | |
| 354 | |
| 355 | /* |
no test coverage detected