build.c revision e5190c108bde19ca4d7c03b1d1eab7b00bd3a1ed
/*
* 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 1989 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
/*
* University Copyright- Copyright (c) 1982, 1986, 1988
* The Regents of the University of California
* All Rights Reserved
*
* University Acknowledgment- Portions of this document are derived from
* software developed by the University of California, Berkeley, and its
* contributors.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <stdio.h>
/*
*
* These variables are used to save and later restore the post-processor's
* environment.
*
*/
int ohpos;
int ovpos;
int ofont;
int osize;
int env = 0; /* nonzero if environment is saved */
extern int hpos;
extern int vpos;
extern int font;
extern int size;
extern char *fontdir;
extern char devname[];
/*****************************************************************************/
int
char *name; /* start reading from this file */
int size; /* may use it to get the file */
{
/********************************************************************
* *
* Used when we want to take the post-processor's input from *
* a different file for a while. Added to handle problems with the *
* new logos, but it could easily be used to define other special *
* characters. *
* *
********************************************************************/
return(1);
save_env();
restore_env();
return(0);
} /* End of newfile */
/*****************************************************************************/
char *name; /* start reading from this file */
int size; /* size of the character to print */
{
/********************************************************************
* *
* First tries to open file *name.size in the right directory, *
* and if it can't then it tries *name. Returns the file pointer *
* or NULL if either file can't be opened. *
* *
********************************************************************/
} /* End if */
return(fp);
} /* End of charfile */
/*****************************************************************************/
int
save_env()
{
/********************************************************************
* *
* Before we start reading from a different file we'll want *
* to save the values of the variables that will be needed to get *
* back to where we were. *
* *
********************************************************************/
hflush();
env = 1;
return (0);
} /* End of save_env */
/*****************************************************************************/
int
{
/********************************************************************
* *
* Hopefully does everything needed to get the post-processor *
* back to where it was before the input was diverted. *
* *
********************************************************************/
env = 0;
return (0);
} /* End of restore_env */
/*****************************************************************************/
int
{
int ch; /* first character of the command */
int c, n; /* used in reading chars from *fp */
/********************************************************************
* *
* A restricted and slightly modified version of the conv() *
* routine found in all of troff's post-processors. It should only *
* be used to interpret the special character building files found *
* *
********************************************************************/
switch ( ch ) {
case 'w': /* just ignore these guys */
case ' ':
case '\n':
case 0:
break;
case 'c': /* single ASCII character */
break;
case 'C': /* special character */
break;
case 'h': /* relative horizontal motion */
hmot(n);
break;
case 'v':
vmot(n);
break;
case 'x': /* device control - font change only */
if ( str[0] == 'f' ) {
} /* End if */
break;
case 's': /* set point size */
break;
case 'f': /* use this font */
break;
case 'b':
oput(n);
break;
case 'W':
putint(n);
break;
case '#': /* comment */
break;
} /* End switch */
} /* End while */
return (0);
} /* End of nconv */
/*****************************************************************************/