package carton

  1. Overview
  2. Docs

Module Dec.FpSource

First-pass of a PACK file.

From a stream, it is possible to infer information needed then to apply a second analyse to extract all objects of a the given PACK file. From Git, this pass appears when the client clone/fetch and the program counts how many objects the PACK file has.

  $ git clone ...
  remote: Enumerating objects: 105, done.
  remote: Counting objects: 100% (105/105), done.
  remote: Compressing objects: 100% (81/81), done.
  remote: Total 305 (delta 41), reused 75 (delta 23), pack-reused 200
  Receiving objects: 100% (305/305), 104.46 KiB | 0 bytes/s, done. # first pass

Parameters

module Uid : sig ... end

Signature

Sourcetype optint = Optint.t
Sourcetype kind =
  1. | Base of [ `A | `B | `C | `D ]
  2. | Ofs of {
    1. sub : int;
    2. source : weight;
    3. target : weight;
    }
  3. | Ref of {
    1. ptr : Uid.t;
    2. source : weight;
    3. target : weight;
    }
    (*

    Type of PACK objects.

    *)
Sourcetype entry = {
  1. offset : int64;
    (*

    Absolute offset into the given PACK file.

    *)
  2. kind : kind;
    (*

    Kind of the object.

    *)
  3. size : weight;
    (*

    Length of the inflated object.

    *)
  4. consumed : int;
    (*

    Length of the deflated object (as it is into the PACK file).

    *)
  5. crc : optint;
    (*

    Check-sum of the entry (header plus the deflated object).

    *)
}

Type of a PACK entry.

Sourceval check_header : 's Carton__.Sigs.scheduler -> ('fd, 's) read -> 'fd -> (int * string * int, 's) Carton__.Sigs.io
Sourcetype decoder

The type for decoders.

Sourcetype src = [
  1. | `Channel of in_channel
  2. | `String of string
  3. | `Manual
]

The type for input sources. With a `Manual source the client must provide input with src.

Sourcetype decode = [
  1. | `Await of decoder
  2. | `Peek of decoder
  3. | `Entry of entry * decoder
  4. | `End of Uid.t
  5. | `Malformed of string
]
Sourcetype header =
  1. | Consumed of Bigstringaf.t
  2. | None
Sourceval decoder : o:Bigstringaf.t -> allocate:(int -> De.window) -> src -> decoder
Sourceval decode : decoder -> decode
Sourceval number : decoder -> int
Sourceval version : decoder -> int
Sourceval count : decoder -> int
Sourceval ctx : decoder -> Uid.ctx
Sourceval src_rem : decoder -> int
Sourceval src : decoder -> Bigstringaf.t -> int -> int -> decoder
OCaml

Innovation. Community. Security.