Skip to contentSkip to conversation

Document ptrdiff_t (and a few minor patches)

PATCH In review Alejandro Colomar 2 participants 9 messages Sep 18, 2020 Man-pages: manual pages for Linux -- Sections 2, 3, 4, 5, and 7

lore
Share & tools
lore
#0 lore raw

cover Document ptrdiff_t (and a few minor patches)

Hi Michael,

Documentation for ptrdiff_t + a few minor patches. (apply after size_t patches)

Cheers,

Alex.

Alejandro Colomar (4):
system_data_types.7: srcfix: Remove TODO comment system_data_types.7: wfix: sort referenced types system_data_types.7: Document ptrdiff_t
ptrdiff_t.3: New link to new documented type in system_data_types(7)

 man3/ptrdiff_t.3         |  1 +
 man7/system_data_types.7 | 32 ++++++++++++++++++++++++++------
 2 files changed, 27 insertions(+), 6 deletions(-)
 create mode 100644 man3/ptrdiff_t.3
Signature · 1 line
2.28.0
#1 lore raw

PATCH 1/4 system_data_types.7: srcfix: Remove TODO comment

---
 man7/system_data_types.7 | 3 ---
 1 file changed, 3 deletions(-)
man7/system_data_types.7 +0 -3
index 041e7e243..72afe9e81 100644
@@ -27,9 +27,6 @@
 .SH NAME
 system_data_types \- overview of system data types
 .SH DESCRIPTION
-.\" TODO:
-.\"	* Add types
-.\"	* Curate "See also"
 .\" Layout:
 .\"	A list of type names (the struct/union keyword will be omitted).
 .\"	Each entry will have the following parts:
Signature · 1 line
2.28.0
#2 lore raw

Re: [PATCH 1/4] system_data_types.7: srcfix: Remove TODO comment

Quoted 1 line · Alejandro Colomar

Patch applied.

Thanks,

Michael

Quoted 19 lines
---
 man7/system_data_types.7 | 3 ---
 1 file changed, 3 deletions(-)
man7/system_data_types.7 +0 -3
index 041e7e243..72afe9e81 100644
@@ -27,9 +27,6 @@
 .SH NAME
 system_data_types \- overview of system data types
 .SH DESCRIPTION
-.\" TODO:
-.\"	* Add types
-.\"	* Curate "See also"
 .\" Layout:
 .\"	A list of type names (the struct/union keyword will be omitted).
 .\"	Each entry will have the following parts:
Signature · 3 lines
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/
#3 lore raw

PATCH 2/4 system_data_types.7: wfix: sort referenced types

In reply to Alejandro Colomar
---
 man7/system_data_types.7 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
man7/system_data_types.7 +2 -2
index 72afe9e81..5ef470386 100644
@@ -179,9 +179,9 @@ See also:
 .BR offsetof (3)
 .IP
 See also the
-.I ssize_t
-and
 .I ptrdiff_t
+and
+.I ssize_t
 types in this page.
 .TP
 .I ssize_t
Signature · 1 line
2.28.0
#4 lore raw

Re: [PATCH 2/4] system_data_types.7: wfix: sort referenced types

Quoted 1 line · Alejandro Colomar

Patch applied.

Thanks,

Michael

Quoted 21 lines
---
 man7/system_data_types.7 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
man7/system_data_types.7 +2 -2
index 72afe9e81..5ef470386 100644
@@ -179,9 +179,9 @@ See also:
 .BR offsetof (3)
 .IP
 See also the
-.I ssize_t
-and
 .I ptrdiff_t
+and
+.I ssize_t
 types in this page.
 .TP
 .I ssize_t
Signature · 3 lines
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/
#5 lore raw

PATCH 3/4 system_data_types.7: Document ptrdiff_t

In reply to Alejandro Colomar
---
 man7/system_data_types.7 | 25 ++++++++++++++++++++++++-
 1 file changed, 24 insertions(+), 1 deletion(-)
man7/system_data_types.7 +24 -1
index 5ef470386..8969ee966 100644
@@ -62,6 +62,27 @@ system_data_types \- overview of system data types
 .\"
 .\"		* See also
 .TP
+.I ptrdiff_t
+.IP
+Include:
+.I <stddef.h>.
+.IP
+Used for a count of elements, and array indices.
+It is the result of subtracting two pointers.
+According to the C language standard, it shall be a signed integer type
+capable of storing values in the range
+.BR "" [ PTRDIFF_MIN ,
+.BR PTRDIFF_MAX ].
+.IP
+Conforming to: C99 and later; POSIX.1-2001 and later.
+.IP
+See also the
+.\".I regoff_t ,	FIXME: uncomment when regoff_t is documented.
+.I size_t
+and
+.I ssize_t
+types in this page.
+.TP
 .I sigval
 .IP
 Include:
@@ -221,8 +242,10 @@ See also:
 .BR write (2)
 .IP
 See also the
+.I ptrdiff_t
+and
 .I size_t
-type in this page.
+types in this page.
 .TP
 .I suseconds_t
 .IP
Signature · 1 line
2.28.0
#6 lore raw

Re: [PATCH 3/4] system_data_types.7: Document ptrdiff_t

Hello Alex,

Quoted 1 line · Alejandro Colomar

Patch applied.

Thanks,

Michael

Quoted 49 lines
---
 man7/system_data_types.7 | 25 ++++++++++++++++++++++++-
 1 file changed, 24 insertions(+), 1 deletion(-)
man7/system_data_types.7 +24 -1
index 5ef470386..8969ee966 100644
@@ -62,6 +62,27 @@ system_data_types \- overview of system data types
 .\"
 .\"		* See also
 .TP
+.I ptrdiff_t
+.IP
+Include:
+.I <stddef.h>.
+.IP
+Used for a count of elements, and array indices.
+It is the result of subtracting two pointers.
+According to the C language standard, it shall be a signed integer type
+capable of storing values in the range
+.BR "" [ PTRDIFF_MIN ,
+.BR PTRDIFF_MAX ].
+.IP
+Conforming to: C99 and later; POSIX.1-2001 and later.
+.IP
+See also the
+.\".I regoff_t ,	FIXME: uncomment when regoff_t is documented.
+.I size_t
+and
+.I ssize_t
+types in this page.
+.TP
 .I sigval
 .IP
 Include:
@@ -221,8 +242,10 @@ See also:
 .BR write (2)
 .IP
 See also the
+.I ptrdiff_t
+and
 .I size_t
-type in this page.
+types in this page.
 .TP
 .I suseconds_t
 .IP
Signature · 3 lines
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/
#8 lore raw

Re: [PATCH 4/4] ptrdiff_t.3: New link to new documented type in system_data_types(7)

Quoted 1 line · Alejandro Colomar

Patch applied.

Thanks,

Michael

Quoted 13 lines
---
 man3/ptrdiff_t.3 | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 man3/ptrdiff_t.3
man3/ptrdiff_t.3 new file +1 -0
new file mode 100644
index 000000000..db50c0f09
@@ -0,0 +1 @@
+.so man7/system_data_types.7
Signature · 3 lines
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/