| 53 | */ |
| 54 | |
| 55 | cups_sc_status_t /* O - Status of command */ |
| 56 | cupsSideChannelDoRequest( |
| 57 | cups_sc_command_t command, /* I - Command to send */ |
| 58 | char *data, /* O - Response data buffer pointer */ |
| 59 | int *datalen, /* IO - Size of data buffer on entry, number of bytes in buffer on return */ |
| 60 | double timeout) /* I - Timeout in seconds */ |
| 61 | { |
| 62 | cups_sc_status_t status; /* Status of command */ |
| 63 | cups_sc_command_t rcommand; /* Response command */ |
| 64 | |
| 65 | |
| 66 | if (cupsSideChannelWrite(command, CUPS_SC_STATUS_NONE, NULL, 0, timeout)) |
| 67 | return (CUPS_SC_STATUS_TIMEOUT); |
| 68 | |
| 69 | if (cupsSideChannelRead(&rcommand, &status, data, datalen, timeout)) |
| 70 | return (CUPS_SC_STATUS_TIMEOUT); |
| 71 | |
| 72 | if (rcommand != command) |
| 73 | return (CUPS_SC_STATUS_BAD_MESSAGE); |
| 74 | |
| 75 | return (status); |
| 76 | } |
| 77 | |
| 78 | |
| 79 | /* |