diff options
author | jacobs <none@none> | 2006-06-22 13:28:31 -0700 |
---|---|---|
committer | jacobs <none@none> | 2006-06-22 13:28:31 -0700 |
commit | 355b4669e025ff377602b6fc7caaf30dbc218371 (patch) | |
tree | 29a740456e8d09f935e18068ce72814285fafeec /usr/src/cmd/print/bsd-sysv-commands/lpc.c | |
parent | 5d0bc3ededb82d77f7c33d8f58e517a837ba5140 (diff) | |
download | illumos-joyent-355b4669e025ff377602b6fc7caaf30dbc218371.tar.gz |
LSARC/2003/547 PAPI Print Commands
LSARC/2006/172 PAPI Print Commands Packaging Breakout
4144591 lpstat -d reports *process* default printer as *system* default printer
4299193 lp -cd <queue> <file> causes multiple -d options errors
4327963 RFE cancel on local queue should not require in.lpd
4331220 lpmove doesn't work on remote print queues
4470602 Customer wants to increase print limit of 52 files to 300
4949866 lpstat shows FAILED printers due to expanded status message
4994469 lpadmin doesn't add filter definitions for printers
6302778 RUNPATH & RPATH errors in SUNWipplu package
6314007 lpstat should report paper type list supported by a printer
6317991 lprm -Pprintername - command results in aSegmentation fault
6338002 lpsched support for PAPI is incomplete
6346505 print commands should use PAPI for service interaction (LSARC/2003/547)
6364267 psm-lpsched has replicated code
6389273 RUNPATH and RPATH failures in SUNWippcore
--HG--
rename : usr/src/cmd/lp/cmd/cancel.c => deleted_files/usr/src/cmd/lp/cmd/cancel.c
rename : usr/src/cmd/lp/cmd/comb.c => deleted_files/usr/src/cmd/lp/cmd/comb.c
rename : usr/src/cmd/lp/cmd/lp.c => deleted_files/usr/src/cmd/lp/cmd/lp.c
rename : usr/src/cmd/lp/cmd/lpc/Makefile => deleted_files/usr/src/cmd/lp/cmd/lpc/Makefile
rename : usr/src/cmd/lp/cmd/lpc/cmds.c => deleted_files/usr/src/cmd/lp/cmd/lpc/cmds.c
rename : usr/src/cmd/lp/cmd/lpc/cmdtab.c => deleted_files/usr/src/cmd/lp/cmd/lpc/cmdtab.c
rename : usr/src/cmd/lp/cmd/lpc/fatalmsg.c => deleted_files/usr/src/cmd/lp/cmd/lpc/fatalmsg.c
rename : usr/src/cmd/lp/cmd/lpc/global.c => deleted_files/usr/src/cmd/lp/cmd/lpc/global.c
rename : usr/src/cmd/lp/cmd/lpc/lpc.c => deleted_files/usr/src/cmd/lp/cmd/lpc/lpc.c
rename : usr/src/cmd/lp/cmd/lpc/lpc.h => deleted_files/usr/src/cmd/lp/cmd/lpc/lpc.h
rename : usr/src/cmd/lp/cmd/lpc/process.c => deleted_files/usr/src/cmd/lp/cmd/lpc/process.c
rename : usr/src/cmd/lp/cmd/lpc/sndrcv.c => deleted_files/usr/src/cmd/lp/cmd/lpc/sndrcv.c
rename : usr/src/cmd/lp/cmd/lpc/topq.c => deleted_files/usr/src/cmd/lp/cmd/lpc/topq.c
rename : usr/src/cmd/lp/cmd/lpmove.c => deleted_files/usr/src/cmd/lp/cmd/lpmove.c
rename : usr/src/cmd/lp/cmd/lpstat/Makefile => deleted_files/usr/src/cmd/lp/cmd/lpstat/Makefile
rename : usr/src/cmd/lp/cmd/lpstat/accept.c => deleted_files/usr/src/cmd/lp/cmd/lpstat/accept.c
rename : usr/src/cmd/lp/cmd/lpstat/add_mounted.c => deleted_files/usr/src/cmd/lp/cmd/lpstat/add_mounted.c
rename : usr/src/cmd/lp/cmd/lpstat/charset.c => deleted_files/usr/src/cmd/lp/cmd/lpstat/charset.c
rename : usr/src/cmd/lp/cmd/lpstat/class.c => deleted_files/usr/src/cmd/lp/cmd/lpstat/class.c
rename : usr/src/cmd/lp/cmd/lpstat/device.c => deleted_files/usr/src/cmd/lp/cmd/lpstat/device.c
rename : usr/src/cmd/lp/cmd/lpstat/done.c => deleted_files/usr/src/cmd/lp/cmd/lpstat/done.c
rename : usr/src/cmd/lp/cmd/lpstat/form.c => deleted_files/usr/src/cmd/lp/cmd/lpstat/form.c
rename : usr/src/cmd/lp/cmd/lpstat/lpstat.c => deleted_files/usr/src/cmd/lp/cmd/lpstat/lpstat.c
rename : usr/src/cmd/lp/cmd/lpstat/lpstat.h => deleted_files/usr/src/cmd/lp/cmd/lpstat/lpstat.h
rename : usr/src/cmd/lp/cmd/lpstat/output.c => deleted_files/usr/src/cmd/lp/cmd/lpstat/output.c
rename : usr/src/cmd/lp/cmd/lpstat/parse.c => deleted_files/usr/src/cmd/lp/cmd/lpstat/parse.c
rename : usr/src/cmd/lp/cmd/lpstat/printer.c => deleted_files/usr/src/cmd/lp/cmd/lpstat/printer.c
rename : usr/src/cmd/lp/cmd/lpstat/request.c => deleted_files/usr/src/cmd/lp/cmd/lpstat/request.c
rename : usr/src/cmd/lp/cmd/lpstat/send_message.c => deleted_files/usr/src/cmd/lp/cmd/lpstat/send_message.c
rename : usr/src/cmd/lp/lib/papi/attribute.c => deleted_files/usr/src/cmd/lp/lib/papi/attribute.c
rename : usr/src/cmd/lp/lib/papi/list.c => deleted_files/usr/src/cmd/lp/lib/papi/list.c
rename : usr/src/cmd/lp/lib/papi/papi.h => deleted_files/usr/src/cmd/lp/lib/papi/papi.h
rename : usr/src/cmd/lp/lib/papi/status.c => deleted_files/usr/src/cmd/lp/lib/papi/status.c
rename : usr/src/cmd/print/cancel/Makefile => deleted_files/usr/src/cmd/print/cancel/Makefile
rename : usr/src/cmd/print/cancel/cancel.c => deleted_files/usr/src/cmd/print/cancel/cancel.c
rename : usr/src/cmd/print/cancel/cancel_list.c => deleted_files/usr/src/cmd/print/cancel/cancel_list.c
rename : usr/src/cmd/print/cancel/cancel_list.h => deleted_files/usr/src/cmd/print/cancel/cancel_list.h
rename : usr/src/cmd/print/lp/Makefile => deleted_files/usr/src/cmd/print/lp/Makefile
rename : usr/src/cmd/print/lpmove/Makefile => deleted_files/usr/src/cmd/print/lpmove/Makefile
rename : usr/src/cmd/print/lpmove/lpmove.c => deleted_files/usr/src/cmd/print/lpmove/lpmove.c
rename : usr/src/cmd/print/lpstat/Makefile => deleted_files/usr/src/cmd/print/lpstat/Makefile
rename : usr/src/cmd/print/lpstat/bsd-functions.c => deleted_files/usr/src/cmd/print/lpstat/bsd-functions.c
rename : usr/src/cmd/print/lpstat/bsd-functions.h => deleted_files/usr/src/cmd/print/lpstat/bsd-functions.h
rename : usr/src/cmd/print/lpstat/lpstat.c => deleted_files/usr/src/cmd/print/lpstat/lpstat.c
rename : usr/src/cmd/print/lpstat/parse.h => deleted_files/usr/src/cmd/print/lpstat/parse.h
rename : usr/src/cmd/print/lpstat/parse_bsd.c => deleted_files/usr/src/cmd/print/lpstat/parse_bsd.c
rename : usr/src/cmd/print/lpstat/sysv-functions.c => deleted_files/usr/src/cmd/print/lpstat/sysv-functions.c
rename : usr/src/cmd/print/lpstat/sysv-functions.h => deleted_files/usr/src/cmd/print/lpstat/sysv-functions.h
rename : usr/src/cmd/print/scripts/accept => deleted_files/usr/src/cmd/print/scripts/accept
rename : usr/src/cmd/lp/lib/papi/mapfile-vers => usr/src/cmd/lp/lib/papi/mapfile
rename : usr/src/cmd/print/lp/cleanup.xml => usr/src/cmd/print/gateway/cleanup.xml
rename : usr/src/cmd/print/lp/print-cleanup => usr/src/cmd/print/gateway/print-cleanup
rename : usr/src/cmd/print/lp/lp.c => usr/src/cmd/print/gateway/printd.c
rename : usr/src/lib/print/job.c => usr/src/lib/print/libprint/common/job.c
rename : usr/src/lib/print/job.h => usr/src/lib/print/libprint/common/job.h
rename : usr/src/lib/print/list.c => usr/src/lib/print/libprint/common/list.c
rename : usr/src/lib/print/list.h => usr/src/lib/print/libprint/common/list.h
rename : usr/src/lib/print/llib-lprint => usr/src/lib/print/libprint/common/llib-lprint
rename : usr/src/lib/print/mapfile-vers => usr/src/lib/print/libprint/common/mapfile-vers
rename : usr/src/lib/print/misc.c => usr/src/lib/print/libprint/common/misc.c
rename : usr/src/lib/print/misc.h => usr/src/lib/print/libprint/common/misc.h
rename : usr/src/lib/print/network.c => usr/src/lib/print/libprint/common/network.c
rename : usr/src/lib/print/network.h => usr/src/lib/print/libprint/common/network.h
rename : usr/src/lib/print/ns.c => usr/src/lib/print/libprint/common/ns.c
rename : usr/src/lib/print/ns.h => usr/src/lib/print/libprint/common/ns.h
rename : usr/src/lib/print/ns_bsd_addr.c => usr/src/lib/print/libprint/common/ns_bsd_addr.c
rename : usr/src/lib/print/ns_cmn_kvp.c => usr/src/lib/print/libprint/common/ns_cmn_kvp.c
rename : usr/src/lib/print/ns_cmn_printer.c => usr/src/lib/print/libprint/common/ns_cmn_printer.c
rename : usr/src/lib/print/nss_convert.c => usr/src/lib/print/libprint/common/nss_convert.c
rename : usr/src/lib/print/nss_ldap.c => usr/src/lib/print/libprint/common/nss_ldap.c
rename : usr/src/lib/print/nss_printer.c => usr/src/lib/print/libprint/common/nss_printer.c
rename : usr/src/lib/print/nss_write.c => usr/src/lib/print/libprint/common/nss_write.c
rename : usr/src/lib/print/sunPrinter.at.conf.txt => usr/src/lib/print/libprint/common/sunPrinter.at.conf.txt
rename : usr/src/lib/print/sunPrinter.oc.conf.txt => usr/src/lib/print/libprint/common/sunPrinter.oc.conf.txt
Diffstat (limited to 'usr/src/cmd/print/bsd-sysv-commands/lpc.c')
-rw-r--r-- | usr/src/cmd/print/bsd-sysv-commands/lpc.c | 540 |
1 files changed, 540 insertions, 0 deletions
diff --git a/usr/src/cmd/print/bsd-sysv-commands/lpc.c b/usr/src/cmd/print/bsd-sysv-commands/lpc.c new file mode 100644 index 0000000000..6d0aa6135d --- /dev/null +++ b/usr/src/cmd/print/bsd-sysv-commands/lpc.c @@ -0,0 +1,540 @@ +/* + * 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 + * or http://www.opensolaris.org/os/licensing. + * 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 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + * + */ + +/* $Id: lpc.c 146 2006-03-24 00:26:54Z njacobs $ */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#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 **); + +static papi_encryption_t encryption = PAPI_ENCRYPT_NEVER; + +/* ARGSUSED0 */ +static int +lpc_exit(papi_service_t svc, char **args) +{ + exit(0); + /* NOTREACHED */ + return (0); +} + +static int +lpc_status(papi_service_t svc, char **args) +{ + papi_status_t status; + papi_printer_t p = NULL; + char *pattrs[] = { "printer-state", "printer-state-reasons", + "printer-is-accepting-jobs", NULL }; + char *destination = args[1]; + + status = papiPrinterQuery(svc, destination, pattrs, NULL, &p); + if (status == PAPI_OK) { + papi_attribute_t **list = papiPrinterGetAttributeList(p); + char accepting = 0; + int32_t state = 0; + + printf("%s:\n", destination); + + (void) papiAttributeListGetBoolean(list, NULL, + "printer-is-accepting-jobs", &accepting); + printf(gettext("\tqueueing is %s\n"), + (accepting ? gettext("enabled") : gettext("disabled"))); + + (void) papiAttributeListGetInteger(list, NULL, + "printer-state", &state); + printf("\tprinting is %s\n", + ((state != 0x05) ? gettext("enabled") : + gettext("disabled"))); + + if (state != 0x03) { /* !idle */ + papi_job_t *jobs = NULL; + int i = 0; + + (void) papiPrinterListJobs(svc, destination, NULL, + PAPI_LIST_JOBS_ALL, 0, &jobs); + if (jobs != NULL) { + for (i = 0; jobs[i] != NULL; i++); + papiJobListFree(jobs); + } + printf(gettext("\t%d entries in spool area\n"), i); + } else + printf(gettext("\tno entries\n")); + + if (state == 0x04) + printf(gettext("\tdaemon present\n")); + + } else { + fprintf(stderr, "%s: %s\n", destination, + verbose_papi_message(svc, status)); + return (-1); + } + + papiPrinterFree(p); + + return (0); +} + +static int +lpc_abort(papi_service_t svc, char **args) +{ + papi_status_t status; + char *destination = args[1]; + + if (destination == NULL) { + fprintf(stderr, gettext("Usage: abort (destination)\n")); + return (-1); + } + + status = papiPrinterPause(svc, destination, "paused via lpc abort"); + if (status == PAPI_OK) { + printf(gettext("%s: processing disabled after current job\n"), + destination); + } else { + fprintf(stderr, "%s: %s\n", destination, + verbose_papi_message(svc, status)); + } + + return (0); +} + +static int +lpc_clean(papi_service_t svc, char **args) +{ + papi_status_t status; + papi_job_t *jobs = NULL; + char *destination = args[1]; + + if (destination == NULL) { + fprintf(stderr, gettext("Usage: clean (destination)\n")); + return (-1); + } + + status = papiPrinterPurgeJobs(svc, destination, &jobs); + if (status != PAPI_OK) { + fprintf(stderr, gettext("clean: %s: %s\n"), destination, + verbose_papi_message(svc, status)); + return (-1); + } + + if (jobs != NULL) { + int i; + + for (i = 0; jobs[i] != NULL; i++) + printf(gettext("\t%s-%d: cancelled\n"), destination, + papiJobGetId(jobs[i])); + + papiJobListFree(jobs); + } + + return (0); +} + +static int +lpc_disable(papi_service_t svc, char **args) +{ + papi_status_t status; + char *destination = args[1]; + + if (destination == NULL) { + fprintf(stderr, gettext("Usage: disable: (destination)\n")); + return (-1); + } + + status = papiPrinterDisable(svc, destination, NULL); + if (status != PAPI_OK) { + fprintf(stderr, gettext("disable: %s: %s\n"), destination, + verbose_papi_message(svc, status)); + return (-1); + } + + return (0); +} + +static int +lpc_enable(papi_service_t svc, char **args) +{ + papi_status_t status; + char *destination = args[1]; + + if (destination == NULL) { + fprintf(stderr, gettext("Usage: enable: (destination)\n")); + return (-1); + } + + status = papiPrinterEnable(svc, destination); + if (status != PAPI_OK) { + fprintf(stderr, gettext("enable: %s: %s\n"), destination, + verbose_papi_message(svc, status)); + return (-1); + } + + return (0); +} + +static int +lpc_restart(papi_service_t svc, char **args) +{ + int rc = 0; + + rc += lpc_disable(svc, args); + rc += lpc_enable(svc, args); + + return (rc); +} + +static int +lpc_start(papi_service_t svc, char **args) +{ + papi_status_t status; + char *destination = args[1]; + + if (destination == NULL) { + fprintf(stderr, gettext("Usage: start (destination)\n")); + return (-1); + } + + status = papiPrinterResume(svc, destination); + if (status != PAPI_OK) { + fprintf(stderr, gettext("start: %s: %s\n"), destination, + verbose_papi_message(svc, status)); + return (-1); + } + + return (0); +} + +static int +lpc_stop(papi_service_t svc, char **args) +{ + papi_status_t status; + char *destination = args[1]; + + if (destination == NULL) { + fprintf(stderr, gettext("Usage: stop (destination)\n")); + return (-1); + } + + status = papiPrinterPause(svc, destination, "paused via lpc"); + if (status != PAPI_OK) { + fprintf(stderr, gettext("stop: %s: %s\n"), destination, + verbose_papi_message(svc, status)); + return (-1); + } + + return (0); +} + +static int +lpc_topq(papi_service_t svc, char **args) +{ + papi_status_t status; + char *destination = args[1]; + int32_t id = atoi(args[2]); + + if (destination == NULL) { + fprintf(stderr, gettext("Usage: topq (destination) (id)\n")); + return (-1); + } + + status = papiJobPromote(svc, destination, id); + if (status != PAPI_OK) { + fprintf(stderr, gettext("topq: %s %d: %s\n"), destination, id, + verbose_papi_message(svc, status)); + return (-1); + } + + return (0); +} + +static int +lpc_up(papi_service_t svc, char **args) +{ + int rc = 0; + + rc += lpc_enable(svc, args); + rc += lpc_start(svc, args); + + return (rc); +} + +static int +lpc_down(papi_service_t svc, char **args) +{ + int rc = 0; + + rc += lpc_disable(svc, args); + rc += lpc_stop(svc, args); + + return (rc); +} + +static int lpc_help(papi_service_t svc, char **args); /* forward reference */ + +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; + int (*handler)(papi_service_t svc, char **args); + char *help_string; + int num_args; +} cmd_tab[] = { + { "?", lpc_help, help_help, 0 }, + { "help", lpc_help, help_help, 0 }, + { "exit", lpc_exit, help_exit, 0 }, + { "quit", lpc_exit, help_exit, 0 }, + { "status", lpc_status, help_status, 1 }, + { "abort", lpc_abort, help_abort, 1 }, + { "clean", lpc_clean, help_clean, 1 }, + { "disable", lpc_disable, help_disable, 1 }, + { "down", lpc_down, help_down, 2 }, + { "enable", lpc_enable, help_enable, 1 }, + { "restart", lpc_restart, help_restart, 1 }, + { "start", lpc_start, help_start, 1 }, + { "stop", lpc_stop, help_stop, 1 }, + { "up", lpc_up, help_up, 1 }, + { "topq", lpc_topq, help_topq, 2 }, + { NULL, NULL, NULL, 0 } +}; + +static int +lpc_handler(char *cmd, cmd_handler_t **handler) +{ + int i; + + for (i = 0; cmd_tab[i].cmd != NULL; i++) + if (strcmp(cmd, cmd_tab[i].cmd) == 0) { + *handler = cmd_tab[i].handler; + return (cmd_tab[i].num_args); + } + return (-1); +} + +static char * +lpc_helptext(char *cmd) +{ + int i; + + for (i = 0; cmd_tab[i].cmd != NULL; i++) + if (strcmp(cmd, cmd_tab[i].cmd) == 0) + return (gettext(cmd_tab[i].help_string)); + return (NULL); +} + +/* ARGSUSED0 */ +static int +lpc_help(papi_service_t svc, char **args) +{ + if (args[1] == NULL) { + int i; + + printf(gettext("Commands are:\n\n")); + for (i = 0; cmd_tab[i].cmd != NULL; i++) { + printf("\t%s", cmd_tab[i].cmd); + if ((i % 7) == 6) + printf("\n"); + } + if ((i % 7) != 6) + printf("\n"); + } else { + char *helptext = lpc_helptext(args[1]); + + if (helptext == NULL) + helptext = gettext("no such command"); + + printf("%s: %s\n", args[1], helptext); + } + + return (0); +} + +static int +process_one(int (*handler)(papi_service_t, char **), char **av, int expected) +{ + int rc = -1; + papi_status_t status = PAPI_OK; + papi_service_t svc = NULL; + char *printer = av[1]; + + if ((printer != NULL) && (expected != 0)) { + status = papiServiceCreate(&svc, printer, NULL, NULL, + cli_auth_callback, encryption, NULL); + if (status != PAPI_OK) { + fprintf(stderr, gettext( + "Failed to contact service for %s: %s\n"), + printer, verbose_papi_message(svc, status)); + } + } + + if (status == PAPI_OK) + rc = handler(svc, av); + + if (svc != NULL) + papiServiceDestroy(svc); + + return (rc); +} + +static int +process_all(int (*handler)(papi_service_t, char **), char **av, int expected) +{ + papi_status_t status; + papi_service_t svc = NULL; + char **printers; + int rc = 0; + + status = papiServiceCreate(&svc, NULL, NULL, NULL, NULL, + encryption, NULL); + if (status != PAPI_OK) { + fprintf(stderr, gettext("Failed to contact service: %s\n"), + verbose_papi_message(svc, status)); + return (-1); + } + + if ((printers = interest_list(svc)) != NULL) { + int i; + + for (i = 0; printers[i] != NULL; i++) { + av[1] = printers[i]; + rc += process_one(handler, av, expected); + } + } + + papiServiceDestroy(svc); + + return (rc); +} + +static int +process(int ac, char **av) +{ + int (*handler)(papi_service_t, char **) = NULL; + int num_args = -1; + + char *printer = av[1]; + int rc = -1; + + if ((num_args = lpc_handler(av[0], &handler)) < 0) { + printf(gettext("%s: invalid command\n"), av[0]); + return (-1); + } + + if (((printer != NULL) && (strcmp(printer, "all") != 0)) || + (num_args <= ac)) + rc = process_one(handler, av, num_args); + else + rc = process_all(handler, av, num_args); + + return (rc); +} + +static void +usage(char *program) +{ + char *name; + + if ((name = strrchr(program, '/')) == NULL) + name = program; + else + name++; + + fprintf(stdout, + gettext("Usage: %s [ command [ parameter...]]\n"), + name); + exit(1); +} + +static void +lpc_shell() +{ + for (;;) { + char line[256]; + char **av = NULL; + int ac = 0; + + /* prompt */ + fprintf(stdout, "lpc> "); + fflush(stdout); + + /* get command */ + if (fgets(line, sizeof (line), stdin) == NULL) + exit(1); + if ((av = strsplit(line, " \t\n")) != NULL) + for (ac = 0; av[ac] != NULL; ac++); + + (void) process(ac, av); + free(av); + } +} + +int +main(int ac, char *av[]) +{ + int result = 0; + int c; + + (void) setlocale(LC_ALL, ""); + (void) textdomain("SUNW_OST_OSCMD"); + + while ((c = getopt(ac, av, "E")) != EOF) + switch (c) { + case 'E': + encryption = PAPI_ENCRYPT_ALWAYS; + break; + default: + usage(av[0]); + } + + if (optind == ac) + lpc_shell(); + else + result = process(optind - 2, &av[optind]); + + return (result); +} |