(**************************************************************************

     $RCSfile: MathIEEESingBas.mod $
  Description: Interface to mathieeesingbas.library

   Created by: fjc (Frank Copeland)
    $Revision: 3.2 $
      $Author: fjc $
        $Date: 1994/08/08 00:56:52 $

  Includes Release 40.15

  (C) Copyright 1985-1993 Commodore-Amiga, Inc.
      All Rights Reserved

  Oberon-A interface Copyright © 1994, Frank Copeland.
  This file is part of the Oberon-A Interface.
  See Oberon-A.doc for conditions of use and distribution.

***************************************************************************)

MODULE MathIEEESingBas;

(*
** $C- CaseChk       $I- IndexChk  $L+ LongAdr   $N- NilChk
** $P- PortableCode  $R- RangeChk  $S- StackChk  $T- TypeChk
** $V- OvflChk       $Z- ZeroVars
*)

IMPORT SYS := SYSTEM, E := Exec, M := MathLibrary;

(*
**      $VER: mathieeesp.h 1.1 (13.7.90)
*)

(*
** Not ported.
*)

(*-- MathIEEESingBas Base variable --------------------------------------*)

TYPE

  MathIEEESingBasBasePtr * = CPOINTER TO MathIEEESingBasBase;
  MathIEEESingBasBase * = RECORD (M.MathIEEEBase) END;

CONST

  name * = "mathieeesingbas.library";

VAR

  base * : MathIEEESingBasBasePtr;


(*-- Library Functions ------------------------------------------------*)

(*
**      $VER: mathieeesingbas_protos.h 1.3 (7.11.90)
*)

LIBCALL (base : MathIEEESingBasBasePtr ) Fix*
  ( parm [0] : E.SINGLE )
  : LONGINT;
  - 30;

LIBCALL (base : MathIEEESingBasBasePtr ) Flt*
  ( integer [0] : LONGINT  )
  : E.SINGLE;
  - 36;

LIBCALL (base : MathIEEESingBasBasePtr ) Cmp*
  ( leftParm  [0] : E.SINGLE;
    rightParm [1] : E.SINGLE )
  : LONGINT;
  - 42;

LIBCALL (base : MathIEEESingBasBasePtr ) Tst*
  ( parm [0] : E.SINGLE )
  : LONGINT;
  - 48;

LIBCALL (base : MathIEEESingBasBasePtr ) Abs*
  ( parm [0] : E.SINGLE )
  : E.SINGLE;
  - 54;

LIBCALL (base : MathIEEESingBasBasePtr ) Neg*
  ( parm [0] : E.SINGLE )
  : E.SINGLE;
  - 60;

LIBCALL (base : MathIEEESingBasBasePtr ) Add*
  ( leftParm  [0] : E.SINGLE;
    rightParm [1] : E.SINGLE )
  : E.SINGLE;
  - 66;

LIBCALL (base : MathIEEESingBasBasePtr ) Sub*
  ( leftParm  [0] : E.SINGLE;
    rightParm [1] : E.SINGLE )
  : E.SINGLE;
  - 72;

LIBCALL (base : MathIEEESingBasBasePtr ) Mul*
  ( leftParm  [0] : E.SINGLE;
    rightParm [1] : E.SINGLE )
  : E.SINGLE;
  - 78;

LIBCALL (base : MathIEEESingBasBasePtr ) Div*
  ( dividend [0] : E.SINGLE;
    divisor  [1] : E.SINGLE )
  : E.SINGLE;
  - 84;

LIBCALL (base : MathIEEESingBasBasePtr ) Floor*
  ( parm [0] : E.SINGLE )
  : E.SINGLE;
  - 90;

LIBCALL (base : MathIEEESingBasBasePtr ) Ceil*
  ( parm [0] : E.SINGLE )
  : E.SINGLE;
  - 96;


(*-- Library Base variable --------------------------------------------*)
(* $L- Address globals through A4 *)


(*-----------------------------------*)
PROCEDURE* CloseLib ();

BEGIN (* CloseLib *)
  IF base # NIL THEN E.base.CloseLibrary (base) END;
END CloseLib;

(*-----------------------------------*)
PROCEDURE OpenLib * (mustOpen : BOOLEAN);

BEGIN (* OpenLib *)
  IF base = NIL THEN
    base :=
      SYS.VAL
        ( MathIEEESingBasBasePtr,
          E.base.OpenLibrary (name, E.libraryMinimum) );
    IF base # NIL THEN SYS.SETCLEANUP (CloseLib)
    ELSIF mustOpen THEN HALT (100)
    END;
  END;
END OpenLib;


BEGIN
  base := NIL
END MathIEEESingBas.
