bsd-functions.c revision 355b4669e025ff377602b6fc7caaf30dbc218371
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (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 (c) 1998 by Sun Microsystems, Inc.
* All rights reserved.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#include <unistd.h>
#include <stdarg.h>
#include <syslog.h>
#ifndef SUNOS_4
#include <libintl.h>
#endif
extern char *getenv(const char *);
#include "bsd-functions.h"
static char *order[] = {
"", "st", "nd", "rd", "th", "th", "th", "th", "th", "th", "th" };
static char *
show_rank(int i)
{
static char rank[12];
if ((i%100)/10 == 1)
else
return (rank);
}
static int
{
}
return (0);
}
/*ARGSUSED*/
static int
{
return (0);
}
static int
{
int jobSize = 0,
*rank,
curr,
printIt = 0,
ac;
*printer,
**av;
return (0);
if (ac > 0) {
printIt++;
break;
}
} else
printIt++;
if (printIt != 0) {
if (format == SHOW_QUEUE_SHORT_REQUEST) {
(void) printf(
"%-7.7s%-8.8s %3.3d %-38.38s%d bytes\n",
} else {
(void) printf("%s: %-7.7s \t\t\t\t [job %.3d%s]\n",
(void) printf("\n");
}
}
return (0);
}
static int
{
int curr,
ac;
char *printer,
**av;
return (0);
if (ac == 0)
return (1);
return (1);
return (0);
}
void
clear_screen() /* for now use tput rather than link in UCB stuff */
{
}
int
{
int nd = -1,
idle = 0,
rc;
while (ac--) { /* potential SEGV if av's are more than BUFSIZ */
}
}
if (rc < 0)
#ifdef SUNOS_4
do {
} while (ac > 0);
#else
idle = 1;
}
#endif
}
if (nd < 0) {
"could not talk to print service at %s\n"),
server);
else
"could not locate server for printer: %s\n"),
printer);
}
"Rank\tOwner Job\tFiles\t\t\t\t\tTotal Size\n"));
}
if (format == SHOW_QUEUE_LONG_REQUEST)
(void) printf("\n");
nd = 1;
return (1);
else
return (0);
}