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

Function ipp_identify_printer

tools/ippeveprinter.c:3750–3784  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3748 */
3749
3750static void
3751ipp_identify_printer(
3752 ippeve_client_t *client) /* I - Client */
3753{
3754 ipp_attribute_t *actions, /* identify-actions */
3755 *message; /* message */
3756
3757
3758 actions = ippFindAttribute(client->request, "identify-actions", IPP_TAG_KEYWORD);
3759 message = ippFindAttribute(client->request, "message", IPP_TAG_TEXT);
3760
3761 if (!actions || ippContainsString(actions, "sound"))
3762 {
3763#ifdef __APPLE__
3764 pid_t pid; /* Process ID for "afplay" utility */
3765 static const char * const afplay[3] =
3766 { /* Arguments for "afplay" utility */
3767 "/usr/bin/afplay",
3768 "/System/Library/Sounds/Ping.aiff",
3769 NULL
3770 };
3771
3772 posix_spawn(&pid, afplay[0], NULL, NULL, (char **)afplay, NULL);
3773
3774#else
3775 putchar(0x07);
3776 fflush(stdout);
3777#endif /* __APPLE__ */
3778 }
3779
3780 if (ippContainsString(actions, "display"))
3781 printf("IDENTIFY from %s: %s\n", client->hostname, message ? ippGetString(message, 0, NULL) : "No message supplied");
3782
3783 respond_ipp(client, IPP_STATUS_OK, NULL);
3784}
3785
3786
3787/*

Callers 1

process_ippFunction · 0.85

Calls 4

ippFindAttributeFunction · 0.85
ippContainsStringFunction · 0.85
ippGetStringFunction · 0.85
respond_ippFunction · 0.85

Tested by

no test coverage detected