| 852 | */ |
| 853 | |
| 854 | ipp_attribute_t * /* O - Default attribute or @code NULL@ for none */ |
| 855 | cupsFindDestDefault( |
| 856 | http_t *http, /* I - Connection to destination */ |
| 857 | cups_dest_t *dest, /* I - Destination */ |
| 858 | cups_dinfo_t *dinfo, /* I - Destination information */ |
| 859 | const char *option) /* I - Option/attribute name */ |
| 860 | { |
| 861 | char name[IPP_MAX_NAME]; /* Attribute name */ |
| 862 | |
| 863 | |
| 864 | /* |
| 865 | * Get the default connection as needed... |
| 866 | */ |
| 867 | |
| 868 | if (!http) |
| 869 | http = _cupsConnect(); |
| 870 | |
| 871 | /* |
| 872 | * Range check input... |
| 873 | */ |
| 874 | |
| 875 | if (!http || !dest || !dinfo || !option) |
| 876 | { |
| 877 | _cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(EINVAL), 0); |
| 878 | return (NULL); |
| 879 | } |
| 880 | |
| 881 | /* |
| 882 | * Find and return the attribute... |
| 883 | */ |
| 884 | |
| 885 | snprintf(name, sizeof(name), "%s-default", option); |
| 886 | return (ippFindAttribute(dinfo->attrs, name, IPP_TAG_ZERO)); |
| 887 | } |
| 888 | |
| 889 | |
| 890 | /* |