package decompress

  1. Overview
  2. Docs
Implementation of Zlib and GZip in OCaml

Install

Dune Dependency

Authors

Maintainers

Sources

decompress-v1.2.0.tbz
sha256=51983d4497ccb27c253e7464b03d38544aad51e0e7d537e405f4df6954c27ab0
sha512=17c7e3dc79b7cedaf649c208874a50a810002c71d061c133239b9813a9dfe424ba303a968ba68c728862bb20ceaa23465097334bc16b819317390d01c2f91f89

doc/decompress.de/De/Queue/index.html

Module De.QueueSource

Sourcetype cmd

The type for commands.

Sourcetype t

The type for queues.

A command is a small representation of a `Literal or a `Copy command. A `Copy command is usually emitted by a compression algorithm to inform to copy length byte(s) appeared offset byte(s) before.

DEFLATE has some limitations about `Copy command.

Sourceexception Full

Raised when push_exn is applied to a full queue.

Sourceexception Empty

Raised when junk_exn or pop_exn is applied to an empty queue.

Sourceval is_empty : t -> bool

Return true if the given queue is empty, false otherwise.

Sourceval is_full : t -> bool

Return true if the given queue is full, false otherwise.

Sourceval length : t -> int

Return the number of elements in the given queue.

Sourceval available : t -> int

Free cells available on the given queue.

Sourceval push_exn : t -> cmd -> unit

push_exn q x adds the element x at the end of the queue q. It raises Full if the given queue q is full.

Sourceval pop_exn : t -> cmd

pop_exn q removes and returns the first element in the given queue q. It raises Empty if the given queue q is empty.

Sourceval junk_exn : t -> int -> unit

junk_exn q n discards n elements in the given queue q. If q does not have enough elements, it raises Empty and the given queue is unchanged.

Sourceval copy : off:int -> len:int -> cmd

copy ~off ~len is a cmd for a copy code.

Sourceval literal : char -> cmd

literal chr is a cmd for a character.

Sourceval eob : cmd

eob is End Of Block cmd.

Sourceval cmd : [ `Literal of char | `Copy of int * int | `End ] -> cmd

cmd command is cmd from a human-readable value.

Sourceval blit : t -> bigstring -> int -> int -> unit

blit q payload off len blits elements in payload to the given queue q at the end (like a fast iterative push_exn with literal elements). If the given queue q does not have enough free space to write payload, it raises Full and the given queue is unchanged.

Sourceval create : int -> t

create len allocates a new queue, initially empty. len must be a power of two, otherwise it raises Invalid_argument.

Sourceval reset : t -> unit

Discard all elements from a queue.

Sourceval to_list : t -> [ `Literal of char | `Copy of int * int | `End ] list
Sourceval of_list : [ `Literal of char | `Copy of int * int | `End ] list -> t
OCaml

Innovation. Community. Security.