package xapi-stdext-zerocheck

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Xapi_stdext_zerocheck.ZerocheckSource

Sourceval is_all_zeros : string -> int -> bool

is_all_zeroes x len returns true if the substring is all zeroes

Sourceval find_a_zero : string -> int -> int -> int option

find_a_zero x len offset returns the offset in x of a zero character after offset, or None if no zero was detected. Note this function is approximate and is not guaranteed to find strictly the first zero.

Sourceval find_a_nonzero : string -> int -> int -> int option

find_a_nonzero x len offset returns the offset in x of a nonzero character after offset, or None if none could be detected. Note this function is approximate and is not guaranteed to find strictly the first nonzero.

Sourcetype substring = {
  1. buf : string;
  2. offset : int;
  3. len : int;
}
Sourceval fold_over_nonzeros : string -> int -> (int -> int) -> (int -> int) -> ('a -> substring -> 'a) -> 'a -> 'a

fold_over_nonzeros buf len rounddown roundup f initial folds f over all (start, length) pairs of non-zero data in string buf up to len. The start of each pair is rounded down with rounddown and the end offset of each pair is rounded up with roundup (e.g. to potential block boudaries.