Print this page
11544 ofmt(3OFMT) should talk about the callback handler
Reviewed by: Dan McDonald <danmcd@joyent.com>
Reviewed by: Jason King <jason.brian.king@gmail.com>
*** 86,97 ****
of_cb is the application-specified callback function with the following
prototype that provides a string representation of the value to be
printed for the field:
! (*of_cb)(ofmt_arg_t *ofmt_arg, char *buf, uint_t bufsize)
The interpretation of the of_id field is completely private to the
caller, and can be optionally used by the callback function as a cookie
to identify the field being printed when a single callback function is
shared between multiple template entries.
--- 86,102 ----
of_cb is the application-specified callback function with the following
prototype that provides a string representation of the value to be
printed for the field:
! boolean_t (*of_cb)(ofmt_arg_t *ofmt_arg, char *buf, uint_t bufsize)
+ The callback must not write beyond bufsize bytes of the string form into
+ buf. If the function successfully translates the field into its string
+ representation and places it into buf, then the callback function should
+ return B_TRUE. Otherwise, the callback function should return B_FALSE.
+
The interpretation of the of_id field is completely private to the
caller, and can be optionally used by the callback function as a cookie
to identify the field being printed when a single callback function is
shared between multiple template entries.
*** 160,165 ****
Private.
SEE ALSO
ioctl(2), strerror(3C), attributes(5)
! illumos June 1, 2017 illumos
--- 165,170 ----
Private.
SEE ALSO
ioctl(2), strerror(3C), attributes(5)
! illumos December 20, 2018 illumos