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

Function enum_dests_cb

cups/testthreads.c:54–87  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52 */
53
54static int /* O - 1 to continue, 0 to stop */
55enum_dests_cb(void *_name, /* I - Printer name, if any */
56 unsigned flags, /* I - Enumeration flags */
57 cups_dest_t *dest) /* I - Found destination */
58{
59 const char *name = (const char *)_name;
60 /* Printer name */
61 cups_dest_t *cdest; /* Copied destination */
62
63
64 (void)flags;
65
66 /*
67 * If a name was specified, compare it...
68 */
69
70 if (name && strcasecmp(name, dest->name))
71 return (1); /* Continue */
72
73 /*
74 * Copy the destination and run the query on a separate thread...
75 */
76
77 cupsCopyDest(dest, 0, &cdest);
78 _cupsThreadWait(_cupsThreadCreate((_cups_thread_func_t)run_query, cdest));
79
80 cupsFreeDests(1, cdest);
81
82 /*
83 * Continue if no name was specified or the name matches...
84 */
85
86 return (!name || !strcasecmp(name, dest->name));
87}
88
89
90/*

Callers

nothing calls this directly

Calls 4

cupsCopyDestFunction · 0.85
_cupsThreadWaitFunction · 0.85
_cupsThreadCreateFunction · 0.85
cupsFreeDestsFunction · 0.85

Tested by

no test coverage detected