/* Collection of code snippets by Arne Vajhøj */
/* (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) */
#include <stdio.h>
#include <string.h>

#include "zlib.h"

int main()
{
   int l1,l2,l3;
   char s1[200] = "Dette er en lille test med en masse e'er som gerne skulle give en god compress:\n"
                  "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee";
   char s2[200];
   char s3[200];
   l1 = strlen(s1);
   l2 = sizeof(s2);
   l3 = sizeof(s3);
   compress(s2,&l2,s1,l1);
   uncompress(s3,&l3,s2,l2);
   s3[l3] = '\0';
   printf("%s\n",s1);
   printf("%d -> %d -> %d\n",l1,l2,l3);
   printf("%s\n",s3);
   return 0;
}
