groff
[Top][All Lists]
Advanced

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

Using tbl(1) for structure definitions


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

Hi Branden,

I've already read all that was relevant to me from tbl(1) regarding what I had in mind: documenting structures.

I haven't seen any mention to tables having a leading blank line, yet I couldn't get rid of it without resorting to .PD.

Let me know if I'm doing something wrong, or if you would improve anything. I come up with the following code.

Cheers,

Alex


diff --git a/man2type/open_how.2type b/man2type/open_how.2type
index e058c08dc..f7b0aea42 100644
--- a/man2type/open_how.2type
+++ b/man2type/open_how.2type
@@ -13,9 +13,14 @@ Linux kernel headers
 .B #include <linux/openat2.h>
 .PP
 .B struct open_how {
-.BR "    u64  flags;" "    /* " O_ "* flags */"
-.BR "    u64  mode;" "     /* Mode for " O_ { CREAT , TMPFILE "} */"
-.BR "    u64  resolve;" "  /* " RESOLVE_ "* flags */"
+.PD 0
+.TS
+l lB lB l.
+\&     u64     flags;  /* \fBO_\fP* flags */
+\&     u64     mode;   /* Mode for \fBO_\fP{\fBCREAT\fP,\fBTMPFILE\fP} */
+\&     u64     resolve;        /* \fBRESOLVE_\fP* flags */
+.PD
+.TE
     /* ... */
 .B };
 .fi

--
Alejandro Colomar
<http://www.alejandro-colomar.es/>

Attachment: OpenPGP_signature
Description: OpenPGP digital signature


reply via email to

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