📄 xlc_init.c
字号:
#ifndef lintstatic char *sccsid = "@(#)xlc_init.c 4.1 ULTRIX 7/2/90";#endif/* file: xlc_init - Translator initialization routines * created: gh 26-MAR-1986 09:10:31 * edit: gh 27-MAR-1986 08:41:50 Fixing default horiz. tab stops * gh 7-APR-1986 13:52:30 Changing default itemlist PFS vals * gh 10-APR-1986 13:47:44 Fixed bug in (), * added ps state initialization in state_init. * Added xl_st.orientation initialization in state_init() * gh 23-APR-1986 08:19:59 Changing state_init() because * XLATE.H structures changed. * gh 24-APR-1986 09:08:14 Changed SGR structure name * Changing state_init to not init PS variables, but to * call ps_init(). Adding last_showpage init. * gh 29-APR-1986 10:12:10 Adding xl_st.sheet_len itlzation * gh 1-MAY-1986 10:43:07 Changing default states of * lfnl and ssu modes to FALSE and DECIPT. * gh 3-JUN-1986 15:01:50 Item list selecting landscape * mode only sets orientation - scan_items should return * value of 21 - changed that. * gh 13-JUN-1986 08:01:58 Changing the initialization of * .plf * nv 27-JUN-1986 15:03:30 Renamed 'xl_st.curchar.attrs' to * 'xl_st .requested_attributes.' * nv 10-JUL-1986 17:47:49 Incorporated new function called * reset_pitch (). * Revised the way xl_st .propl_mode is initialized. * nv 12-JUL-1986 08:13:22 Removed the initialization of * the obsolute variables 'opm' and 'pcf'. * Initialized 'psel_mode'. * Removed redundant initialization in reset_pitch * of .character_proportion and .cur_sgr. * Added comments. * laf 30-JUL-1986 10:36:02 Removed reference to unused * variable "pdef" * laf 27-AUG-1986 14:29:07 Added initz'n of xl_st. * curchar.ul_avp to state_init(). * * araj 7-OCT-1986 17:22:00 added * initialization for max_bound * nv 17-OCT-1986 11:23:24 Remove all reference to 'hsi'. * nv 21-OCT-1986 17:02:49 Remove initialization of * 'xl_st .shorp' from 'reset_pitch'; it is initialized * in 'state_init'. * Remove initialization of 'xl_st .vai' from * 'reset_pitch'; it is calculated as a result of the * call to 'compute_font'. * Changed the initialization of 'xl_st .vai' and * 'xl_st .hsi' to be semi-proportional. * nv 22-OCT-1986 09:59:29 Redesigned 'htabs_init' and * 'vtabs_init'. * nv 22-OCT-1986 13:40:06 Added current sgr initialization * with pfs initialization in 'scan_items' to make the * initial sgr paper size and orientation dependent. * nv 21-NOV-1986 17:58:25 In 'scan_items' initialized and * conditionally set 'xl_st .vm_size'. * mgb 13-JAN-1987 16:01:09 Adding option to have sixels * converted into hex or binary output. Routine that was * modified was scan_items(). * mgb 13-JAN-1987 16:04:24 removed parameted list from * state_init() since it is not used. * kws 13-FEB-1987 15:16:19 Added B size and legal paper * support. * kws 13-MAR-1987 15:17:08 Select SGR 10 by default with * B size paper. * * araj 27-MAR-1987 20:41:29 added support for 2 new * output modes. * * araj 30-MAR-1987 12:40:37 * changed to use official names for the 2 new * output modes * * araj 1-APR-1987 13:39:38 * Modified to swap height and width when landscape * is selected. * * kws 13-MAY-1987 16:14:26 * SPR ICA-04651. Format page for A4 landscape * when selected from print command. Page is * currently formatted for A landscape. * * mgb 7-JUL-1987 13:31:43 * Put break in case statement that sets VM size. * If you send VM size you would set 7 bit also which * is not good. * * Also added #if SYMBIONT_DEBUG prints. * * araj 16-JUL-1987 20:23:44 * Attempt to fix LPS40 QAR 144, by undoing Keith's * 13-may change to termmanag, and moving the * default initialization of SGR to here. Added * defaulting to SGR of 1 if no paper size/orientation * is passed to us. * * mgb 19-JAN-1988 16:12:51 * Common Parser update - changed parse_init() to * cp_init(). Changed c to cp_c. * * mgb 27-JAN-1988 16:33:05 * Spilt xlate.h into xlate.h & capdl.hc for the * common parser. Later capdl.def of the common * parser will have capdl.hc. * * tep 26 May 1988 13:18 * 15 June 1988 16:02 - changes to enable sixel_font * for sixel translation * * kws 23-SEP-1988 17:15:12 * Take VM size passed by the symbiont as gospel. * Only account for the size of the prologue if * it has not been preloaded. * * kws 17-OCT-1988 16:50:23 * Add initialization for all paper sizes supported * by a PS machine and selected via the print command * line. Fill in the PFSBOUNDS structure for format * and limit bounds for all PFS and DECVPFS paper * sizes. * * kws 23-OCT-1988 18:57:19 * Change sixel output default back to binary from * sixelfont. * * kws 24-OCT-1988 10:18:02 * Add xlc_init.def * * cp 20-MAR-1989 * Changed declaration of output_sixel functions as * returning 'BYTE' rather than 'int' for Ultrix port. * * araj 28-MAR-1989 11:09 * fix scan items, (separate scanning from decision making) * replace #if symbiont_debug with ps_trace_macro * * araj 29-MAR-1989 14:31 * Changed default SGR to be 0, not 1. * * araj 10-APR-1989 09:09 * changed ps_trace_macro to item_trace_macro * * araj 12-APR-1989 11:32 * added processing for SGR item * * ejs 13-APR-1989 10:24 * last_showpage is a symbiont function and is moved to * xlc_main * bf 3-OCT-1989 10:20 * Change scan_items() to fix two problems: * A) Was using 10 cpi instead of 10.3 cpi font for * A4 paper size, * B) Was resetting an incorrect Font size on DECSTR * or RIS for certain paper sizes in Landscape. * Both problems were due to the SGR value passed down * from the symbiont not being manipulated correctly. *//************************************************************************ * * * COPYRIGHT (c) DIGITAL EQUIPMENT CORPORATION 1985, * * 1986, 1987, 1988, 1989 * * ALL RIGHTS RESERVED. * * * * THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE * * USED AND COPIED ONLY IN ACCORDANCE WITH THE TERMS OF * * SUCH LICENSE AND WITH THE INCLUSION OF THE ABOVE * * COPYRIGHT NOTICE. THIS SOFTWARE OR ANY OTHER COPIES * * THEREOF MAY NOT BE PROVIDED OR OTHERWISE MADE * * AVAILABLE TO ANY OTHER PERSON. NO TITLE TO AND * * OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED. * * * * THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE * * WITHOUT NOTICE AND SHOULD NOT BE CONSTRUED AS A * * COMMITMENT BY DIGITAL EQUIPMENT CORPORATION. * * * * DIGITAL ASSUMES NO RESPONSIBILITY FOR THE USE OR * * RELIABILITY OF ITS SOFTWARE ON EQUIPMENT THAT IS NOT * * SUPPLIED BY DIGITAL. * ************************************************************************/#include "portab.h"#include "capdl.hc"#include "xlate.h"#include "trn$.hc"#include "dbug.h"#include "xlc_codegen.hc"#include "xlc_init.hc"/********************************************************************** * This module contains: * --------------------- * * scan_items () * **********************************************************************//* Declaration of structures: *//* * External functions referenced: */READONLY EXTERNAL BYTE output_sixel_in_bin(), output_sixel_in_hex(), output_sixel_as_font();/* * Internal variable declarations: *//***** scan_items() *************************************************** * * * Scan items list pointed to by 'item_ptr'. Item codes dealing * * with default font, device type, line feed, header, and double * * spacing are ignored. An items code value = 0 terminates the * * list scanning. Default values of page width, height, and * * orientation are set to correspond to a North American Portrait. * * Item codes refering to page width, height, and page orientation * * are accepted, and the corresponding variables are updated. * * When finished, a match is attempted to one of eight formats, * * and a PFS code is returned as follows: * * PFS = 20 indicates Portrait, North American * * PFS = 21 indicates Landscape, North American * * PFS = 22 indicates Portrait, A4 * * PFS = 23 indicates Landscape, A4 * * PFS = 24 indicates Portrait, legal * * PFS = 25 indicates Landscape, legal * PFS = 26 indicates Portrait, B * * PFS = 27 indicates Landscape, B * * The last-showpage flag in xl_st is set to TRUE, unless an item * * code comes in for page-fragment, in which case it will be FALSE * ************************************************************************/VOID scan_items(item_ptr)ITEM *item_ptr; { LONG width, height, swap_buffer; UBYTE orient; /* * Set up defaults for a Portrait extended North American format */ width = 612; height = 792; orient = 0; cg_st.cgst_item_list_sgr = 0; /* this is an item to override the SGR assoicated with paper * or define one for thos that don't have any */ cg_st.cpinit_vals.initial_sgr = 0; /* default, in case not in itemlist * this is the one that will be used whether * it came from default, paper size, or item_list_sgr */ cg_st.cpinit_vals.initial_pfs = decpfstbl[20 - FIRST_PRIVATE_PFS];
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -