library TslcComp;

uses
	Windows,
    SysUtils,
	TclTk,
	Tslc,
  uTslcCmp,
  TraceCmp in 'TraceCmp.pas';

function Tslccompress_Init(AInterp: pTcl_Interp): integer; cdecl;
begin
    try
		CompressServeThreadInterp(GetCurrentThreadId, AInterp);
        result := TCL_OK;
	except
		Tcl_SetResult(AInterp, pChar(Exception(ExceptObject)), TTclFreeProc(TCL_VOLATILE));
		result := TCL_ERROR;
    end;
end;

function Tslccompress_SafeInit(AInterp: pTcl_Interp): integer; cdecl
begin
	result := Tslccompress_Init(AInterp)
end;

function Tslcdes_Init(AInterp: pTcl_Interp): integer; cdecl
begin
	result := Tslccompress_Init(AInterp)
end;

function Tslcdes_SafeInit(AInterp: pTcl_Interp): integer; cdecl
begin
	result := Tslccompress_Init(AInterp)
end;

exports
    Tslccompress_Init name 'Tslccomp_Init', // for straight-up *load*
    Tslccompress_SafeInit name 'Tslccomp_SafeInit',  // for straight-up *load*
    Tslccompress_Init,  // for package require
	Tslccompress_SafeInit, // for package require
    Tslcdes_Init,
    Tslcdes_SafeInit;

begin
end.

