1 /* $XConsortium: PrintSubSys.C /main/4 1996/01/17 18:02:47 lehors $ */
3 * (c) Copyright 1993, 1994 Hewlett-Packard Company *
4 * (c) Copyright 1993, 1994 International Business Machines Corp. *
5 * (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
6 * (c) Copyright 1993, 1994 Novell, Inc. *
9 #include "PrintSubSys.h"
15 const char *LIST_QUEUES = "lsallq | grep -v '^bsh$' | sort";
18 const char *LIST_QUEUES = "LANG=C lpstat -v | "
22 " x = match($3, /:/); "
23 " print substr($3, 1, x-1)"
27 const char *LIST_QUEUES = "LANG=C lpstat -v | "
34 const char *LIST_QUEUES = "LANG=C lpstat -v | "
38 " x = match($5, /:/); "
39 " print substr($5, 1, x-1)"
42 const char *LIST_QUEUES = "LANG=C lpstat -v | "
46 " x = match($3, /:/); "
47 " print substr($3, 1, x-1)"
55 const char *PRINTSUBSYSTEM = "PrintSubSystem";
57 PrintSubSystem::PrintSubSystem(BaseObj *parent)
58 : BaseObj(parent, "PrintSubSystem")
60 _displayName = strdup(MESSAGE(PrinterMenuL));
61 _details = strdup("Status Number Owner Date Time Size");
64 PrintSubSystem::~PrintSubSystem()
69 void PrintSubSystem::InitChildren()
72 if (RunCommand(LIST_QUEUES, &std_out))
74 Error("InitChildren method could not list queues.");
78 char *queue = strtok(std_out, " \n");
79 while (queue && *queue)
81 new Queue(this, queue);
82 queue = strtok(NULL, " \n");