bprint :: fn (buf: []u8, format: string, args: ...) s32


Write string to the input buffer. Format string can include format specifiers % which are replaced by corresponding argument value passed in args. Value-string conversion is done automatically, we can pass values of any type as an arguments, even structures or arrays.

The bprint function accepts C-like escape sequences as n, t, r, etc.

When passed buffer has not enough space to handle whole resulting string, function will print just part fitting into the buffer.


  • buf Destination buffer.

  • format Formatting string.

  • args Additional values.


Count of characters written into buffer, this count does not include terminal character written at the end of the result string.

Declared in: print.bl