| 3748 | */ |
| 3749 | |
| 3750 | static void |
| 3751 | ipp_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 | /* |
no test coverage detected