home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Black Box 4
/
BlackBox.cdr
/
progc
/
itcjun90.arj
/
TAB.H
< prev
next >
Wrap
Text File
|
1991-09-07
|
2KB
|
66 lines
/************************************************
* TAB.H - function prototypes for tab & entab *
* *
* 900424 MCMason - written for Turbo C v2.0 *
************************************************/
#define TRUE (1==1)
#define FALSE (!TRUE)
extern void entab(char [], char []);
extern void detab(char [], char []);
#if !defined(TAB) || ((TAB!=1)&&(TAB!=2))
#error TAB must be defined to either 1 or 2
#endif
#if TAB==1
/************************************************
* Technique #1 - computed tabs *
************************************************/
#ifdef TABMAN
int _tabSize;
#else
extern int _tabSize;
#endif
#define setTab(x) (_tabSize=x)
#define isTab(x) (!(x%_tabSize))
#define clrTab(x)
#define initTab()
#else /* TAB==2 */
/************************************************
* Technique #2 - use bit arrays *
************************************************/
#if !defined(BitList)
#include "bitlist.h"
#endif
#define MAXTAB 70 /* Max column number */
#define initTab() {tabList=blCreate(MAXTAB);}
#define setTab(x) blSetBit(tabList,x,1)
#define isTab(x) ((x>=MAXTAB) ? TRUE :\
blGetBit(tabList,x))
#if !defined(TABMAN) /* && TAB==2 */
extern BitList tabList;
void clrTab(int);
#else /* defined(TABMAN) && TAB==2 */
BitList tabList; /* List of tabstops */
/********************************************
* clrTab - remove one or all tabstops *
* *
* INP: t - tabstop to remove, -1 for all *
********************************************/
void clrTab(int t)
{
if (t==-1) /* Remove all? */
blListOp(blCLEAR,tabList); /* YES */
else
blSetBit(tabList,t,0); /* NO */
}
#endif /* defined(TABMAN) && TAB==2 */
#endif /* TAB==2 */