From 0510e5e8c0252dfb0be623b8328ac8a4e99c125f Mon Sep 17 00:00:00 2001 From: CismonX Date: Thu, 23 Jan 2025 18:02:10 +0800 Subject: [PATCH] doc: update doc for fsck handler API Add doc for the `info` function. --- doc/bookmarkfs.texi | 38 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) diff --git a/doc/bookmarkfs.texi b/doc/bookmarkfs.texi index c2f2e54..81d7954 100644 --- a/doc/bookmarkfs.texi +++ b/doc/bookmarkfs.texi @@ -1801,8 +1801,42 @@ struct bookmarkfs_fsck_handler @{ @}; @end example -Each field is a function pointer provided by the fsck handler, -all of which are mandatory (must not be @code{NULL}). +Each field is a function pointer provided by the fsck handler. +Some can be optional and set to @code{NULL}, if the backend +does not support the corresponding features. + + +@node Get Handler Information +@subsection Get Handler Information + +If not @code{NULL}, the @code{info} function is called when the user +instructs @command{fsck.bookmarkfs} to print information about the handler. + +When this function is called, the handler should write a human-readable +message of the corresponding information to standard output. + +@example c +typedef void (bookmarkfs_fsck_handler_info_func) ( + uint32_t flags +); +@end example + +Function arguments: + +@table @code +@item flags +A bit array of the following flags: + +@table @code +@item BOOKMARKFS_FSCK_HANDLER_INFO_HELP +@item BOOKMARKFS_FSCK_HANDLER_INFO_VERSION +Indicates that the backend should print a help/version message. + +These flags are analogous to the corresponding flags in the +@code{backend_info} function of the backend API. +@xref{Get Backend Information}. +@end table +@end table @node General Index