From 19df7c93239b3ba70a3dedc726edb3aa5aa0ba7b Mon Sep 17 00:00:00 2001 From: CismonX Date: Mon, 6 Jan 2025 19:14:18 +0800 Subject: [PATCH] doc: improve code example rendering Specify the language used in @example, for syntax highlighting with customization variable HIGHLIGHT_SYNTAX. Also remove the @varx definition. No need for that any more. --- doc/bookmarkfs.texi | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/doc/bookmarkfs.texi b/doc/bookmarkfs.texi index 1199af8..b1134f6 100644 --- a/doc/bookmarkfs.texi +++ b/doc/bookmarkfs.texi @@ -27,11 +27,6 @@ @uref{https://docs.kernel.org/\path\, \name\} @end macro -@c sometimes we don't want var name to be rendered UPPERCASE in Info -@macro varx {name} -@inlinefmtifelse{info, \name\, @var{\name\}} -@end macro - @tex \global\def\linkcolor{0 0 1} \global\def\urlcolor{0 0 1} @@ -499,7 +494,7 @@ Applications should tread lightly if they wish to cache tag directory entries. To associate a bookmark with a tag, use @posixfuncmanpage{link}: -@example +@example C fd = open("tags/gnu/readline", O_CREAT | O_WRONLY, 0600); // Oops, fd == -1, errno == EPERM @@ -591,7 +586,7 @@ All attributes have a @code{bookmarkfs.} name prefix. For example, to get the GUID of a bookmark file (Firefox backend): -@example +@example C // Linux len = fgetxattr(fd, "user.bookmarkfs.guid", buf, sizeof(buf)); @@ -641,16 +636,16 @@ the order of other entries. BookmarkFS provides an I/O control for rearranging directory entries: -@example +@example C #include -int ioctl (int @varx{dirfd}, BOOKMARKFS_IOC_PERMD, - struct bookmarkfs_permd_data const *@varx{argp}); +int ioctl (int dirfd, BOOKMARKFS_IOC_PERMD, + struct bookmarkfs_permd_data const *argp); @end example The @code{bookmarkfs_permd_data} structure is defined as: -@example +@example C struct bookmarkfs_permd_data @{ enum bookmarkfs_permd_op op;