[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using tbl(1) for structure definitions

From: Alejandro Colomar
Subject: Re: Using tbl(1) for structure definitions
Date: Tue, 26 Jul 2022 22:09:44 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.0.2

I must say that the source code is really ugly (ugly as in, someone reading it will probably have a hard time modifying it, without reading tbl(1)).

But at the same time, the result is beautiful, and the syntax is really great. You can express exactly what you want.



On 7/26/22 22:07, Alejandro Colomar wrote:
Improved an v2 using T{...T} in combination with column modifiers and removing .nf/.fi for the table, fixing a misplaced .PD, and .BR instead of \fB...\fP:

     open_how.2type: ffix

    Format structures with tbl(1) to improve alignment in proportional-width font text.

     Reported-by: "G. Branden Robinson" <>
     Signed-off-by: Alejandro Colomar <>

diff --git a/man2type/open_how.2type b/man2type/open_how.2type
index e058c08dc..edc4d8a3b 100644
--- a/man2type/open_how.2type
+++ b/man2type/open_how.2type
@@ -13,9 +13,26 @@ Linux kernel headers
  .B #include <linux/openat2.h>
  .B struct open_how {
-.BR "    u64  flags;" "    /* " O_ "* flags */"
-.BR "    u64  mode;" "     /* Mode for " O_ { CREAT , TMPFILE "} */"
-.BR "    u64  resolve;" "  /* " RESOLVE_ "* flags */"
+.PD 0
+l lB lB l1 lX.
+\&     u64     flags;  /*      T{
+.BR O_ *
+flags */
+\&     u64     mode;   /*      T{
+Mode for
+\&     u64     resolve;        /*      T{
+flags */
      /* ... */
  .B };

Alejandro Colomar

Attachment: OpenPGP_signature
Description: OpenPGP digital signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]