FATS - Fast Access Tree System
Table of Contents
Programming Interfaces
MS-Pascal for OS/2

MS-Pascal for OS/2


 
OS/2 Libraries FATS_O16.DLL / FATSXO16.DLL

The diskette "FATS for OS/2" contains the dynamic link libraries FATS_O16.DLL (basis version) resp. FATSXO16.DLL (extended version), that must be copied into the system directory of OS/2:

COPY FATS?O16.DLL \OS2\DLL

The libraries are exporting the following functions:

type FATSDLLPASSTR = lstring(255);

function FATSLibInit(uDatasize: word; uSign: word): integer4; external;

function FATSLibExit(lpFatsdata: integer4): integer4; external;

function FATSLibCall(vars szCmnd: FATSDLLPASSTR;vars nErrorcode: word;vars szFatsKey: FATSDLLPASSTR;lpFatsdata: integer4) : integer4; external;

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

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

lpFatsdata = FATSLibInit(0, 1);

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 Pascal this value must equal to 1. 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 OS/2 contains some test programs in the directory OS2_16I\PASCAL\MS that illustrate how you can use the FATS commands in your programs:

 tst0_eng.pasMS-Pascal (uses FBSPAS)
 tst1_eng.pasMS-Pascal (uses FATSCALL)
 rebuild.pasRe-Indexing a Data File (commands 'BK', 'DL')

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

 tst2_eng.pasIntroduction to the Matchcode Functions
 mcsort.pasUse of the key-flag with command 'MC'
 reindex.pasFast Re-Indexing with the command 'XB'

 
Compatible Programming Interfaces

You also can use the interfaces provided by the FABS PLUS modules. Please take notice of the additional information at pages  4-77, 9-77, 9-77 and 9-77.

The following FABS interfaces are available:

FBSPASEntry point in FATS.OBJ
FBPAS1"
FBPAS2"


 

© 2008  GCS Software, Udo Gertz