home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Monster Media 1993 #2
/
Image.iso
/
clipper
/
doors10.zip
/
DOORS.501
/
DOS.CH
< prev
next >
Wrap
Text File
|
1993-06-13
|
12KB
|
275 lines
/* FILE dos.ch
* Author Chuck Burfoot
* Created Wed 05-08-1991
* Mod Tue 12-17-1991
* Changed #defines to #xtranslates
*
* Purpose Defines for DOS Function Calls - INT x21
* Note, The default association for DS is SI,
* The default assocaition for ES is DI
* Use the OFFSET define to move a copy of DI/SI to DX/BX
* AS Needed
(C) Copyright, Codesmythe, Inc., 1993
(C) Copyright, Charles A. Burfoot, 1991
All Rights Reserved
*** */
#ifndef x0A
#include "regs.ch"
#endif
#ifndef DOSCH
#define DOSCH
#ifdef I_CONTROLL
#xtranslate db_ver => ;
{||REGS := { B2INT(x33)+6,,,,,,}, ;
df_dos( x21, @REGS ), ;
IIF( _BX != 0, _BL+(_BH/100),(REGS := { B2INT(x30),,,,,,},;
IIF( df_dos( x21, @REGS ), (_AL+(_AH/100)), -1 ))) }
#xtranslate db_curdrive => ;
{|| REGS := { B2INT(x19),,,,,,}, ;
IIF( df_dos( x21, @REGS ), CHR(_AL+65), "" ) }
#xtranslate db_changedrive => ;
{|z| IIF( z = NIL, .T. , ;
( z := ASC(UPPER(SUBSTR(z,1,1)))-65, ;
REGS := { B2INT(x0E),,,z,,,,}, df_dos( x21, @REGS ) )) }
#xtranslate db_lastdrive => ;
{|| REGS := { B2INT(x19),,,,,,}, ;
IIF( df_dos( x21, @REGS ), ;
( REGS := { B2INT(x0E),,,_AL,,,}, df_dos( x21, @REGS ),;
CHR(_AL+64)),"") }
#xtranslate db_drivesize => ;
{|z| IIF( z = NIL, z := 0, ;
z := ASC(UPPER(SUBSTR(z,1,1)))-64), ;
REGS := { B2INT(x1C),,,z,,,}, df_dos( x21, @REGS ), ;
IIF( AL > 0, (_AL*_CX*_DX), -1 ) }
#xtranslate db_curdir => ;
{|z| IIF( z = NIL, z := 0, ;
z := ASC(UPPER(SUBSTR(z,1,1)))-64), ;
REGS := { B2INT(x47),,,z,,,}, ;
SREGS := {REPLICATE(CHR(0),64),}, ;
IIF( df_dos( x21, @REGS , @SREGS ), _DS, "") }
#xtranslate db_mkdir => ;
{|z| REGS := { B2INT(x39),,,OFFSET,,,},;
SREGS := {z,}, df_dos( x21, @REGS , @SREGS ) }
#xtranslate db_rmdir => ;
{|z| REGS := { B2INT(x3A),,,OFFSET,,,}, ;
SREGS := {z,}, df_dos( x21, @REGS , @SREGS ) }
#xtranslate db_chdir => ;
{|z| REGS := { B2INT(x3B),,,OFFSET,,,,}, ;
SREGS := {z,}, df_dos( x21, @REGS , @SREGS ) }
#xtranslate db_getdate => ;
{|| REGS := { B2INT(x2A),,,,,,}, ;
IIF( df_dos( x21, @REGS ), {_AL, _DH, _DL, _CX}, {-1} ) }
#xtranslate db_setdate => ;
{|iMo, iday, iyr| iif( valtype( iMo ) == 'D', ;
( iMo := dtoc( iMo ), iDay := val( substr( iMo, 4, 2) ),;
iYr := val( substr( iMo, 7, 2 ) ), ;
iMo := val( substr( iMo, 1, 2 ) ) ), ), ;
REGS := { B2INT(x2B),,int(iif( iyr > 1980, iYr, iYr+1900)), ;
B2INT(INT(iMo))+INT(iDay),,,,}, ;
IIF( df_dos( x21, @REGS ), _AL = 0, .f. ) }
#xtranslate db_gettime => ;
{|| REGS := { B2INT(x2C),,,,,,}, ;
IIF( df_dos( x21, @REGS ), {_CH, _CL, _DH, _DL} , ;
{-1} ) }
#xtranslate db_settime => ;
{|iHr, iMin, iSec| iif( valtype( iHr ) == 'C' , ;
( iSec := val( substr( iHr, 7, 2)), ;
iMin := val( substr( iHr, 4, 2 )), ;
iHr := val( substr( iHr, 1, 2 )) ), ), ;
REGS := { B2INT(x2D),,B2INT(INT(iHr))+iMin, iif( iSec <> NIL, B2INT(iSec),),,,}, ;
IIF( df_dos( x21, @REGS ), _AL = 0, _AL = 0 ) }
#xtranslate db_isverify => ;
{|| REGS := { B2INT(x54),,,,,,}, df_dos( x21, @REGS ), _AL>0 }
#xtranslate db_setverify => ;
{|z| REGS := { B2INT(x2E)+z,,,,,,}, df_dos( x21, @REGS ) }
#xtranslate db_getpsp => ;
{|| REGS := { B2INT(x62),,,,,,}, df_dos( x21, @REGS ), _BX }
#else
#xtranslate db_ver => ;
{|| df_calldos( x21, { B2INT(x33)+6,,,,,,} ), ;
IIF( _BX != 0, _BL+(_BH/100), ;
IIF( df_calldos( x21, { B2INT(x30),,,,,,} ),;
(_AL+(_AH/100)), -1 )) }
#xtranslate db_curdrive => ;
{|| IIF( df_calldos( x21, { B2INT(x19),,,,,,} ), CHR(_AL+65), "" ) }
#xtranslate db_changedrive => ;
{|z| IIF( z == NIL, .T. , ;
( z := ASC(UPPER(SUBSTR(z,1,1)))-65, ;
df_calldos( x21, { B2INT(x0E),,,z,,,,} ) )) }
#xtranslate db_lastdrive => ;
{|| IIF( df_calldos( x21, { B2INT(x19),,,,,,} ), ;
( df_calldos( x21, { B2INT(x0E),,,_AL,,,} ),CHR(_AL+64)),"") }
#xtranslate db_drivesize => ;
{|z| IIF( z = NIL, z := 0, ;
z := ASC(UPPER(SUBSTR(z,1,1)))-64), ;
df_calldos( x21, { B2INT(x1C),,,z,,,} ), ;
IIF( AL > 0, (_AL*_CX*_DX), -1 ) }
#xtranslate db_curdir => ;
{|z| IIF( z = NIL, z := 0, ;
z := ASC(UPPER(SUBSTR(z,1,1)))-64), ;
IIF( df_calldos( x21, { B2INT(x47),,,z,,,} , {REPLICATE(CHR(0),64),} ), _DS, "") }
#xtranslate db_mkdir => ;
{|z| df_calldos( x21, { B2INT(x39),,,OFFSET,,,}, {z,} ) }
#xtranslate db_rmdir => ;
{|z| df_calldos( x21, { B2INT(x3A),,,OFFSET,,,}, {z,} ) }
#xtranslate db_chdir => ;
{|z| df_calldos( x21, { B2INT(x3B),,,OFFSET,,,,}, {z,} ) }
#xtranslate db_getdate => ;
{|| IIF( df_calldos( x21, { B2INT(x2A),,,,,,}), ;
{_AL, _DH, _DL, _CX}, {-1} ) }
#xtranslate db_setdate => ;
{|iMo, iday, iyr| iif( valtype( iMo ) == 'D', ;
( iMo := dtoc( iMo ), iDay := val( substr( iMo, 4, 2) ),;
iYr := val( substr( iMo, 7, 2 ) ), ;
iMo := val( substr( iMo, 1, 2 ) ) ), ), ;
IIF( df_calldos( x21, ;
{ B2INT(x2B),,int(iif( iyr > 1980, iYr, iYr+1900)), ;
B2INT(INT(iMo))+INT(iDay),,,,} ),;
_AL = 0, .f. ) }
#xtranslate db_gettime => ;
{|| IIF( df_calldos( x21, { B2INT(x2C),,,,,,}), ;
{_CH, _CL, _DH, _DL} , {-1,,,} ) }
#xtranslate db_settime => ;
{|iHr, iMin, iSec| iif( valtype( iHr ) == 'C' , ;
( iSec := val( substr( iHr, 7, 2)), ;
iMin := val( substr( iHr, 4, 2 )), ;
iHr := val( substr( iHr, 1, 2 )) ), ), ;
IIF( df_calldos( x21, ;
{ B2INT(x2D),,B2INT(INT(iHr))+iMin,;
iif( iSec <> NIL, B2INT(iSec),),,,} ), ;
_AL = 0, _AL = 0 ) }
#xtranslate db_isverify => ;
{|| df_calldos( x21, { B2INT(x54),,,,,,} ), _AL>0 }
#xtranslate db_setverify => ;
{|z| df_calldos( x21, { B2INT(x2E)+z,,,,,,} ) }
#xtranslate db_getpsp => ;
{|| df_calldos( x21, { B2INT(x62),,,,,,} ), _BX }
#endif
#xtranslate db_getcmdline => ;
{|iPsp,iLen| iPsp := dp_getpsp(), ;
iLen := ASC(df_memset(iPsp,x80,1)), ;
IIF( iLen > 0, df_memset(iPsp,x82,iLen), "") }
#xtranslate db_maxfiles => ;
{|iPsp,iVal, iFiles| iPsp := dp_getpsp(), ;
iVal := ASC(df_memset(iPsp, x32, 2)), ;
iFiles := df_dosfile(), IIF( iVal <= iFiles, iVal, iFiles)}
#xtranslate dp_ver() => ;
EVAL( db_ver )
#xtranslate dp_curdrive() => ;
EVAL( db_curdrive )
#xtranslate dp_driveno(<x>) => ;
(ASC(UPPER( SUBSTR( <x>, 1,1)))-64)
#xtranslate dp_changedrive(<x>) => ;
EVAL( db_changedrive, <x> )
#xtranslate dp_lastdrive() => ;
EVAL( db_lastdrive )
#xtranslate dp_drivesize([<x>]) => ;
EVAL( db_drivesize [, <x>] )
#xtranslate dp_curdir([<x>]) => ;
EVAL( db_curdir [, <x>] )
#xtranslate dp_mkdir(<x>) => ;
EVAL( db_mkdir , <x> )
#xtranslate dp_rmdir(<x>) => ;
EVAL( db_rmdir, <x> )
#xtranslate dp_chdir(<x>) => ;
EVAL( db_chdir, <x> )
#xtranslate dp_getdate() => ;
EVAL( db_getdate )
#xtranslate dp_setdate(<mo> [,<day> ,<yr>] ) => ;
EVAL( db_setdate, <mo> [,<day>, <yr>] )
#xtranslate dp_gettime() => ;
EVAL( db_gettime )
#xtranslate dp_settime( <hr> [,<min> ] [, <sec>] ) => ;
EVAL( db_settime, <hr> [,<min> ] [, <sec>] )
#xtranslate dp_isverify() => ;
EVAL( db_isverify )
#define DO_NOT_VERIFY 0
#define VERIFY_WRITES 1
#xtranslate dp_setverify(<x>) => ;
EVAL( db_serverify, <x> )
#xtranslate dp_getpsp() => ;
EVAL( db_getpsp )
#ifndef POKE_VALUE
#define PEEK_STRING 0
#define PEEK_VALUE 1
#define POKE_STRING 0
#define POKE_VALUE 1
#endif
#xtranslate dp_getcmdline() => ;
EVAL( db_getcmdline ) )
#xtranslate dp_maxfiles() => ;
EVAL( db_maxfiles )
/* Function checks MAXFILES, NOT Max files available if any opened, This is
faster and provides PRIMARY assurance of the RESOURCE ALLOCATION, NOT
Full TRACK DOWN OF resource consumption */
#endif
/*--<EOF dos.ch >--*/