FATS - Fast Access Tree System
Table of Contents
Programming Interfaces
Turbo C, Borland C, C++ for Windows 3.x

Turbo C, Borland C, C++ for Windows 3.x


 
Windows Libraries FATS_WIN.DLL / FATSXWIN.DLL

The diskette "FATS for Windows 3.x" contains the dynamic link libraries FATS_WIN.DLL (basis version) resp. FATSXWIN.DLL (extended version), that must be copied into the system directory of Windows:

COPY FATS?WIN.DLL \WINDOWS\SYSTEM

The libraries are exporting the following functions:

void _far * _far _pascal FATSLibInit(unsigned int uDatasize, unsigned int uSign);

void _far * _far _pascal FATSLibExit(void _far *lpFatsdata);

unsigned long _pascal FATSLibCall(char _far *szCmnd,int _far *nErrorcode, char _far *szFatsKey, void _far *lpFatsdata)

On the FATS distribution diskette in the directory WIN_16I you find the import libraries FATS_WIN.LIB (basis version) resp. FATSXWIN.LIB (extended version) that are supported for linking with your programs.

Before you can use the FATS commands in your Turbo-C program, you must assign a data area to FATS:

lpFatsdata = FATSLibInit(0, 2)

The first parameter determines the size of the FATS data area. If you indicate a zero here, then the minimum needed storage space is reserved (approx. 18-20 KB). The second parameter intends the assigned programming language, for C this value must equal to 2. The address of the data area is returned in the variable lpFatsdata.

Before terminating the application program you should release the storage area allocated by FATSLibInit. You can do this by calling the function FATSLibExit:

lpFatsdata = FATSLibExit(lpFatsdata);

Although the storage area would be released automatically by the operating system, this instruction is useful, since it closes all FATS files that are still opened.

 
Calling FATS

FATS commands are executed with the function FATSLibCall:

dwRecno = FATSLibCall(szCmnd, &nErrorcode, szFatsKey, lpFatsdata);

Parameter Usage:

szCmndCommand string (input)
nErrorcodeErrorcode (output)
szFatsKeyKey value (output)
lpFatsdataAddress of FATS data area (input)
Return Value:Record Number

 
Testprograms

The FATS distribution disk for Windows 3.x contains some test programs in the directory WIN_16I\C\BORLAND that illustrate how you can use the FATS commands in your programs:

 tst1_eng.cTest program for Turbo-C / Borland C for Windows
 rebuild.cRe-Indexing a Data File (commands 'BK', 'DL')

The extended version of FATS contains the following additional test programs:

 tst2_eng.cIntroduction to the Matchcode Functions
 mcsort.cUse of the key-flag with command 'MC'
 reindex.cFast Re-Indexing with the command 'XB'


 

© 2008  GCS Software, Udo Gertz