⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 castate.c

📁 <B>Digital的Unix操作系统VAX 4.2源码</B>
💻 C
📖 第 1 页 / 共 3 页
字号:
#ifndef lintstatic char SccsId[] = "  @(#)castate.c	4.1   LPS_ULT_TRN   7/2/90";#endif/* file: castate.c * *	COPYRIGHT  (c)  DIGITAL  EQUIPMENT CORPORATION 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. * *//* *----------------------------------------------------------- * *   begin edit_history * *    7-DEC-1987 13:51 mhw *      Initial Version * *   13-APR-1988 11:48 mhs *	Add routines for ac_dec_aupss and ac_dec_mac, to set the *      state table pointer. *      Add routines for ac_cr_sxl and ac_nl_sxl, to call dec_gcr *      and dec_gnl and then set the state to graphics SXL. * *  19-MAY-1988 16:48  mhw *	Corrected bug in ac_dec_lff.  Was (cpbuf[0] = 0) and should have been *	(cpbuf[0] == 0).  Bug caused lff never to be entered. * *  21-MAY-1988 13:57 araj *	Corrected ac_lff, so that the called routine can force ignore state. *	The state should be set before the routine is called, so it can be overwritten. * *   9-DEC-1988 15:59 mhw *	Corrected ac_dec_dtff so that it looks at cp_pbuf[0] for if the *	parameters are valid or not, instead of dcs_intro.ps1 which is not *	yet initialized at the time this routine is called. * *	Also fixed this type of problem in ac_dec_atff. *   *  16-DEC-1988 16:03 ejs *	Added routines to move from normal text mode to fast text mode. * *  18-JAN-1989 18:07 araj *	Added call to pr_ris and pr_str to exit CRM when the exit is caused by  *	ris or str	 * *   4-APR-1989 10:40 ejs *	ca_zap_repeat used to clean up sixel command processing.  New routine to *	handle command states, ac_do_store_cmd1. * *   end edit_history * *----------------------------------------------------------- *//* *----------------------------------------------------------- * *   begin description * *   Filename:  castate.c * *   This file contains the ANSI Change State Routines as *   described in the Common Action Routine Design Spec. * *   This file contains the following routines: *  *    ac_nop()	        ac_esc2()	       ac_scs() *    ac_text()          *    ac_esc_invalid()  ac_csi_invalid() *    ac_csi_startp()   ac_add_csip()          ac_add_csii() *    ac_csi_addp()      *    ac_dcs_invalid()  ac_dcs_ignore()	       ac_sxl_ignore() *    ac_dcs_startp()   ac_dcs_addp() *    ac_dec_lff()      ac_dec_atff()          ac_dec_dtff()  *    ac_dec_mac()      ac_dec_aupss()         ac_dec_graph() *    ac_dec_dld()       *    ac_store_cmd2()   ac_store_cmd1()        ac_add_dcs()       *    ac_crm()          ac_crm3()	       ac_crm4() *    ac_crm3_startp()  ac_crm3_addp()	       ac_crm_reset() *    ac_crm_lf()       ac_crm_ff()	       ac_crm_ris() *    ac_crm_c0()	ac_crm2_esc()	       ac_crm_str() *    ac_crm_c1()	ac_crm3_csi()	       ac_crm_crnr() *    ac_do_cmd2()      ac_start_cmd1()        ac_start_cmd2() *    ac_do_cr_sxl()    ac_do_nl_sxl()         ac_do_cmd1() *    ac_add_cmd1()     ac_add_cmd2()          ac_do_sxl() *    ac_do_store_cmd2() *    ac_gr_sxl()       ac_do_gr_sxl() *    ac_start_mac_rpt() *    ac_start_lff_rpt() *    ac_lff_term_ignore() *    ac_mac_term_ignore() *    ac_reset_start() *    ac_reset_font_lff() *    ac_reset_font_mac() *    ac_reset_lff() *    ac_reset_mac() *    ac_reset_sxl_lff() *    ac_reset_sxl_mac() *    ac_font_ignore() * *   end description * *----------------------------------------------------------- *//*  begin include_file    */#include    "portab.h"	    /* general portability constants */#include    "cpsys.hc"	    /* system wide constants, typedefs, etc. */#include    "cpast.hc"      /* ANSI State Table Declarations */#include    "cpglobal.hc"   /* Globals for all Parser files */#include    "caglobal.hc"   /* Globals for all CAR files *//*  end   include_file    *//****************************************************************************    NOP Routine*****************************************************************************/VOID ac_nop()    {     /* This routine does nothing */    }/****************************************************************************    NEL Routine*****************************************************************************/VOID ac_nel()   {    pr_nel();			/* Call the New Line function */    cp_exit_cur_mode();		/* Exit the currrent mode */   }/****************************************************************************    Set state to DCS_INVALID*****************************************************************************/VOID ac_dcs_invalid()   {    cp_setctptr(&ast_dcsinv);	/* Set Table Ptr to DCS_Invalid Table */   }/****************************************************************************    Set state to DCS_IGNORE*****************************************************************************/VOID ac_dcs_ignore()   {    cp_setctptr(&ast_dcsignore); /* Set Table Ptr to DCS_IGNORE Table */   }/****************************************************************************    Set state to SXL_IGNORE*****************************************************************************/VOID ac_sxl_ignore()   {    cp_setctptr(&ast_sxlignore); /* Set Table Ptr to SXL_IGNORE Table */   }/****************************************************************************    Enter ECS2 State*****************************************************************************/VOID ac_esc2()   {    cp_setctptr(&ast_esc2);	/* Set Table Ptr to ESC2 Table */    cp_add_to_esc_ibuf();	/* Add input to intermediate buffer */   }/****************************************************************************    Enter SCS State*****************************************************************************/VOID ac_scs()   {    cp_setctptr(&ast_scs);	/* Set Table Ptr to SCS Table */    cp_add_to_esc_ibuf();	/* Add input to intermediate buffer */   }/****************************************************************************    Set State to Text*****************************************************************************/VOID ac_text()   {    cp_setctptr(&ast_text);	/* Set Table Ptr to TEXT Table */   }VOID ac_fast_text_gl()   {    /* Wish it weren't so, but ssf becomes a special case.  It affects the     **	next character in the data stream.  The following character is allowed    **	to revert.  This means a change without an entry.    **	    Ex.	    <ss2>ab results in a coming from a different gset than b,    **		    yet the ab sequence would normally cause fast_text, thus    **		    b would have been processed with a's gset.    */    if (!xl_st.ssf)	{        cp_setctptr(&ast_fast_text_gl);	/* Set Table Ptr to FAST_TEXT_GL*/	} ;    pr_text();   }VOID ac_fast_text_gr()   {    if (!xl_st.ssf)	{	cp_setctptr(&ast_fast_text_gr);	/* Set Table Ptr to FAST_TEXT_GR*/	} ;    pr_text();   }VOID ac_fast_space()   {    if (!xl_st.ssf)	{	cp_setctptr(&ast_fast_text_gl);	/* Set Table Ptr to FAST_TEXT_GL*/	} ;    pr_space();   }VOID ac_abort_fast_text()   {    cp_setctptr(&ast_text);	/* Set Table Ptr to TEXT Table */      /* This is a little tricky. Instead of having multiple ac_abort_* to put   ** each function back to normal text mode, all fast text 'faults' go    ** through this routine.  To continue, the text table is used to vector.   */   (*cp_tok_tbl[astx_text[cp_c]])();   }/****************************************************************************    Set State to Invalid Escape*****************************************************************************/VOID ac_esc_invalid()   {    cp_setctptr(&ast_escinv);	/* Set Table Ptr to ESC Invalid Table */   }/****************************************************************************    Set State to Invalid CSI*****************************************************************************/VOID ac_csi_invalid()   {    cp_setctptr(&ast_csiinv);	/* Set Table Ptr to CSI Invalid Table */   }/****************************************************************************    Start a New Parameter and set the State to CSI_P*****************************************************************************/VOID ac_csi_startp()   {    cp_setctptr(&ast_csip);	/* Set Table Ptr to CSI_P Table */    cp_start_new_param();	/* Start a new Parmeter in the param. Buf */   }/****************************************************************************    Add input to Intermediate Buffer and set state to CSI_P*****************************************************************************/VOID ac_add_csip()   {    cp_setctptr(&ast_csip);	/* Set Table Ptr to CSI_P Table */    cp_add_to_csi_ibuf();	/* Add input to Intermediate Buffer */   }/****************************************************************************    Add input to Intermediate Buffer and set state to CSI_I*****************************************************************************/VOID ac_add_csii()   {    cp_setctptr(&ast_csii);	/* Set Table Ptr to CSI_I Table */    cp_add_to_csi_ibuf();	/* Add input to Intermediate Buffer */   }/****************************************************************************    Add input to Parameter Buffer and set state to CSI_P*****************************************************************************/VOID ac_csi_addp()   {    cp_setctptr(&ast_csip);	/* Set Table Ptr to CSI_P Table */    cp_add_to_cur_param();	/* Add input to current parameter */   }/****************************************************************************    Start new Parameter and set state to DCS_P*****************************************************************************/VOID ac_dcs_startp()   {    cp_setctptr(&ast_dcsp);	/* Set Table Ptr to DCS_P Table */    cp_start_new_param();	/* Start new Parameter */   }/****************************************************************************    Add to current Parameter and set state to DCS_P*****************************************************************************/VOID ac_dcs_addp()   {    cp_setctptr(&ast_dcsp);	/* Set Table Ptr to DCS_P Table */    cp_add_to_cur_param();	/* Add to Current Parameter */   }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -