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

📄 catabs.c

📁 <B>Digital的Unix操作系统VAX 4.2源码</B>
💻 C
📖 第 1 页 / 共 2 页
字号:
{#ifdef DUMP    {    oprintf("TBC HTCL \n");        }#endif    xl_st.htabct = 0;}/* ********************************************************************* *  Clear Vertical Tab at Active Column Function ********************************************************************* */VOID pr_vtac(){    WORD	i;#ifdef DUMP    {    oprintf("TBC VTAC \n");        }#endif    /* Look for a tab at the current position */    for (i=0; i< xl_st.vtabct; i++)      {    	if (xl_st.vtabs[i] == xl_st.curchar.ap.yval)  	{    		/* There is a tab at the current position - clear it */    		/* and move all remaining tabs down in the table */    		for (; i+1 < xl_st.vtabct; i++)    		        xl_st.vtabs[i] = xl_st.vtabs[i + 1];    		xl_st.vtabct--;    		break;    	}    }}/* ********************************************************************* *  Clear All Vertical Tabs Function ********************************************************************* */VOID pr_vtc(){#ifdef DUMP    {    oprintf("TBC VTC \n");        }#endif    xl_st.vtabct = 0;}/* ********************************************************************* *  Set Vertical Tab Stops Function ********************************************************************* */VOID dec_svts (){    WORD i;    LONG tab;#ifdef DUMP    {    oprintf("DECSVTS \n");        pprint();		    /* Print the parameter list */    }#endif    /* For each parameter in the list, ... */    for (i=0; i < CP_MAXPCNT; i++)     {    	cp_pbuf[i]--;    	tab = vdist(cp_pbuf[i]);	tab_tbl_insert (tab, &xl_st.vtabct, xl_st.vtabs, MAX_VTABS);    } /* endfor */}/* ********************************************************************* *  Set Horizontal Tab Stops Function ********************************************************************* */VOID dec_shts(){    WORD i;    LONG tab;#ifdef DUMP    {    oprintf("DECSHTS \n");        pprint();		    /* Print the parameter list */    }#endif    /* For each parameter in the list, ... */    for (i=0; i < CP_MAXPCNT; i++)     {    	cp_pbuf[i]--;    	tab = hdist(cp_pbuf[i]);	tab_tbl_insert (tab, &xl_st.htabct, xl_st.htabs, MAX_HTABS);    } /* endfor */} /* ********************************************************************* *  Move to next Horizontal Tab Function ********************************************************************* */VOID pr_ht(){    WORD i;#ifdef DUMP    {    oprintf("HT \n");        }#endif    /* Empty the justify buffer, if there is anything in it */    empty_jfy_buf();    /*      * IF there are any tabs in the tab table ...     */    if (xl_st.htabct != 0) {        /* Search tab table for next tabstop greater than the current ahp */        for (i=0; (i < xl_st.htabct) && (xl_st.htabs[i] <= xl_st.curchar.ap.xval); i++);        /* If there exists a tabstop which is greater than the current ahp,         * AND less than the right margin, then go to it.    	 * If the tabstop is past the right margin, then do a HPR(infinity)         */        if (i != xl_st.htabct) {            if (xl_st.htabs[i] >= xl_st.h_lim_bound.max) {		/* Do a HPR of infinity */    		hpos_rel(xl_st.h_lim_bound.max+1);            } else {	        xl_st.curchar.ap.xval = xl_st.htabs[i];	    }	/* if there are no greater tabstops in the table, ... */        } else if (i == xl_st.htabct) {	/* Do a HPR of infinity */    	hpos_rel(xl_st.h_lim_bound.max+1);	}    /* ... But if there are NO tabs in the tab table ... */    } else {	/* Do a HPR of infinity */    	hpos_rel(xl_st.h_lim_bound.max+1);    }}/* ********************************************************************* *  Move to next Vertical Tab Function ********************************************************************* */VOID pr_vt(){    WORD i;#ifdef DUMP    {    oprintf("VT \n");        }#endif    /* Empty the justify buffer, if there is anything in it */    empty_jfy_buf();    /* IF there are any tabs in the tab table ... */    if (xl_st.vtabct != 0) {        /* Search tab table for next tabstop greater than the current avp */    	for (i=0; (i<xl_st.vtabct) && (xl_st.vtabs[i] <= xl_st.curchar.ap.yval); 		i++)	    ;        /* If there exists a tabstop which is greater than the current avp,         * if it is below or AT the bottom margin, then do a form feed;         * Else make the tabstop the new avp.         */        if (i == xl_st.vtabct) {    	    vpos_abs (xl_st.v_lim_bound.max);        } else {    	    vpos_abs (xl_st.vtabs[i]); 	}       /* otherwise tab table was empty, so do <FF> */         } else  vpos_abs (xl_st.v_lim_bound.max);}/* ********************************************************************* *  Set Horizontal Tab at current position Function ********************************************************************* */VOID pr_hts()	/* sets a horizontal tab at the current ahp */{#ifdef DUMP    {    cp_exit_cur_mode();    oprintf("HTS \n");        }#endif    cp_exit_cur_mode();    tab_tbl_insert (xl_st.curchar.ap.xval, &xl_st.htabct, xl_st.htabs, MAX_HTABS);}/* ********************************************************************* *  Set Horizontal Tab at current position Function ********************************************************************* */VOID dec_hts(){#ifdef DUMP    {    oprintf("DECHTS \n");        }#endif    tab_tbl_insert (xl_st.curchar.ap.xval, &xl_st.htabct, xl_st.htabs, MAX_HTABS);}/* ********************************************************************* *  Set Vertical Tab at current position Function ********************************************************************* */VOID pr_vts()	/* Sets a vertical tab at the current avp */{#ifdef DUMP    {    cp_exit_cur_mode();    oprintf("VTS \n");        }#endif    cp_exit_cur_mode();    if (!xl_st.fcf)    	tab_tbl_insert (xl_st.curchar.ap.yval +     		FNT_ABOVE_BASELINE(xl_st.curchar.char_data.char_font)+1L,    		&xl_st.vtabct, xl_st.vtabs, MAX_VTABS);    else    	tab_tbl_insert (xl_st.curchar.ap.yval,     		&xl_st.vtabct, xl_st.vtabs, MAX_VTABS);}/* ********************************************************************* *  Set Vertical Tab at current position Function ********************************************************************* */VOID dec_vts(){#ifdef DUMP    {    oprintf("DECVTS \n");        }#endif    if (!xl_st.fcf)    	tab_tbl_insert (xl_st.curchar.ap.yval +     		FNT_ABOVE_BASELINE(xl_st.curchar.char_data.char_font)+1L,    		&xl_st.vtabct, xl_st.vtabs, MAX_VTABS);    else    	tab_tbl_insert (xl_st.curchar.ap.yval,     		&xl_st.vtabct, xl_st.vtabs, MAX_VTABS);}VOID scale_htabs(oldhai,newhai)LONG	oldhai,newhai;{    WORD	i;    /* If there are no entries in the tab table, exit */    if (xl_st.htabct == 0)		return;    /* If either old or new hai is =0, don't scale anything */    if (oldhai == 0 || newhai == 0)		return;    /* Go through each entry, and multiply it by the newhai, then divide it       by the oldhai. */    for (i=0; i<xl_st.htabct; i++)    	xl_st.htabs[i] = ((LONG)xl_st.htabs[i] * (LONG)newhai) /  (LONG)oldhai;}VOID scale_vtabs(oldvai,newvai)LONG	oldvai,newvai;{    WORD	i;    /* If there are no entries in the tab table, exit */    if (xl_st.vtabct == 0)		return;    /* If either old or new vai is =0, don't scale anything */    if (oldvai == 0 || newvai == 0)		return;    /* Go through each entry, and multiply it by the newvai, then divide it       by the oldvai. */    for (i=0; i<xl_st.vtabct; i++)    	xl_st.vtabs[i] = ((LONG)xl_st.vtabs[i] * (LONG)newvai) / (LONG)oldvai;}/************************************************************************    Clear All Horizontal Tabs - Dump Utility*************************************************************************/VOID dec_caht()   {#ifdef DUMP   {    oprintf("DECCAHT \n");       }#endif    xl_st.htabct = 0;   }

⌨️ 快捷键说明

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