package core
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=8c158c12345d36a5cdd71081728f4317b2b04c09eb4126b6de00c482a6fec2a0
md5=b11f58205953d84cedb0003efcdab231
doc/core.iobuf_unix/Iobuf_unix/Expert/index.html
Module Iobuf_unix.Expert
The Expert
module is for building efficient out-of-module Iobuf
abstractions.
val fillf_float :
(Core.read_write, Iobuf.seek) Iobuf.t ->
c_format:string ->
float ->
[ `Ok | `Truncated | `Format_error ]
fillf_float t ~c_format float
attempts to fill a string representation of a float into an iobuf at the current position. The representation is specified by standard C printf
formatting codes.
The highest available byte of the window is unusable and will be set to 0 in the case that a properly formatted string would otherwise fully fill the window.
If there is enough room in (window - 1) to format the float as specified then `Ok
is returned and the window is advanced past the written bytes.
If there is not enough room in (window - 1) to format as specified then `Truncated
is returned.
If C snprintf
indicates a format error then `Format_error
is returned.
Operation is unsafe if a format code not intended for a double precision float is used (e.g., %s) or if more than one format specifier is provided, etc.