
DOSTAB.DLL - Edit files that use DOS tabs without changing appearance

	The purpose of this package is to let you edit DOS files and any
	other files that use 8-column tabs without having to set your
	Codewright tab settings for 8-column tabs.  It optionally
	retabifies each file opened so that, while you edit the file,
	it retains the same appearance that it has under DOS, but you
	can set your tabstops arbitrarily.
	
	This DLL installs three event handlers.  One is called whenever a
	file is opened for editing.  It replaces tabs in leading whitespace
	with the appropriate number of spaces for the given tab settings.
	It may then convert the leading spaces back to tabs, according to
	the current buffer's tab settings.  Another handler is called when
	a file is saved.  It performs the inverse operation.  The third
	handler duplicates the operation of the first, converting the buffer
	back for editing.
	
	Buffers that were not converted on read will not be converted
	on write.
	
	This package contains the source for DOSTAB.DLL and compiled
	versions of the DLL's for various flavors of Codewright.  To
	install it, copy the appropriate DLL to your CWRIGHT or CWVC directory.
	Then add a LibPreload line to the [LibPreload] section of the
	appropriate configuration file (in your CWRIGHT or CWVC directory).

	Use the table below:

	Product Name           DLL Name      LibPreload Line          Config. File
	__________________________________________________________________________
	Codewright 3.1         DOSTAB.DLL    LibPreload=DOSTAB.DLL    CWRIGHT.INI
	Codewright Fusion 1.5  DOSTABV.DLL   LibPreload=DOSTABV.DLL   CWVC.INI
	Codewright 3.1 for NT  DOSTB32.DLL   LibPreload=DOSTB32.DLL   CWRIGHT.INI
	Codewright Fusion 2.0  DOSTBV32.DLL  LibPreload=DOSTBV32.DLL  CWVC.INI

					
	Then, add the following line to the [Editor] section:
	
		TabInstallHandler=

	and that's all there is to it.  When you load or save a file,
	you will be asked whether or not you want to convert tabs for
	that file.

	
	This package provides several API calls besides the handlers
	themselves:


	BOOL TabSetConvert(BOOL convert)
	
		If convert is FALSE, then if the event handlers are installed,
		the current buffer will not be converted when it is saved.
		The effect of this call can be reversed by issuing it again,
		with an argument of TRUE.
	

	BOOL TabInstallHandler
	
		Activates the event handlers, the operation of which is
		described above.  If all the handlers were installed
		successfully, the return value is TRUE; otherwise, it
		is FALSE.
	

	BOOL TabRemoveHandler
	
		Deactivates the event handlers.  A return value of TRUE
		indicates that all handlers were successfully removed.
	
	
	void DeTabBuffer(LPSTR tabString)
	
		Converts all leading whitespace to spaces.  This function
		is similar in functionality to DeTab(), but is a little
		faster, lets you specify an arbitrary tab string, and
		only operates on leading whitespace.
	

	void EnTabBuffer(LPSTR tabString)
	
		Converts all leading whitespace to the optimal combination
		of tabs and spaces.  This function is similar in functionality
		to EnTab(), but is a little faster, lets you specify an
		arbitrary tab string, and only operates on leading whitespace.
	

	void ReTabBuffer(LPSTR inputTabString, LPSTR outputTabString)
	
		Converts a document that was tabbed according to
		inputTabString to one that is tabbed according to
		outputTabString.
	

	void EnTabThisLine
	
		Tabifies the current line according to the current buffer's
		tab specification, without changing its appearance.
	

	void DeTabThisLine    

		Detabifies the current line according to the current buffer's
		tab specification, without changing its appearance.
	

	BOOL TabConfirm(BOOL confirm)
	
		Turns confirmation prompting on or off.

	
	int TabSpacesOnly(int spacesOnly)
	
		Determines whether or not tabs are used when documents are
		retabified.  If spacesOnly is zero (the default), the
		applicable default buffer settings are used, as set in
		the File Type Properties and Model Buffer Settings dialogs.
		If spacesOnly is greater than zero, then all retabification
		done by this package will use only space characters; if
		spacesOnly is a negative number, then the optimal combination
		of spaces and tabs will be used.

	
	int NextTab(int column, LPSTR tabString)
	
		Reports the next tabstop to the right of the given column,
		using the given tab specification.
	

	
	CAVEATS:
	
	The process of entabbing and detabbing buffers is slow.
	
	When a buffer is saved, even when it is saved as part of a close
	operation, it is retabbed, then written, then retabbed again
	for further editing.  Retabbing means converting tabs to spaces
	then back to tabs.  This process can take up to 10 seconds for
	a 1000-line file on a 486/66.



																 
Copyright (C) 1995 Premia Corporation	
