lpmove.c revision 47129df6a4ecc85627c83c26614505a023c155c3
/*
* 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
*/
/*
*/
/* $Id: lpmove.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"
static void
{
char *name;
else
name++;
gettext("Usage: %s [request-id] (destination)\n"
exit(1);
}
static int
{
int result = 0;
result = -1;
}
return (result);
}
int
{
int exit_code = 0;
char *destination = NULL;
int c;
(void) textdomain("SUNW_OST_OSCMD");
switch (c) {
case 'E':
break;
default:
}
"Failed to contact service for %s: %s\n"),
exit(1);
}
exit_code = 1;
} else { /* it's a printer */
char message[128];
int count = 0;
/*
* If the user is denied the permission
* to disable then return appropriate msg
*/
/*
* Check if user is denied
* the permission
*/
!= NULL) {
/*
* user is denied
* permission
*/
gettext("ERROR: "));
"aren't allowed to do"
" that."));
gettext("TO FIX"));
"must be logged in as "
"\"lp\" or \"root\"."));
exit_code = 1;
} else {
"Reject %s: %s\n"),
exit_code = 1;
}
} else {
"Reject %s: %s\n"),
exit_code = 1;
}
} else {
"destination %s is not accepting"\
" requests\n"), printer);
0, 0, &jobs);
" %s\n"),
exit_code = 1;
}
id, destination) < 0)
exit_code = 1;
else
count++;
}
"total of %d requests moved"\
" from %s to %s\n"),
}
}
}
return (exit_code);
}