[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v5 2/2] sockaddr.3type: ffix
From: |
Alejandro Colomar |
Subject: |
[PATCH v5 2/2] sockaddr.3type: ffix |
Date: |
Sat, 30 Jul 2022 01:01:09 +0200 |
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
- [PATCH v5 2/2] sockaddr.3type: ffix,
Alejandro Colomar <=