unit diSc14n;
interface
{
  Delphi/FreePascal interface for SC14N <https://www.cryptosys.net/sc14n/>
  $Id: diSc14n.pas $
  $Date: 2023-04-14 10:37 $
  $Revision: 3.1.0 $
  ************************** LICENSE *****************************************
  Copyright (C) 2023 David Ireland, DI Management Services Pty Limited.
  All rights reserved. <www.di-mgt.com.au> <www.cryptosys.net>
  This code is provided 'as-is' without any express or implied warranty.
  Free license is hereby granted to use this code as part of an application
  provided this copyright notice is left intact. You are *not* licensed to 
  share any of this code in any form of mass distribution, including, but not
  limited to, reposting on other web sites or in any source code repository.
  ****************************************************************************
}

  function C14N_File2Digest(szOut : PAnsiChar; nOutChars : LongInt; szInputFile : AnsiString; szNameOrId : AnsiString; szParams : AnsiString; nOptions : LongInt): LongInt; stdcall; external 'diSc14n.dll';
  function C14N_File2File(szOutputFile : AnsiString; szInputFile : AnsiString; szNameOrId : AnsiString; szParams : AnsiString; nOptions : LongInt): LongInt; stdcall; external 'diSc14n.dll';
  function C14N_File2String(szOut : PAnsiChar; nOutChars : LongInt; szInputFile : AnsiString; szNameOrId : AnsiString; szParams : AnsiString; nOptions : LongInt): LongInt; stdcall; external 'diSc14n.dll';
  function C14N_String2Digest(szOut : PAnsiChar; nOutChars : LongInt; szDataIn : AnsiString; nDataLen : LongInt; szNameOrId : AnsiString; szParams : AnsiString; nOptions : LongInt): LongInt; stdcall; external 'diSc14n.dll';
  function C14N_String2String(szOut : PAnsiChar; nOutChars : LongInt; szDataIn : AnsiString; nDataLen : LongInt; szNameOrId : AnsiString; szParams : AnsiString; nOptions : LongInt): LongInt; stdcall; external 'diSc14n.dll';
  function SC14N_Err_ErrorLookup(szOut : PAnsiChar; nOutChars : LongInt; nErrCode : LongInt): LongInt; stdcall; external 'diSc14n.dll';
  function SC14N_Err_LastError(szOut : PAnsiChar; nOutChars : LongInt): LongInt; stdcall; external 'diSc14n.dll';
  function SC14N_Gen_CompileTime(szOut : PAnsiChar; nOutChars : LongInt): LongInt; stdcall; external 'diSc14n.dll';
  function SC14N_Gen_LicenceType(): LongInt; stdcall; external 'diSc14n.dll';
  function SC14N_Gen_ModuleName(szOut : PAnsiChar; nOutChars : LongInt; nOptions : LongInt): LongInt; stdcall; external 'diSc14n.dll';
  function SC14N_Gen_Platform(szOut : PAnsiChar; nOutChars : LongInt): LongInt; stdcall; external 'diSc14n.dll';
  function SC14N_Gen_Version(): LongInt; stdcall; external 'diSc14n.dll';
	
const
  { OPTION FLAGS AND CONSTANTS }
  SC14N_DIG_DEFAULT = 0;
  SC14N_DIG_SHA1 = 0;
  SC14N_DIG_SHA256 = $2000;
  SC14N_DIG_SHA384 = $3000;
  SC14N_DIG_SHA512 = $5000;
  SC14N_MAX_DIGEST_CHARS = 88;
  SC14N_MAX_ERROR_CHARS = 4073;
  SC14N_METHOD_EXCLUSIVE = $100;
  SC14N_METHOD_INCLUSIVE = 0;
  SC14N_METHOD_WITHCOMMENTS = $800;
  SC14N_OPT_FLATTEN = $10000;
  SC14N_TRAN_ENTIRE = 0;
  SC14N_TRAN_OMITBYID = $11;
  SC14N_TRAN_OMITBYTAG = $1;
  SC14N_TRAN_SUBSETBYID = $12;
  SC14N_TRAN_SUBSETBYTAG = $2;

implementation
end.