XFSAPI 1.0: DLL Interface for XFS 1.85
Robert Juhasz (robertj@lwfws1.uni-paderborn.de)
September 5, 1994
CHANGES
* MOUNTOPT
* XfsMountPrinter
CHANGES:
* XFSINFO struct
* Login & Logout
The XFSAPI consists of two DLL's:
* XFSLIB: The API, allows mounting/unmounting etc.
* XFSFMX: The User Interface (some dialogs) for the FMX which can also
be used by own applications.
Files:
* XFSAPI.PAS: Borland Pascal 7.0 unit
* XFSAPI.H: Borland C++ header
* XFSLIB.DLL: The XFSAPI
* XFSFMX.DLL: The File Manager Extension
* XFSLIB.LIB: Import library
* XFSFMX.LIB: Import library
* USEAPI.PAS: Borland Pascal example
* USEAPI.C: Borland C++ example
* USEAPI.PRJ: Borland C++ project file for USEAPI
Maybe I should not talk about, but XFSAPI needs a CPU >= 80386.
1. XFSLIB.DLL
=============
/*
* Check for XFS
*/
function XfsInstalled: Bool;
BOOL WINAPI XfsInstalled(VOID);
/*
* Mount a drive
* Return: < 0: Network errors (see XFSAPI.H or XFSAPI.PAS)
* = 0: OK
* > 0: Redirector errors
* Eg.:
* XfsMountDrive("F:", "speedy", "/usr/share/dos", &opts );
*
* NOTE: The 'hosts' file must be placed in the same directory as
* XFSFMX.DLL and XFSLIB.DLL
* You can also use dotted IP addresses instead host names:
* XfsMountDrive("F:", "131.234.218.1", ...);
*/
function XfsMountDrive(localdrive, host, filesystem: PChar; var options: TMOUNTOPT): Integer;
int WINAPI XfsMountDrive(LPSTR localdrive, LPSTR host, LPSTR filesystem, LPMOUNTOPT options);
/*
* Mount a printer
* Return: < 0: Network errors
* = 0: OK
* > 0: Redirector errors
* Eg.:
* XfsMountPrinter("LPT1:", "speedy", "laser", options);
*/
function XfsMountPrinter(localdrive, host, printer: PChar; var options:TMOUNTOPT): Integer;
int WINAPI XfsMountPrinter(LPSTR localdrive, LPSTR host, LPSTR printer, LPMOUNTOPT options);
/*
* Unmount a drive/device
* Return: < 0: Network errors
* = 0: OK
* > 0: Redirector errors
* Eg.:
* XfsUmount("F:"); or XfsUmount("LPT1:");
*/
function XfsUmount(localdrive: PChar ): Integer;
int WINAPI XfsUmount(LPSTR localdrive);
/*
* Flush printer job avoiding the timeout
* Return: none
*
* Eg.:
* XfsFlush("LPT1:");
*/
function XfsFlush(printer: PChar ): Integer;
int WINAPI XfsFlush(LPSTR printer);
/*
* PCNFSD Login. `host' is the pcnfsd server
* Return: < 0: Network errors
* = 0: OK
*/
function XfsLogin( localdrive, host, name, password: PChar ): Integer;
int WINAPI XfsLogin(LPSTR localdrive, LPSTR host, LPSTR name, LPSTR password);
/*
* PCNFSD Logout
*/
procedure XfsLogout( localdrive: PChar);
VOID WINAPI XfsLogout( LPSTR localdrive );
/*
* Get XFS info
*/
procedure XfsNetStat( var info: TXFSINFO );
VOID WINAPI XfsNetStat( LPXFSINFO info);
/*
* Umask [similar to clib's umask()]: set the file creation mask
* Return: old umask
*/
function XfsUmask( mask: Word): Word;
WORD WINAPI XfsUmask( WORD mask);
/*
* Enum redirections
* Return: = 0: OK
* <> 0: no redirections
* Eg.:
* char dev[127], res[127];
* int i = 0;
* while( WGetRedirection(i++, dev, res) == 0 )
* printf("%s %s\n", dev, res);
*
* Note: You can enumerate all redirections AND unmount them:
*
* while( WGetRedirection(0, dev, res) == 0) XfsUnmount(dev);
* === (it's realy zero!)
*/
function WGetRedirection( index: Word; device, resource: PChar ): Word;
UINT WINAPI WGetRedirection( UINT index, LPSTR device, LPSTR resource );
2. XFSFMX.DLL
=============
/*
* Init the FileManager Extension (FMX)
* Return <> 0: OK
*/
function InitFMX: Longint;
LONG WINAPI InitFMX( VOID );
/*
* Make FMX call
* Eg.:
* // Popup the Mount Dialog with `Handle' as Parent Window
* XfsFMXCall( Handle, CM_MOUNT);
*
* See XFSAPI.H or XFSAPI.PAS for valid calls.
* NOTE: This functions returns always zero. It will return success
* or error codes after I have determined, that the FileManager
* isn't worry about. The FMX API consists of calls to "FMExtensionProc"
* only (see your SDK manual, section File Manager Extensions).
*/
function XfsFMXCall( Handle: HWnd; call: Word): Longint;
LONG WINAPI XfsFMXCall( HWND Handle, WORD call);
/*
* Unload the extension. It saves the history and does clean-ups.
*
* Note: The call of this function is required! I can't include
* it in WEP.
*/
procedure DoneFMX;
VOID WINAPI DoneFMX( VOID );