hedgewars/adler32.pas
author koda
Fri, 13 Aug 2010 02:44:44 +0200
changeset 3738 f10626e18b8a
parent 3697 d5b30d6373fc
child 3744 543412536b7b
permissions -rw-r--r--
better to do that in this way
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3695
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
     1
unit Adler32;
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
     2
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
     3
{ZLib - Adler32 checksum function}
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
     4
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
     5
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
     6
interface
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
     7
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
     8
(*************************************************************************
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
     9
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    10
 DESCRIPTION     :  ZLib - Adler32 checksum function
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    11
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    12
 REQUIREMENTS    :  TP5-7, D1-D7/D9-D10/D12, FPC, VP
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    13
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    14
 EXTERNAL DATA   :  ---
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    15
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    16
 MEMORY USAGE    :  ---
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    17
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    18
 DISPLAY MODE    :  ---
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    19
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    20
 REFERENCES      :  RFC 1950 (http://tools.ietf.org/html/rfc1950)
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    21
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    22
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    23
 Version  Date      Author      Modification
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    24
 -------  --------  -------     ------------------------------------------
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    25
 0.10     30.08.03  W.Ehrhardt  Initial version based on MD5 layout
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    26
 2.10     30.08.03  we          Common vers., XL versions for Win32
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    27
 2.20     27.09.03  we          FPC/go32v2
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    28
 2.30     05.10.03  we          STD.INC, TP5.0
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    29
 2.40     10.10.03  we          common version, english comments
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    30
 3.00     01.12.03  we          Common version 3.0
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    31
 3.01     22.05.05  we          Adler32UpdateXL (i,n: integer)
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    32
 3.02     17.12.05  we          Force $I- in Adler32File
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    33
 3.03     07.08.06  we          $ifdef BIT32: (const fname: shortstring...)
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    34
 3.04     10.02.07  we          Adler32File: no eof, XL and filemode via $ifdef
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    35
 3.05     04.07.07  we          BASM16: speed-up factor 15
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    36
 3.06     12.11.08  we          uses BTypes, Ptr2Inc and/or Str255
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    37
 3.07     25.04.09  we          updated RFC URL(s)
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    38
 3.08     19.07.09  we          D12 fix: assign with typecast string(fname)
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    39
**************************************************************************)
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    40
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    41
(*-------------------------------------------------------------------------
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    42
 (C) Copyright 2002-2009 Wolfgang Ehrhardt
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    43
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    44
 This software is provided 'as-is', without any express or implied warranty.
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    45
 In no event will the authors be held liable for any damages arising from
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    46
 the use of this software.
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    47
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    48
 Permission is granted to anyone to use this software for any purpose,
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    49
 including commercial applications, and to alter it and redistribute it
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    50
 freely, subject to the following restrictions:
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    51
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    52
 1. The origin of this software must not be misrepresented; you must not
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    53
    claim that you wrote the original software. If you use this software in
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    54
    a product, an acknowledgment in the product documentation would be
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    55
    appreciated but is not required.
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    56
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    57
 2. Altered source versions must be plainly marked as such, and must not be
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    58
    misrepresented as being the original software.
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    59
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    60
 3. This notice may not be removed or altered from any source distribution.
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    61
----------------------------------------------------------------------------*)
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    62
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    63
(*
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    64
As per the license above, noting that this implementation of adler32 was stripped of everything we didn't need.
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    65
That means no btypes, file loading, and the assembly version disabled.
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    66
*)
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    67
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    68
procedure Adler32Update(var adler: longint; Msg: pointer; Len: longint);
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    69
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    70
implementation
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    71
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    72
(*
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    73
$ifdef BASM16
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    74
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    75
procedure Adler32Update(var adler: longint; Msg: pointer; Len: longint);
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    76
  //-update Adler32 with Msg data
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    77
const
3697
d5b30d6373fc remove trailing spaces from end of line
koda
parents: 3695
diff changeset
    78
  BASE = 65521; // max. prime < 65536
3695
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    79
  NMAX =  5552; // max. n with 255n(n+1)/2 + (n+1)(BASE-1) < 2^32
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    80
type
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    81
  LH    = packed record
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    82
            L,H: word;
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    83
          end;
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    84
var
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    85
  s1,s2: longint;
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    86
  n: integer;
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    87
begin
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    88
  s1 := LH(adler).L;
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    89
  s2 := LH(adler).H;
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    90
  while Len > 0 do begin
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    91
    if Len<NMAX then n := Len else n := NMAX;
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    92
    //BASM increases speed from about 52 cyc/byte to about 3.7 cyc/byte
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    93
    asm
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    94
                    mov  cx,[n]
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    95
            db $66; mov  ax,word ptr [s1]
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    96
            db $66; mov  di,word ptr [s2]
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    97
                    les  si,[msg]
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    98
      @@1:  db $66, $26, $0f, $b6, $1c      // movzx ebx,es:[si]
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    99
                    inc  si
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
   100
            db $66; add  ax,bx              // inc(s1, pByte(Msg)^)
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
   101
            db $66; add  di,ax              // inc(s2, s1
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
   102
                    dec  cx
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
   103
                    jnz  @@1
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
   104
            db $66; sub  cx,cx
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
   105
                    mov  cx,BASE
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
   106
            db $66; sub  dx,dx
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
   107
            db $66; div  cx
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
   108
            db $66; mov  word ptr [s1],dx   // s1 := s1 mod BASE
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
   109
            db $66; sub  dx,dx
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
   110
            db $66; mov  ax,di
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
   111
            db $66; div  cx
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
   112
            db $66; mov  word ptr [s2],dx   // s2 := s2 mod BASE
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
   113
                    mov  word ptr [msg],si  // save offset for next chunk
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
   114
    end;
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
   115
    dec(len, n);
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
   116
  end;
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
   117
  LH(adler).L := word(s1);
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
   118
  LH(adler).H := word(s2);
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
   119
end;
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
   120
*)
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
   121
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
   122
procedure Adler32Update(var adler: longint; Msg: pointer; Len: longint);
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
   123
  {-update Adler32 with Msg data}
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
   124
const
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
   125
  BASE = 65521; {max. prime < 65536 }
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
   126
  NMAX =  3854; {max. n with 255n(n+1)/2 + (n+1)(BASE-1) < 2^31}
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
   127
type
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
   128
  LH    = packed record
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
   129
            L,H: word;
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
   130
          end;
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
   131
var
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
   132
  s1,s2: longint;
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
   133
  i,n: integer;
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
   134
begin
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
   135
  s1 := LH(adler).L;
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
   136
  s2 := LH(adler).H;
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
   137
  while Len > 0 do begin
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
   138
    if Len<NMAX then n := Len else n := NMAX;
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
   139
    for i:=1 to n do begin
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
   140
      inc(s1, pByte(Msg)^);
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
   141
      inc(Msg);
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
   142
      inc(s2, s1);
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
   143
    end;
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
   144
    s1 := s1 mod BASE;
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
   145
    s2 := s2 mod BASE;
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
   146
    dec(len, n);
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
   147
  end;
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
   148
  LH(adler).L := word(s1);
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
   149
  LH(adler).H := word(s2);
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
   150
end;
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
   151
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
   152
end.