public inbox for linux-man@vger.kernel.org
 help / color / mirror / Atom feed
From: Alejandro Colomar <alx.manpages@gmail.com>
To: linux-man@vger.kernel.org
Cc: "Alejandro Colomar" <alx.manpages@gmail.com>,
	groff@gnu.org,
	"G. Branden Robinson" <g.branden.robinson@gmail.com>,
	"Heinz-Jürgen Oertel" <hj.oertel@t-online.de>,
	"Ralph Corderoy" <ralph@inputplus.co.uk>
Subject: [PATCH v5 2/2] sockaddr.3type: ffix
Date: Sat, 30 Jul 2022 01:01:09 +0200	[thread overview]
Message-ID: <20220729230107.11954-2-alx.manpages@gmail.com> (raw)
In-Reply-To: <20220729152737.27770-1-alx.manpages@gmail.com>

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

I also reordered the types in the SYNOPSIS, to be consistent with
C syntax.

Reported-by: "G. Branden Robinson" <g.branden.robinson@gmail.com>
Cc: Heinz-Jürgen Oertel <hj.oertel@t-online.de>
Cc: Ralph Corderoy <ralph@inputplus.co.uk>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---

This page clearly shows that using tabs would be hard.

Although having different alignment for every structure doesn't convince me...


 man3type/sockaddr.3type | 127 ++++++++++++++++++++++++++++++++--------
 1 file changed, 102 insertions(+), 25 deletions(-)

diff --git a/man3type/sockaddr.3type b/man3type/sockaddr.3type
index 9367158e1..9c7a5afff 100644
--- a/man3type/sockaddr.3type
+++ b/man3type/sockaddr.3type
@@ -16,55 +16,132 @@ Standard C library
 .nf
 .B #include <sys/socket.h>
 .PP
+.BR typedef " /* ... */  " socklen_t;
+.BR typedef " /* ... */  " sa_family_t;
+.PP
 .B struct sockaddr {
-.BR "    sa_family_t     sa_family;" "      /* Address family */"
-.BR "    char            sa_data[];" "      /* Socket address */"
+.fi
+.RS 4
+.TS
+lB2 lB2 l1 lX.
+sa_family_t	sa_family;	/*	T{
+Address family */
+T}
+char	sa_data[];	/*	T{
+Socket address */
+T}
+.TE
+.RE
+.nf
 .B };
 .PP
 .B struct sockaddr_storage {
-.BR "    sa_family_t     ss_family;" "      /* Address family */"
+.fi
+.RS 4
+.TS
+lB2 lB2 l1 lX.
+sa_family_t	ss_family;	/*	T{
+Address family */
+T}
+.TE
+.RE
+.nf
 .B };
 .PP
-.BR typedef " /* ... */ " socklen_t;
-.BR typedef " /* ... */ " sa_family_t;
-.PP
 .fi
 .SS Internet domain sockets
 .nf
 .B #include <netinet/in.h>
 .PP
-.B struct sockaddr_in {
-.BR "    sa_family_t     sin_family;" "     /* " AF_INET " */"
-.BR "    in_port_t       sin_port;" "       /* Port number */"
-.BR "    struct in_addr  sin_addr;" "       /* IPv4 address */"
-.B };
-.PP
-.B struct sockaddr_in6 {
-.BR "    sa_family_t     sin6_family;" "    /* " AF_INET6 " */"
-.BR "    in_port_t       sin6_port;" "      /* Port number */"
-.BR "    uint32_t        sin6_flowinfo;" "  /* IPv6 flow info */"
-.BR "    struct in6_addr sin6_addr;" "      /* IPv6 address */"
-.BR "    uint32_t        sin6_scope_id;" "  /* Set of interfaces for a scope */"
-.B };
+.B "typedef uint32_t  in_addr_t;"
+.B "typedef uint16_t  in_port_t;"
 .PP
 .B struct in_addr {
-.B "    in_addr_t s_addr;"
+.fi
+.RS 4
+.TS
+lB2 lB.
+in_addr_t	s_addr;
+.TE
+.RE
+.nf
 .B };
 .PP
 .B struct in6_addr {
-.B "    uint8_t   s6_addr[16];"
+.fi
+.RS 4
+.TS
+lB2 lB.
+uint8_t	s6_addr[16];
+.TE
+.RE
+.nf
 .B };
 .PP
-.B typedef uint32_t in_addr_t;
-.B typedef uint16_t in_port_t;
+.B struct sockaddr_in {
+.fi
+.RS 4
+.TS
+lB2 lB2 l1 lX.
+sa_family_t	sin_family;	/*	T{
+.B AF_INET
+*/
+T}
+in_port_t	sin_port;	/*	T{
+Port number */
+T}
+struct in_addr	sin_addr;	/*	T{
+IPv4 address */
+T}
+.TE
+.RE
+.nf
+.B };
+.PP
+.B struct sockaddr_in6 {
+.fi
+.RS 4
+.TS
+lB2 lB2 l1 lX.
+sa_family_t	sin6_family;	/*	T{
+.B AF_INET6
+*/
+T}
+in_port_t	sin6_port;	/*	T{
+Port number */
+T}
+uint32_t	sin6_flowinfo;	/*	T{
+IPv6 flow info */
+T}
+struct in6_addr	sin6_addr;	/*	T{
+IPv6 address */
+T}
+uint32_t	sin6_scope_id;	/*	T{
+Set of interfaces for a scope */
+T}
+.TE
+.RE
+.nf
+.B };
 .fi
 .SS UNIX domain sockets
 .nf
 .B #include <sys/un.h>
 .PP
 .B struct sockaddr_un {
-.BR "    sa_family_t     sun_family;" "     /* Address family */"
-.BR "    char            sun_path[];" "     /* Socket pathname */"
+.fi
+.RS 4
+.TS
+lB2 lB2 l1 lX.
+sa_family_t	sun_family;	/*	T{
+Address family */
+T}
+char	sun_path[];	/*	T{
+Socket pathname */
+T}
+.TE
+.RE
+.nf
 .B };
 .fi
 .SH DESCRIPTION
-- 
2.36.1


  parent reply	other threads:[~2022-07-29 23:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-26 20:26 [PATCH v3] open_how.2type: ffix Alejandro Colomar
2022-07-29 15:27 ` [PATCH v4] " Alejandro Colomar
2022-07-29 23:01   ` [PATCH v5 1/2] " Alejandro Colomar
2022-07-29 23:01   ` Alejandro Colomar [this message]
2022-07-30  0:15     ` [PATCH v5 2/2] sockaddr.3type: ffix G. Branden Robinson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220729230107.11954-2-alx.manpages@gmail.com \
    --to=alx.manpages@gmail.com \
    --cc=g.branden.robinson@gmail.com \
    --cc=groff@gnu.org \
    --cc=hj.oertel@t-online.de \
    --cc=linux-man@vger.kernel.org \
    --cc=ralph@inputplus.co.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox