unit NewtonImport;

{$mode objfpc}{$H+}

interface

const
  NewtonDLL = 'libNewton.so';

Type

(* C types *)
  int = integer;

(* Pretty names *)
  PNewtonWorld = ^Pointer;

{$IFDEF FPC}
{$PACKRECORDS C}
{$ENDIF}

NewtonAllocMemory = function( sizeInBytes : int ) : Pointer; cdecl;
PNewtonAllocMemory = ^NewtonAllocMemory;

NewtonFreeMemory = procedure( ptr : Pointer; sizeInBytes : int ); cdecl;
PNewtonFreeMemory = ^NewtonFreeMemory;

function NewtonCreate( malloc : NewtonAllocMemory; mfree : NewtonFreeMemory ) : PNewtonWorld; cdecl; external  NEwtonDLL;//{$IFDEF __GPC__}name 'NewtonCreate'{$ELSE}NewtonDLL{$ENDIF __GPC__};

implementation

end.

