1331722Seadler/*
21553Srgrimes * Copyright (c) 1983, 1993
31553Srgrimes *	The Regents of the University of California.  All rights reserved.
41553Srgrimes *
51553Srgrimes * Redistribution and use in source and binary forms, with or without
61553Srgrimes * modification, are permitted provided that the following conditions
71553Srgrimes * are met:
81553Srgrimes * 1. Redistributions of source code must retain the above copyright
91553Srgrimes *    notice, this list of conditions and the following disclaimer.
101553Srgrimes * 2. Redistributions in binary form must reproduce the above copyright
111553Srgrimes *    notice, this list of conditions and the following disclaimer in the
121553Srgrimes *    documentation and/or other materials provided with the distribution.
131553Srgrimes * 4. Neither the name of the University nor the names of its contributors
141553Srgrimes *    may be used to endorse or promote products derived from this software
151553Srgrimes *    without specific prior written permission.
161553Srgrimes *
171553Srgrimes * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
181553Srgrimes * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
191553Srgrimes * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
201553Srgrimes * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
211553Srgrimes * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
221553Srgrimes * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
231553Srgrimes * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
241553Srgrimes * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
251553Srgrimes * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
261553Srgrimes * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
271553Srgrimes * SUCH DAMAGE.
281553Srgrimes */
291553Srgrimes
30117599Sgad#if 0
311553Srgrimes#ifndef lint
321553Srgrimesstatic char sccsid[] = "@(#)cmdtab.c	8.1 (Berkeley) 6/6/93";
331553Srgrimes#endif /* not lint */
34117599Sgad#endif
351553Srgrimes
36117599Sgad#include "lp.cdefs.h"		/* A cross-platform version of <sys/cdefs.h> */
37117599Sgad__FBSDID("$FreeBSD$");
381553Srgrimes
391553Srgrimes#include "lpc.h"
401553Srgrimes#include "extern.h"
411553Srgrimes
421553Srgrimes/*
431553Srgrimes * lpc -- command tables
441553Srgrimes */
451553Srgrimeschar	aborthelp[] =	"terminate a spooling daemon immediately and disable printing";
46100203Sgadchar	botmqhelp[] =	"move job(s) to the bottom of printer queue";
471553Srgrimeschar	cleanhelp[] =	"remove cruft files from a queue";
481553Srgrimeschar	enablehelp[] =	"turn a spooling queue on";
491553Srgrimeschar	disablehelp[] =	"turn a spooling queue off";
501553Srgrimeschar	downhelp[] =	"do a 'stop' followed by 'disable' and put a message in status";
511553Srgrimeschar	helphelp[] =	"get help on commands";
521553Srgrimeschar	quithelp[] =	"exit lpc";
531553Srgrimeschar	restarthelp[] =	"kill (if possible) and restart a spooling daemon";
5498267Sgadchar	setstatushelp[] = "set the status message of a queue, requires\n"
5598267Sgad			"\t\t\"-msg\" before the text of the new message";
561553Srgrimeschar	starthelp[] =	"enable printing and start a spooling daemon";
571553Srgrimeschar	statushelp[] =	"show status of daemon and queue";
581553Srgrimeschar	stophelp[] =	"stop a spooling daemon after current job completes and disable printing";
5978750Sgadchar	tcleanhelp[] =	"test to see what files a clean cmd would remove";
60100203Sgadchar	topqhelp[] =	"move job(s) to the top of printer queue";
611553Srgrimeschar	uphelp[] =	"enable everything and restart spooling daemon";
621553Srgrimes
6398267Sgad/* Use some abbreviations so entries won't need to wrap */
6498267Sgad#define PR	LPC_PRIVCMD
6598267Sgad#define M	LPC_MSGOPT
6678750Sgad
671553Srgrimesstruct cmd cmdtab[] = {
6898152Sgad	{ "abort",	aborthelp,	PR,	0,		abort_q },
69100203Sgad	{ "bottomq",	botmqhelp,	PR,	bottomq_cmd,	0 },
7098279Sgad	{ "clean",	cleanhelp,	PR,	clean_gi,	clean_q },
7198152Sgad	{ "enable",	enablehelp,	PR,	0,		enable_q },
7278750Sgad	{ "exit",	quithelp,	0,	quit,		0 },
7398152Sgad	{ "disable",	disablehelp,	PR,	0, 		disable_q },
7498278Sgad	{ "down",	downhelp,	PR|M,	down_gi,	down_q },
7578750Sgad	{ "help",	helphelp,	0,	help,		0 },
7678750Sgad	{ "quit",	quithelp,	0,	quit,		0 },
7798152Sgad	{ "restart",	restarthelp,	0,	0,		restart_q },
7898152Sgad	{ "start",	starthelp,	PR,	0,		start_q },
7978750Sgad	{ "status",	statushelp,	0,	0,		status },
8098267Sgad	{ "setstatus",	setstatushelp,	PR|M,	setstatus_gi,	setstatus_q },
8198152Sgad	{ "stop",	stophelp,	PR,	0,		stop_q },
8298279Sgad	{ "tclean",	tcleanhelp,	0,	tclean_gi,	clean_q },
83100203Sgad	{ "topq",	topqhelp,	PR,	topq_cmd,	0 },
8498152Sgad	{ "up",		uphelp,		PR,	0,		up_q },
8578750Sgad	{ "?",		helphelp,	0,	help,		0 },
86100203Sgad	{ "xtopq",	topqhelp,	PR,	topq,		0 },
8778750Sgad	{ 0, 0, 0, 0, 0},
881553Srgrimes};
891553Srgrimes
901553Srgrimesint	NCMDS = sizeof (cmdtab) / sizeof (cmdtab[0]);
91