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

Function cups_enum_dests

cups/dest.c:3413–3977  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3411 */
3412
3413static int /* O - 1 on success, 0 on failure */
3414cups_enum_dests(
3415 http_t *http, /* I - Connection to scheduler */
3416 unsigned flags, /* I - Enumeration flags */
3417 int msec, /* I - Timeout in milliseconds, -1 for indefinite */
3418 int *cancel, /* I - Pointer to "cancel" variable */
3419 cups_ptype_t type, /* I - Printer type bits */
3420 cups_ptype_t mask, /* I - Mask for printer type bits */
3421 cups_dest_cb_t cb, /* I - Callback function */
3422 void *user_data) /* I - User data */
3423{
3424 int i, j, k, /* Looping vars */
3425 num_dests; /* Number of destinations */
3426 cups_dest_t *dests = NULL, /* Destinations */
3427 *dest; /* Current destination */
3428 cups_option_t *option; /* Current option */
3429 const char *user_default; /* Default printer from environment */
3430#ifdef HAVE_DNSSD
3431 int count, /* Number of queries started */
3432 completed, /* Number of completed queries */
3433 remaining; /* Remainder of timeout */
3434 double curtime; /* Current time */
3435 _cups_dnssd_data_t data; /* Data for callback */
3436 _cups_dnssd_device_t *device; /* Current device */
3437# ifdef HAVE_MDNSRESPONDER
3438 int nfds, /* Number of files responded */
3439 main_fd; /* File descriptor for lookups */
3440 DNSServiceRef ipp_ref = NULL; /* IPP browser */
3441# ifdef HAVE_TLS
3442 DNSServiceRef ipps_ref = NULL; /* IPPS browser */
3443# endif /* HAVE_TLS */
3444# ifdef HAVE_POLL
3445 struct pollfd pfd; /* Polling data */
3446# else
3447 fd_set input; /* Input set for select() */
3448 struct timeval timeout; /* Timeout for select() */
3449# endif /* HAVE_POLL */
3450# else /* HAVE_AVAHI */
3451 int error; /* Error value */
3452 AvahiServiceBrowser *ipp_ref = NULL; /* IPP browser */
3453# ifdef HAVE_TLS
3454 AvahiServiceBrowser *ipps_ref = NULL; /* IPPS browser */
3455# endif /* HAVE_TLS */
3456# endif /* HAVE_MDNSRESPONDER */
3457#else
3458 _cups_getdata_t data; /* Data for callback */
3459#endif /* HAVE_DNSSD */
3460 char filename[1024]; /* Local lpoptions file */
3461 _cups_globals_t *cg = _cupsGlobals(); /* Pointer to library globals */
3462
3463
3464 DEBUG_printf(("cups_enum_dests(flags=%x, msec=%d, cancel=%p, type=%x, mask=%x, cb=%p, user_data=%p)", flags, msec, (void *)cancel, type, mask, (void *)cb, (void *)user_data));
3465
3466 /*
3467 * Range check input...
3468 */
3469
3470 (void)flags;

Callers 2

cupsEnumDestsFunction · 0.85
cupsGetDests2Function · 0.85

Calls 15

_cupsGlobalsFunction · 0.85
_cupsUserDefaultFunction · 0.85
cups_get_destsFunction · 0.85
cupsGetDestFunction · 0.85
cupsGetDefault2Function · 0.85
cupsArrayNew3Function · 0.85
_cupsGetDestsFunction · 0.85
_cups_strcasecmpFunction · 0.85
cupsGetOptionFunction · 0.85
cupsAddOptionFunction · 0.85
httpSeparateURIFunction · 0.85
cups_dnssd_get_deviceFunction · 0.85

Tested by

no test coverage detected