* IsUtil.idf 

   Internal interfaces used in the ISAM utilities.

   Last edited
     120980 KRD  Created.
*

$SAVE NOLIST

*CONSTANTS*

$IF IsuErc
$RESTORE

DECLARE
  ercInstallError        LITERALLY '1000'

 ,ercCreateError         LITERALLY '1010'
 ,ercCreateSucceeded     LITERALLY '1011'

 ,ercBadIndexParam       LITERALLY '1020'
 ,ercBadNumericParam     LITERALLY '1021'
 ,ercBadFlagParam        LITERALLY '1022'
 ,ercMissingParam        LITERALLY '1023'
 ,ercNotSingleParam      LITERALLY '1024'

 ,ercConfirm             LITERALLY '1030'
 ,ercConfirmed           LITERALLY '1031'
 ,ercOkToDelete          LITERALLY '1032'
 ,ercIOErrorMsg          LITERALLY '1033'
 ,ercDenied              LITERALLY '1034'

 ,ercIsamError           LITERALLY '1040'
 ,ercIsamDetail          LITERALLY '1041'

 ,ercOpenError           LITERALLY '1050'
 ,ercCloseError          LITERALLY '1051'
 ,ercLoadError           LITERALLY '1052'
 ,ercLoadSucceeded       LITERALLY '1053'
 ;

$SAVE NOLIST
$ENDIF


*PROCEDURES*

$IF GetSingleParam
$RESTORE

* Read a string parameter from a subsys parameter.
 * There must be only one parameter on the line.
 * If fRequired is false, then there may be none (returns null string).
 * If anything goes wrong, this displays a message and sets fBadParam.
 *

GetSingleParam: PROCEDURE (iParam, fRequired, pSdRet) EXTERNAL;
DECLARE
  iParam WORD
 ,fRequired FlagType
 ,pSdRet POINTER
 ;
END GetSingleParam;

$SAVE NOLIST
$ENDIF
$IF GetWordParam
$RESTORE

* Read a word parameter from a subsys parameter.
 * There must be only one parameter on the line.
 * If wDefault is ONES, then there must be a parameter.
 * If anything goes wrong, this displays a message and sets fBadParam.
 *

GetWordParam: PROCEDURE (iParam, wDefault, pWRet) EXTERNAL;
DECLARE
  iParam WORD
 ,wDefault WORD
 ,pWRet POINTER
 ;
END GetWordParam;

$SAVE NOLIST
$ENDIF
$IF GetQuadParam
$RESTORE

* Read a 4byte integer parameter from a subsys parameter.
 * There must be only one parameter on the line.
 * If qDefault.low is ONES, then a parameter must be supplied.
 * If anything goes wrong, this displays a message and sets fBadParam.
 *

GetQuadParam: PROCEDURE (iParam, qDefault, pQRet) EXTERNAL;
DECLARE
  iParam WORD
 ,qDefault QUAD
 ,pQRet POINTER
 ;
END GetQuadParam;

$SAVE NOLIST
$ENDIF
$IF GetFlagParam
$RESTORE

* Read a flag parameter from a subsys parameter.
 * There must be only one parameter on the line.
 * Default is FALSE.
 * If anything goes wrong, this displays a message and sets fBadParam.
 *

GetFlagParam: PROCEDURE (iParam, pFRet) EXTERNAL;
DECLARE
  iParam WORD
 ,pFRet POINTER
 ;
END GetFlagParam;

$SAVE NOLIST
$ENDIF
$IF GetIndexParams
$RESTORE

* Read a set of index key specs from a subsys parameter.
 * There must be isamDesc.cIndexes parameters on the line.
 * If anything goes wrong, this displays a message and sets fBadParam.
 *

GetIndexParams: PROCEDURE (iParam, pIsamDesc) EXTERNAL;
DECLARE
  iParam WORD
 ,pIsamDesc POINTER
 ;
END GetIndexParams;

$SAVE NOLIST
$ENDIF

* Error message procs *

$IF Display0
$RESTORE

Display0: PROCEDURE (erc) EXTERNAL;
DECLARE
  erc ErcType
 ;
END Display0;

$SAVE NOLIST
$ENDIF
$IF Display1
$RESTORE

Display1: PROCEDURE (erc, pArg0) EXTERNAL;
DECLARE
  erc ErcType
 ,pArg0 POINTER
 ;
END Display1;

$SAVE NOLIST
$ENDIF
$IF Display2
$RESTORE

Display2: PROCEDURE (erc, pArg0, pArg1) EXTERNAL;
DECLARE
  erc ErcType
 ,pArg0 POINTER
 ,pArg1 POINTER
 ;
END Display2;

$SAVE NOLIST
$ENDIF
$IF DisplayIOError
$RESTORE

DisplayIOError: PROCEDURE (erc, pbFSpec, cbFSpec) EXTERNAL;
DECLARE
  erc ErcType
 ,pbFSpec POINTER
 ,cbFSpec WORD
 ;
END DisplayIOError;

$SAVE NOLIST
$ENDIF
$IF DisplayISAMError
$RESTORE

DisplayISAMError: PROCEDURE (erc, oIsb) EXTERNAL;
DECLARE
  erc ErcType
 ,oIsb OFFSET
 ;
END DisplayISAMError;

$SAVE NOLIST
$ENDIF
$IF MapErcSd
$RESTORE

MapErcSd: PROCEDURE (erc,pSdRet) EXTERNAL;
* make pSdRet^ refer to a message decoding the erc *
DECLARE
  erc ErcType
 ,pSdRet POINTER
 ;
END MapErcSd;

$SAVE NOLIST
$ENDIF
$IF GetConfirmation
$RESTORE

*Get a confirmdeny response
 *

GetConfirmation: PROCEDURE FlagType EXTERNAL;
END GetConfirmation;

$SAVE NOLIST
$ENDIF

* Misc procs *

$IF CheckDelete
$RESTORE

* Delete a file, possibly asking for user confirmation.
 *

CheckDelete: PROCEDURE (pbFSpec, cbFSpec, pbPw, cbPw, fNoConfirm) EXTERNAL;
DECLARE
  pbFSpec POINTER
 ,cbFSpec WORD
 ,pbPw POINTER
 ,cbPw WORD
 ,fNoConfirm FlagType
 ;
END CheckDelete;

$SAVE NOLIST
$ENDIF
$RESTORE

*END IsUtil.idf*
