package bin
All checked builds passInstall
dune-project
Dependency
Authors
Maintainers
Sources
sha256=69b9b01c66005ac8492b79bd541c78c885cf26ba5b6542c2b9898b60810f127c
sha512=d10e823bc4f974789152b0d86473078ca52520836a99ed6559214e95e2ead88b440898c1e4dacdc4bf07756d5afca615b406208e7d9524d9594c6011ce8e8d26
doc/bin/Bin/Off/index.html
Module Bin.OffSource
An index into a byte sequence, counted in bytes and never negative. The parameter 'w records what the index is counted from.
An absolute index, counted from the first byte of the buffer. It designates a byte on its own, so it is what one can read or write at. A cursor is of this kind.
A relative index: a displacement, counted from somewhere else: in practice from the beginning of the value being decoded. Describing a format yields such displacements (the offset of a field within its record) long before any buffer exists, so they designate nothing by themselves. They become usable once added to an absolute index, and the parameter is there to make sure that addition happens.
zero is 0. It is both the first index of a buffer and the null displacement, hence its two possible kinds: it is the value to start a cursor with.
at base delta is the absolute index which sits delta bytes after base. This is the only way to turn a displacement into an index one can read at.