summaryrefslogtreecommitdiff
path: root/UCoreUtils.pas
diff options
context:
space:
mode:
authorTomas Bzatek <tbzatek@users.sourceforge.net>2008-06-08 13:52:16 +0200
committerTomas Bzatek <tbzatek@users.sourceforge.net>2008-06-08 13:52:16 +0200
commit226843b5d3c171734426756ceecba13817294eb9 (patch)
treeb8c3a70aadca63c9db21cf10f90af626712bc728 /UCoreUtils.pas
parent6c78adaf82d11bb1ae074b822d76891e004f4ae3 (diff)
downloadtuxcmd-226843b5d3c171734426756ceecba13817294eb9.tar.xz
Internal viewer: detect file encoding from the first 100 lines only
Diffstat (limited to 'UCoreUtils.pas')
-rw-r--r--UCoreUtils.pas8
1 files changed, 8 insertions, 0 deletions
diff --git a/UCoreUtils.pas b/UCoreUtils.pas
index 1781a41..f297fe0 100644
--- a/UCoreUtils.pas
+++ b/UCoreUtils.pas
@@ -128,6 +128,7 @@ function UTF8ToStr(s: PChar): PChar; overload;
function EnsureUTF8String(s: PChar): PChar; overload;
+function Min(Val1, Val2: longint): longint;
// Calculate CRC32 Checksum, CRC is default $FFFFFFFF,
// After calc you must inverse Result with NOT
@@ -1425,6 +1426,13 @@ end;
(********************************************************************************************************************************)
+function Min(Val1, Val2: longint): longint;
+begin
+ if Val1 < Val2 then Result := Val1
+ else Result := Val2;
+end;
+
+(********************************************************************************************************************************)
{$IFDEF CPU64}
function CRC32(CRC: LongWord; Data: Pointer; DataSize: LongWord): LongWord;
begin