int Queue::StopPrint(BaseObj *obj, char **output, BaseObj * /*requestor*/) { Queue *queue = (Queue *)obj; char *command = new char[100]; int rc; sprintf(command, STOP_PRINTING_CMD, queue->Name()); rc = queue->RunCommand(command, NULL, output); delete [] command; return rc; }
int Queue::Stop(BaseObj *obj, char **output, BaseObj * /*requestor*/) { Queue *queue = (Queue *)obj; char *command = new char[100]; int rc; #ifdef aix if (queue->n_devices > 1) { sprintf(command, STOP_QUEUE_CMD, "$d"); int i, len; len = 30 + strlen(command) + queue->n_devices; for (i = 0; i < queue->n_devices; i++) len += strlen(queue->local_devices[i]); char *cmd = new char[len]; strcpy(cmd, "for d in"); for (i = 0; i < queue->n_devices; i++) { strcat(cmd, " "); strcat(cmd, queue->local_devices[i]); } strcat(cmd, " ; do "); strcat(cmd, command); strcat(cmd, "; done"); rc = queue->RunCommand(cmd, NULL, output); delete [] cmd; } else #endif { sprintf(command, STOP_QUEUE_CMD, queue->Name()); rc = queue->RunCommand(command, NULL, output); } delete [] command; return rc; }