print.c revision 2
37c79205ad46187f54b2edbf6a468160935f14d9Joshua M. Clulow * CDDL HEADER START
37c79205ad46187f54b2edbf6a468160935f14d9Joshua M. Clulow * The contents of this file are subject to the terms of the
37c79205ad46187f54b2edbf6a468160935f14d9Joshua M. Clulow * Common Development and Distribution License (the "License").
37c79205ad46187f54b2edbf6a468160935f14d9Joshua M. Clulow * You may not use this file except in compliance with the License.
37c79205ad46187f54b2edbf6a468160935f14d9Joshua M. Clulow * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
37c79205ad46187f54b2edbf6a468160935f14d9Joshua M. Clulow * or http://www.opensolaris.org/os/licensing.
37c79205ad46187f54b2edbf6a468160935f14d9Joshua M. Clulow * See the License for the specific language governing permissions
37c79205ad46187f54b2edbf6a468160935f14d9Joshua M. Clulow * and limitations under the License.
37c79205ad46187f54b2edbf6a468160935f14d9Joshua M. Clulow * When distributing Covered Code, include this CDDL HEADER in each
37c79205ad46187f54b2edbf6a468160935f14d9Joshua M. Clulow * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
37c79205ad46187f54b2edbf6a468160935f14d9Joshua M. Clulow * If applicable, add the following below this CDDL HEADER, with the
37c79205ad46187f54b2edbf6a468160935f14d9Joshua M. Clulow * fields enclosed by brackets "[]" replaced with your own identifying
37c79205ad46187f54b2edbf6a468160935f14d9Joshua M. Clulow * information: Portions Copyright [yyyy] [name of copyright owner]
37c79205ad46187f54b2edbf6a468160935f14d9Joshua M. Clulow * CDDL HEADER END
37c79205ad46187f54b2edbf6a468160935f14d9Joshua M. Clulow * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
37c79205ad46187f54b2edbf6a468160935f14d9Joshua M. Clulow * Use is subject to license terms.
37c79205ad46187f54b2edbf6a468160935f14d9Joshua M. Clulow/* Copyright (c) 1988 AT&T */
37c79205ad46187f54b2edbf6a468160935f14d9Joshua M. Clulow/* All Rights Reserved */
37c79205ad46187f54b2edbf6a468160935f14d9Joshua M. Clulow * University Copyright- Copyright (c) 1982, 1986, 1988
37c79205ad46187f54b2edbf6a468160935f14d9Joshua M. Clulow * The Regents of the University of California
37c79205ad46187f54b2edbf6a468160935f14d9Joshua M. Clulow * All Rights Reserved
37c79205ad46187f54b2edbf6a468160935f14d9Joshua M. Clulow * University Acknowledgment- Portions of this document are derived from
37c79205ad46187f54b2edbf6a468160935f14d9Joshua M. Clulow * software developed by the University of California, Berkeley, and its
37c79205ad46187f54b2edbf6a468160935f14d9Joshua M. Clulow * contributors.
37c79205ad46187f54b2edbf6a468160935f14d9Joshua M. Clulow#pragma ident "%Z%%M% %I% %E% SMI"
37c79205ad46187f54b2edbf6a468160935f14d9Joshua M. Clulow#include <signal.h> /* use this file to determine if this is SVR4.0 system */
37c79205ad46187f54b2edbf6a468160935f14d9Joshua M. Clulow/* global variables */
37c79205ad46187f54b2edbf6a468160935f14d9Joshua M. Clulowstatic int onecolumn = 0; /* print a single column */
37c79205ad46187f54b2edbf6a468160935f14d9Joshua M. Clulowstatic int width = 60; /* width of multi-column printing */
37c79205ad46187f54b2edbf6a468160935f14d9Joshua M. Clulowstatic int restrictterm = 1; /* restrict termcap names */
37c79205ad46187f54b2edbf6a468160935f14d9Joshua M. Clulow/* local variables */
37c79205ad46187f54b2edbf6a468160935f14d9Joshua M. Clulowstatic int printed = 0;
37c79205ad46187f54b2edbf6a468160935f14d9Joshua M. Clulowstatic char capbools[] =
37c79205ad46187f54b2edbf6a468160935f14d9Joshua M. Clulow "ambsbwdadbeoeshchshzinkmmimsncnsosptulxbxnxoxsxt";
37c79205ad46187f54b2edbf6a468160935f14d9Joshua M. Clulowstatic int ncapbools = sizeof (capbools) / sizeof (capbools[0]);
37c79205ad46187f54b2edbf6a468160935f14d9Joshua M. Clulowstatic char capnums[] =
37c79205ad46187f54b2edbf6a468160935f14d9Joshua M. Clulow "codBdCdFdNdTknlipbsgug";
static char capstrs[] =
if (term == (char *)0)
switch ((int)printing) {
case (int)pr_terminfo:
case (int)pr_cap:
case (int)pr_longnames:
pr_bheading(void)
printed = 0;
int vlen;
if (onecolumn) {
if (value < 0)
switch ((int)printing) {
case (int)pr_terminfo:
case (int)pr_cap:
case (int)pr_longnames:
switch ((int)printing) {
case (int)pr_terminfo:
case (int)pr_cap:
case (int)pr_longnames:
switch ((int)printing) {
case (int)pr_longnames:
switch ((int)printing) {
case (int)pr_terminfo:
case (int)pr_longnames:
case (int)pr_cap:
printed = 0;
if (printed == 0) {
switch ((int)printing) {
case (int)pr_terminfo:
case (int)pr_cap:
case (int)pr_longnames:
switch ((int)printing) {
case (int)pr_terminfo:
case (int)pr_longnames:
case (int)pr_cap:
printed++;
if (value < 0)
switch ((int)printing) {
case (int)pr_terminfo:
case (int)pr_cap:
case (int)pr_longnames:
switch ((int)printing) {
case (int)pr_terminfo:
case (int)pr_cap:
case (int)pr_longnames:
pr_bfooting(void)
switch ((int)printing) {
case (int)pr_terminfo:
case (int)pr_longnames:
case (int)pr_cap:
pr_nheading(void)
printed = 0;
int vlen;
if (onecolumn) {
if (value < 0)
switch ((int)printing) {
case (int)pr_terminfo:
case (int)pr_cap:
case (int)pr_longnames:
switch ((int)printing) {
case (int)pr_terminfo:
value);
case (int)pr_cap:
case (int)pr_longnames:
value);
switch ((int)printing) {
case (int)pr_terminfo:
case (int)pr_cap:
case (int)pr_longnames:
switch ((int)printing) {
case (int)pr_terminfo:
case (int)pr_longnames:
case (int)pr_cap:
printed = 0;
if (printed == 0) {
switch ((int)printing) {
case (int)pr_terminfo:
case (int)pr_cap:
case (int)pr_longnames:
switch ((int)printing) {
case (int)pr_terminfo:
case (int)pr_longnames:
case (int)pr_cap:
printed++;
if (value < 0) {
switch ((int)printing) {
case (int)pr_terminfo:
case (int)pr_cap:
case (int)pr_longnames:
switch ((int)printing) {
case (int)pr_terminfo:
value);
case (int)pr_cap:
case (int)pr_longnames:
value);
pr_nfooting(void)
switch ((int)printing) {
case (int)pr_terminfo:
case (int)pr_longnames:
case (int)pr_cap:
pr_sheading(void)
printed = 0;
char *evalue;
int badcapvalue;
if (value)
if (onecolumn) {
switch ((int)printing) {
case (int)pr_terminfo:
case (int)pr_cap:
case (int)pr_longnames:
switch ((int)printing) {
case (int)pr_terminfo:
case (int)pr_cap:
case (int)pr_longnames:
switch ((int)printing) {
case (int)pr_terminfo:
case (int)pr_cap:
if (badcapvalue)
nlen++;
case (int)pr_longnames:
switch ((int)printing) {
case (int)pr_terminfo:
case (int)pr_longnames:
case (int)pr_cap:
printed = 0;
if (printed == 0) {
switch ((int)printing) {
case (int)pr_terminfo:
case (int)pr_cap:
case (int)pr_longnames:
switch ((int)printing) {
case (int)pr_terminfo:
case (int)pr_longnames:
case (int)pr_cap:
printed++;
switch ((int)printing) {
case (int)pr_terminfo:
case (int)pr_cap:
case (int)pr_longnames:
switch ((int)printing) {
case (int)pr_terminfo:
evalue);
case (int)pr_cap:
if (badcapvalue) {
evalue);
case (int)pr_longnames:
evalue);
pr_sfooting(void)
if (onecolumn) {
if (printed > 0)
switch ((int)printing) {
case (int)pr_terminfo:
case (int)pr_longnames:
case (int)pr_cap: