| 109 | */ |
| 110 | |
| 111 | ipp_attribute_t * /* O - New attribute */ |
| 112 | ippAddBoolean(ipp_t *ipp, /* I - IPP message */ |
| 113 | ipp_tag_t group, /* I - IPP group */ |
| 114 | const char *name, /* I - Name of attribute */ |
| 115 | char value) /* I - Value of attribute */ |
| 116 | { |
| 117 | ipp_attribute_t *attr; /* New attribute */ |
| 118 | |
| 119 | |
| 120 | DEBUG_printf(("ippAddBoolean(ipp=%p, group=%02x(%s), name=\"%s\", value=%d)", (void *)ipp, group, ippTagString(group), name, value)); |
| 121 | |
| 122 | /* |
| 123 | * Range check input... |
| 124 | */ |
| 125 | |
| 126 | if (!ipp || !name || group < IPP_TAG_ZERO || |
| 127 | group == IPP_TAG_END || group >= IPP_TAG_UNSUPPORTED_VALUE) |
| 128 | return (NULL); |
| 129 | |
| 130 | /* |
| 131 | * Create the attribute... |
| 132 | */ |
| 133 | |
| 134 | if ((attr = ipp_add_attr(ipp, name, group, IPP_TAG_BOOLEAN, 1)) == NULL) |
| 135 | return (NULL); |
| 136 | |
| 137 | attr->values[0].boolean = value; |
| 138 | |
| 139 | return (attr); |
| 140 | } |
| 141 | |
| 142 | |
| 143 | /* |