1 /* 2 * Copyright (c) 1983 Regents of the University of California. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms are permitted 6 * provided that the above copyright notice and this paragraph are 7 * duplicated in all such forms and that any documentation, 8 * advertising materials, and other materials related to such 9 * distribution and use acknowledge that the software was developed 10 * by the University of California, Berkeley. The name of the 11 * University may not be used to endorse or promote products derived 12 * from this software without specific prior written permission. 13 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR 14 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED 15 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. 16 */ 17 18 #ifndef lint 19 static char sccsid[] = "@(#)cmdtab.c 5.3 (Berkeley) 06/30/88"; 20 #endif /* not lint */ 21 22 /* 23 * lpc -- command tables 24 */ 25 26 #include "lpc.h" 27 28 int abort(), clean(), enable(), disable(), down(), help(); 29 int quit(), restart(), start(), status(), stop(), topq(), up(); 30 31 char aborthelp[] = "terminate a spooling daemon immediately and disable printing"; 32 char cleanhelp[] = "remove cruft files from a queue"; 33 char enablehelp[] = "turn a spooling queue on"; 34 char disablehelp[] = "turn a spooling queue off"; 35 char downhelp[] = "do a 'stop' followed by 'disable' and put a message in status"; 36 char helphelp[] = "get help on commands"; 37 char quithelp[] = "exit lpc"; 38 char restarthelp[] = "kill (if possible) and restart a spooling daemon"; 39 char starthelp[] = "enable printing and start a spooling daemon"; 40 char statushelp[] = "show status of daemon and queue"; 41 char stophelp[] = "stop a spooling daemon after current job completes and disable printing"; 42 char topqhelp[] = "put job at top of printer queue"; 43 char uphelp[] = "enable everything and restart spooling daemon"; 44 45 struct cmd cmdtab[] = { 46 { "abort", aborthelp, abort, 1 }, 47 { "clean", cleanhelp, clean, 1 }, 48 { "enable", enablehelp, enable, 1 }, 49 { "exit", quithelp, quit, 0 }, 50 { "disable", disablehelp, disable, 1 }, 51 { "down", downhelp, down, 1 }, 52 { "help", helphelp, help, 0 }, 53 { "quit", quithelp, quit, 0 }, 54 { "restart", restarthelp, restart, 0 }, 55 { "start", starthelp, start, 1 }, 56 { "status", statushelp, status, 0 }, 57 { "stop", stophelp, stop, 1 }, 58 { "topq", topqhelp, topq, 1 }, 59 { "up", uphelp, up, 1 }, 60 { "?", helphelp, help, 0 }, 61 { 0 }, 62 }; 63 64 int NCMDS = sizeof (cmdtab) / sizeof (cmdtab[0]); 65