lpc.c revision dd850934386c395d7dd28457dab735df80de144c
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*
*/
/* $Id: lpc.c 146 2006-03-24 00:26:54Z njacobs $ */
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <locale.h>
#include <libintl.h>
#include <papi.h>
#include "common.h"
typedef int (cmd_handler_t)(papi_service_t, char **);
/* ARGSUSED0 */
static int
{
exit(0);
/* NOTREACHED */
return (0);
}
static int
{
papi_printer_t p = NULL;
"printer-is-accepting-jobs", NULL };
char accepting = 0;
"printer-is-accepting-jobs", &accepting);
"printer-state", &state);
printf("\tprinting is %s\n",
gettext("disabled")));
int i = 0;
PAPI_LIST_JOBS_ALL, 0, &jobs);
}
} else
if (state == 0x04)
} else {
return (-1);
}
papiPrinterFree(p);
return (0);
}
static int
{
if (destination == NULL) {
return (-1);
}
} else {
}
return (0);
}
static int
{
if (destination == NULL) {
return (-1);
}
return (-1);
}
int i;
papiJobGetId(jobs[i]));
}
return (0);
}
static int
{
if (destination == NULL) {
return (-1);
}
return (-1);
}
return (0);
}
static int
{
if (destination == NULL) {
return (-1);
}
return (-1);
}
return (0);
}
static int
{
int rc = 0;
return (rc);
}
static int
{
if (destination == NULL) {
return (-1);
}
return (-1);
}
return (0);
}
static int
{
if (destination == NULL) {
return (-1);
}
return (-1);
}
return (0);
}
static int
{
return (-1);
}
return (-1);
}
return (0);
}
static int
{
int rc = 0;
return (rc);
}
static int
{
int rc = 0;
return (rc);
}
static char help_help[] = "get help on commands";
static char help_exit[] = "exit lpc";
static char help_status[] = "show status of daemon and queue";
static char help_abort[] =
"disable print queue terminating any active job processing";
static char help_clean[] = "remove all jobs from a queue";
static char help_disable[] = "turn off spooling to a queue";
static char help_down[] =
"turn off queueing and printing for a queue and set a reason";
static char help_enable[] = "turn on spooling to a queue";
static char help_restart[] = "restart job processing for a queue";
static char help_start[] = "turn on printing from a queue";
static char help_stop[] = "turn off printing from a queue";
static char help_up[] = "turn on queueing and printing for a queue";
static char help_topq[] = "put a job at the top of the queue";
static struct {
char *cmd;
char *help_string;
int num_args;
} cmd_tab[] = {
};
static int
{
int i;
}
return (-1);
}
static char *
lpc_helptext(char *cmd)
{
int i;
return (NULL);
}
/* ARGSUSED0 */
static int
{
int i;
if ((i % 7) == 6)
printf("\n");
}
if ((i % 7) != 6)
printf("\n");
} else {
}
return (0);
}
static int
{
int rc = -1;
"Failed to contact service for %s: %s\n"),
}
}
return (rc);
}
static int
{
char **printers;
int rc = 0;
encryption, NULL);
return (-1);
}
int i;
}
}
return (rc);
}
static int
{
int num_args = -1;
int rc = -1;
return (-1);
}
int i;
char *argv[4];
for (i = 2; i <= ac; i++) {
}
} else
for (i = 1; i <= ac; i++) {
}
} else
return (rc);
}
static void
{
char *name;
else
name++;
gettext("Usage: %s [ command [ parameter...]]\n"),
name);
exit(1);
}
static void
{
for (;;) {
char line[256];
int ac = 0;
/* prompt */
/* get command */
exit(1);
else
continue;
if (ac > 0)
}
}
int
{
int result = 0;
int c;
(void) textdomain("SUNW_OST_OSCMD");
switch (c) {
case 'E':
break;
default:
}
lpc_shell();
else
return (result);
}