pswpriv.h revision 824
824N/A/*
824N/A * pswpriv.h
824N/A *
824N/A * (c) Copyright 1988-1994 Adobe Systems Incorporated.
824N/A * All rights reserved.
824N/A *
824N/A * Permission to use, copy, modify, distribute, and sublicense this software
824N/A * and its documentation for any purpose and without fee is hereby granted,
824N/A * provided that the above copyright notices appear in all copies and that
824N/A * both those copyright notices and this permission notice appear in
824N/A * supporting documentation and that the name of Adobe Systems Incorporated
824N/A * not be used in advertising or publicity pertaining to distribution of the
824N/A * software without specific, written prior permission. No trademark license
824N/A * to use the Adobe trademarks is hereby granted. If the Adobe trademark
824N/A * "Display PostScript"(tm) is used to describe this software, its
824N/A * functionality or for any other purpose, such use shall be limited to a
824N/A * statement that this software works in conjunction with the Display
824N/A * PostScript system. Proper trademark attribution to reflect Adobe's
824N/A * ownership of the trademark shall be given whenever any such reference to
824N/A * the Display PostScript system is made.
824N/A *
824N/A * ADOBE MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THE SOFTWARE FOR
824N/A * ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
824N/A * ADOBE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
824N/A * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
824N/A * NON- INFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL ADOBE BE LIABLE
824N/A * TO YOU OR ANY OTHER PARTY FOR ANY SPECIAL, INDIRECT, OR CONSEQUENTIAL
824N/A * DAMAGES OR ANY DAMAGES WHATSOEVER WHETHER IN AN ACTION OF CONTRACT,
824N/A * NEGLIGENCE, STRICT LIABILITY OR ANY OTHER ACTION ARISING OUT OF OR IN
824N/A * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ADOBE WILL NOT
824N/A * PROVIDE ANY TRAINING OR OTHER SUPPORT FOR THE SOFTWARE.
824N/A *
824N/A * Adobe, PostScript, and Display PostScript are trademarks of Adobe Systems
824N/A * Incorporated which may be registered in certain jurisdictions
824N/A *
824N/A * Author: Adobe Systems Incorporated
824N/A */
824N/A/* $XFree86: xc/config/pswrap/pswpriv.h,v 1.6 2000/06/07 21:58:25 tsi Exp $ */
824N/A
824N/A#ifndef PSWPRIV_H
824N/A#define PSWPRIV_H
824N/A
824N/A#include <stdio.h>
824N/A
824N/A#include "pswtypes.h"
824N/A#include "psw.h"
824N/A
824N/A/********************/
824N/A/* Types */
824N/A/********************/
824N/A
824N/Atypedef struct _t_ItemRec *Item;
824N/A/* Forward type designator */
824N/A
824N/Atypedef struct {
824N/A boolean constant;
824N/A int val; /* valid if constant */
824N/A char *name; /* valid if not constant */
824N/A } SubscriptRec, *Subscript, ScaleRec, *Scale;
824N/A
824N/Atypedef int Type;
824N/A
824N/Atypedef struct _t_ItemRec { /* see above */
824N/A struct _t_ItemRec *next;
824N/A char *name;
824N/A boolean starred, subscripted, scaled;
824N/A Subscript subscript; /* valid if subscripted */
824N/A Scale scale;
824N/A
824N/A /* the fields below are filled in by PSWHeader */
824N/A boolean isoutput; /* true if this is an output parameter */
824N/A long int tag; /* valid if output is true; the index of
824N/A this output parameter. starting from 0. */
824N/A Type type; /* copied from parent Arg */
824N/A int sourceLine;
824N/A } ItemRec;
824N/A
824N/Atypedef Item Items;
824N/A
824N/Atypedef struct _t_ArgRec {
824N/A struct _t_ArgRec *next;
824N/A Type type;
824N/A Items items;
824N/A } ArgRec, *Arg;
824N/A
824N/Atypedef Arg Args;
824N/A
824N/Atypedef struct {
824N/A boolean isStatic;
824N/A char *name;
824N/A Args inArgs, outArgs;
824N/A } HeaderRec, *Header;
824N/A
824N/Atypedef struct {
824N/A long cnst;
824N/A char *var;
824N/A } Adr, *PAdr;
824N/A
824N/Atypedef struct _t_TokenRec {
824N/A struct _t_TokenRec *next;
824N/A Type type;
824N/A Adr adr; /* of this token in the binary object sequence. */
824N/A char *val; /* loopholed */
824N/A int tokenIndex;
824N/A boolean wellKnownName; /* valid if type is T_NAME or T_LITNAME */
824N/A int sourceLine;
824N/A Item namedFormal;
824N/A /* non-NIL if this token is a reference to a formal.
824N/A (T_STRING, T_HEXSTRING, T_NAME, and T_LITNAME) */
824N/A Adr body;
824N/A /* Meaning depends on the token type, as follows:
824N/A simple => unused
824N/A array or proc => adr of body in binobjseq
824N/A string or hexstring => adr of body in binobjseq
824N/A name or litname => adr of namestring or array in binobjseq (named arg)
824N/A or cnst = the nametag (well-known name)
824N/A or cnst = 0 (name index filled in at runtime)
824N/A subscripted => index for element
824N/A */
824N/A} TokenRec, *Token;
824N/A
824N/Atypedef Token Tokens;
824N/A
824N/Atypedef Tokens Body;
824N/A
824N/Atypedef struct _t_TokenListRec {
824N/A struct _t_TokenListRec *next;
824N/A Token token;
824N/A } TokenListRec, *TokenList;
824N/A
824N/Aextern FILE *header;
824N/Aextern boolean noUserNames; /* -n flag */
824N/Aextern char *currentPSWName;
824N/Aextern char *hfile;
824N/Aextern char *ifile; /* input file name for error messages */
824N/Aextern char *ofile;
824N/Aextern char *prog;
824N/Aextern char *special_h; /* -f option */
824N/Aextern char *string_temp; /* buffer of that size for scanning strings */
824N/Aextern char headid[];
824N/Aextern int bigFile;
824N/Aextern int doANSI; /* -a flag */
824N/Aextern int maxstring; /* max PS string length to scan (-s) */
824N/Aextern int lexdebug; /* debug flag for lexer */
824N/Aextern int errorCount; /* non-fatal errs */
824N/Aextern int outlineno; /* line number in output file */
824N/Aextern int pad; /* -p flag */
824N/Aextern int reentrant;
824N/Aextern int reportedPSWName;
824N/Aextern int yylineno; /* current line number in pswrap source file */
824N/A
824N/A/* lexer.l */
824N/Aextern int yylex(void);
824N/Aextern void stringerr(int); /* report string overflow */
824N/A
824N/A/* psw.c */
824N/Aextern void EmitPrototype(Header);
824N/Aextern void EmitBodyHeader(Header);
824N/Aextern void EmitBody(Tokens, Header);
824N/Aextern void FreeBody(Body);
824N/A
824N/A/* pswfile.c */
824N/Aextern void FinishHFile(void);
824N/Aextern void InitHFile(void);
824N/Aextern void InitOFile(void);
824N/A
824N/A/* pswparser.y */
824N/Aextern int yyparse (void);
824N/A
824N/A/* systemnames.c */
824N/Aextern void InitWellKnownPSNames(void);
824N/A
824N/A/* yyerror.c */
824N/Aextern void ErrIntro(int);
824N/Aextern void yyerror(char *);
824N/A
824N/A#endif /* PSWPRIV_H */