MCPcopy Create free account
hub / github.com/OpenPrinting/cups / cupsFindDestDefault

Function cupsFindDestDefault

cups/dest-options.c:854–887  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

852 */
853
854ipp_attribute_t * /* O - Default attribute or @code NULL@ for none */
855cupsFindDestDefault(
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/*

Callers 1

show_defaultFunction · 0.85

Calls 3

_cupsConnectFunction · 0.85
_cupsSetErrorFunction · 0.85
ippFindAttributeFunction · 0.85

Tested by 1

show_defaultFunction · 0.68