• Home (current)
  • वर्तमान निदेशक => /usr/share/slsh/
  • सूचना एवं अपलोड
    Info Server
Indian Cyber Force
Folders रचयन्तु सञ्चिकां रचयन्तु RansomWeb लॉगआउट
Current File : //usr/share/slsh/zlib.sl
% -*- mode: slang; mode: fold -*-
% Copyright (C) 2012-2017,2018 John E. Davis
%
% This file is part of the S-Lang Library and may be distributed under the
% terms of the GNU General Public License.  See the file COPYING for
% more information.
%---------------------------------------------------------------------------
import ("zlib");

%{{{ Deflate Object and methods
private define deflate_method ()
{
   if (_NARGS != 2)
     {
	_pop_n (_NARGS);
	usage (".deflate(str [;flush=val])");
     }
   variable z, b;
   (z, b) = ();
   return _zlib_deflate (z.zobj, b, qualifier("flush", ZLIB_NO_FLUSH));
}

private define def_reset_method (z)
{
   _zlib_deflate_reset (z.zobj);
}

private define def_flush_method ()
{
   variable z, flush = ZLIB_FINISH;
   switch (_NARGS)
     {
      case 2:
	(z, flush) = ();
     }
     {
      case 1:
	z = ();
     }
     {
	_pop_n (_NARGS);
	usage (".flush ([val]);  Default is ZLIB_FINISH");
     }

   return _zlib_deflate_flush (z.zobj, flush);
}

private variable Deflate_Object = struct
{
   zobj,
   deflate = &deflate_method,
   reset = &def_reset_method,
   flush = &def_flush_method,
};

define zlib_deflate_new ()
{
   variable z = @Deflate_Object;
   z.zobj = _zlib_deflate_new (qualifier ("level", ZLIB_DEFAULT_COMPRESSION),
			       qualifier ("method", ZLIB_DEFLATED),
			       qualifier ("wbits", 15),
			       qualifier ("memlevel", 8),
			       qualifier ("strategy", ZLIB_DEFAULT_STRATEGY));
   return z;
}

%}}}

%{{{ Inflate Object and methods

private define inflate_method ()
{
   if (_NARGS != 2)
     {
	_pop_n (_NARGS);
	usage (".inflate(str [;flush=val])");
     }
   variable z, b;
   (z, b) = ();
   return _zlib_inflate (z.zobj, b, qualifier("flush", ZLIB_NO_FLUSH));
}

private define inf_reset_method (z)
{
   _zlib_inflate_reset (z.zobj);
}

private define inf_flush_method ()
{
   variable z, flush = ZLIB_FINISH;
   switch (_NARGS)
     {
      case 2:
	(z, flush) = ();
     }
     {
      case 1:
	z = ();
     }
     {
	_pop_n (_NARGS);
	usage (".flush ([val]);  Default is ZLIB_FINISH");
     }

   return _zlib_inflate_flush (z.zobj, flush);
}

private variable Inflate_Object = struct
{
   zobj,
   inflate = &inflate_method,
   reset = &inf_reset_method,
   flush = &inf_flush_method,
};

define zlib_inflate_new ()
{
   variable z = @Inflate_Object;
   z.zobj = _zlib_inflate_new (qualifier ("wbits", 15));
   return z;
}

%}}}

define zlib_deflate ()
{
   if (_NARGS != 1)
     {
	usage ("zstr = zlib_deflate (str [;qualifiers])\n"
	       + " qualifiers:\n"
	       + "  level=val, method=val, wbits=val, memlevel=val, strategy=val");
     }
   variable bstr = ();
   variable z = zlib_deflate_new (;; __qualifiers);

   return _zlib_deflate (z.zobj, bstr, ZLIB_FINISH);
}

define zlib_inflate ()
{
   if (_NARGS != 1)
     {
	usage ("str = zlib_inflate (zstr [;wbits=val])");
     }

   variable zstr = ();
   variable z = zlib_inflate_new (;; __qualifiers);
   return _zlib_inflate (z.zobj, zstr, ZLIB_FINISH);
}
freckles – Verilere bak
Menu
  • Top 10

Verilere bak

Follow us
  • facebook
  • twitter
Search
Login
Create
Menu

Verilere bak

Login

You are here:

  1. Home
  2. Tag Archives: freckles

freckles

Latest stories

What This Little Girl Can Do Is Beyond Your Imagination

  • facebook
  • twitter

Arşivler

Kategoriler

Disclaimer

This demo site is only for demonstration purposes. All images are copyrighted to their respective owners. All content cited is derived from their respective sources.

© 2017 bring the pixel. Remember to change this

  • Home
  • Contact us
Back to Top
Close
  • Top 10
  • Home
  • Animals
  • Funny
  • WOW
  • WTF
  • Features
  • facebook
  • twitter
Create

Log In

Sign In

Forgot password?

Forgot password?

Enter your account data and we will send you a link to reset your password.

Back to Login

Your password reset link appears to be invalid or expired.

Log in

Privacy Policy

Accept

Add to Collection

  • Public collection title

  • Private collection title

No Collections

Here you'll find all collections you've created before.

Hey Friend!
Before You Go…

Get the best viral stories straight into your inbox before everyone else!

Don't worry, we don't spam

Close

Newsletter

Don’t miss out on new posts!

Don't worry, we don't spam

Close