<?xml version="1.0"?>
<paste-with-annotations>
  <paste>
    <number>
      <integer>54493</integer>
    </number>
    <user>
      <string>turbo24prg</string>
    </user>
    <title>
      <string>zlib interface</string>
    </title>
    <contents>
      <string>ZEXTERN int ZEXPORT compress OF((Bytef *dest,   uLongf *destLen,
                                 const Bytef *source, uLong sourceLen));
/*
     Compresses the source buffer into the destination buffer.  sourceLen is
   the byte length of the source buffer. Upon entry, destLen is the total
   size of the destination buffer, which must be at least the value returned
   by compressBound(sourceLen). Upon exit, destLen is the actual size of the
   compressed buffer.
     This function can be used to compress a whole file at once if the
   input file is mmap'ed.
     compress returns Z_OK if success, Z_MEM_ERROR if there was not
   enough memory, Z_BUF_ERROR if there was not enough room in the output
   buffer.
*/



define C-function zlib-compress
  parameter destination :: &lt;C-string&gt;;
  parameter destination-length :: &lt;C-int*&gt;;
  parameter source :: &lt;C-string&gt;;
  parameter source-length :: &lt;C-int&gt;;
  result return-code :: &lt;C-int&gt;;
  c-name: &quot;compress&quot;
end;

define C-function zlib-compress-bound
  parameter source-length :: &lt;C-int&gt;;
  result return-code :: &lt;C-int&gt;;
  c-name: &quot;compressBound&quot;
end;

define function main (name, arguments)
  let foo = &quot;asdhalsdhald asldhlasdjasda sdajsdbajkd;bhdk bhadjkaSDBASd ujwheiqecvuhxohero&quot;;
  let bar = make(&lt;C-string&gt;, value: &quot;&quot;);
  let bar-size :: &lt;C-int*&gt; = make(&lt;C-int*&gt;, value:
    zlib-compress-bound(size(foo)));
  format-out(&quot;return-code: %d\n&quot;, zlib-compress(bar, bar-size, foo, size(foo)));
  exit-application(0);
end function main;
</string>
    </contents>
    <universal-time>
      <integer>3409767403</integer>
    </universal-time>
    <channel>
      <string>#dylan</string>
    </channel>
    <colorization-mode>
      <string></string>
    </colorization-mode>
    <maybe-spam>
      <null/>
    </maybe-spam>
    <is-unicode>
      <null/>
    </is-unicode>
  </paste>
  <annotation>
    <number>
      <integer>2</integer>
    </number>
    <user>
      <string>turbo24prg</string>
    </user>
    <title>
      <string>correction</string>
    </title>
    <contents>
      <string> let foo = &quot;asdhalsdhald asldhlasdjasda sdajsdbajkd;bhdk bhadjkaSDBASd ujwheiqecvuhxohero&quot;;
  let bar-size :: &lt;C-int*&gt; = make(&lt;C-int*&gt;);
  bar-size.pointer-value := zlib-compress-bound(size(foo));
  let bar = make(&lt;C-string&gt;, size: bar-size.pointer-value, fill: ' ');
  format-out(&quot;return-code: %d\n&quot;, zlib-compress(bar, bar-size, foo, size(foo)));
  format-out(&quot;&gt; %=\n&quot;, bar);
</string>
    </contents>
    <universal-time>
      <integer>3409768154</integer>
    </universal-time>
    <channel>
      <string>#dylan</string>
    </channel>
    <colorization-mode>
      <string></string>
    </colorization-mode>
    <maybe-spam>
      <null/>
    </maybe-spam>
    <is-unicode>
      <null/>
    </is-unicode>
  </annotation>
  <annotation>
    <number>
      <integer>1</integer>
    </number>
    <user>
      <string>turbo24prg</string>
    </user>
    <title>
      <string>corrected</string>
    </title>
    <contents>
      <string>define function main (name, arguments)
  let foo = &quot;asdhalsdhald asldhlasdjasda sdajsdbajkd;bhdk bhadjkaSDBASd ujwheiqecvuhxohero&quot;;
  let bar = make(&lt;C-string&gt;, size: 42, fill: ' ');
  let bar-size :: &lt;C-int*&gt; = make(&lt;C-int*&gt;);
  bar-size.pointer-value := zlib-compress-bound(size(foo));
  format-out(&quot;&gt; %d\n&quot;, pointer-value(bar-size));
  format-out(&quot;return-code: %d\n&quot;, zlib-compress(bar, bar-size, foo, size(foo)));
  format-out(&quot;&gt; %=\n&quot;, bar);
  exit-application(0);
end function main;
</string>
    </contents>
    <universal-time>
      <integer>3409767974</integer>
    </universal-time>
    <channel>
      <string>#dylan</string>
    </channel>
    <colorization-mode>
      <string></string>
    </colorization-mode>
    <maybe-spam>
      <null/>
    </maybe-spam>
    <is-unicode>
      <null/>
    </is-unicode>
  </annotation>
</paste-with-annotations>