All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fflush.3: SEE ALSO: Add fpurge(3)
@ 2021-05-09 21:38 Alejandro Colomar
  2021-05-09 21:38 ` [PATCH] scripts/bash_aliases, scripts/modified_pages.sh: Move scripts/modified_pages.sh to a function man_gitstaged() Alejandro Colomar
                   ` (35 more replies)
  0 siblings, 36 replies; 81+ messages in thread
From: Alejandro Colomar @ 2021-05-09 21:38 UTC (permalink / raw)
  To: mtk.manpages; +Cc: Alejandro Colomar, linux-man

fpurge(i_stream) does the same as fflush(i_stream), AFAIK.

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---

Hi Michael,

This is the first of many separate patches that I had pending for you.
Some of them I already sent you, and you should ignore the old versions.
Some of them are new.
Please review them thoroughly, as I may have sent some patch that wasn't
ready.  In theory I have reviewed them enough, but there are a lot, and
I might have overlooked something.


When you review this "set", I'll send you another one about the SYNOPSIS.


Thanks,

Alex


 man3/fflush.3 | 1 +
 1 file changed, 1 insertion(+)

diff --git a/man3/fflush.3 b/man3/fflush.3
index 138c9bcfe..a600da2ae 100644
--- a/man3/fflush.3
+++ b/man3/fflush.3
@@ -133,6 +133,7 @@ or
 .BR sync (2),
 .BR write (2),
 .BR fclose (3),
+.BR fpurge (3),
 .BR fileno (3),
 .BR fopen (3),
 .BR setbuf (3),
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 81+ messages in thread
* [PATCH] scripts/bash_aliases: Make man_lsfunc() more robust; Add sed_rm_ccomments().
@ 2021-03-07 19:56 Alejandro Colomar
  2021-03-07 20:21 ` Alejandro Colomar (man-pages)
  0 siblings, 1 reply; 81+ messages in thread
From: Alejandro Colomar @ 2021-03-07 19:56 UTC (permalink / raw)
  To: mtk.manpages; +Cc: Alejandro Colomar, linux-man, Stefan Puiu, Walter Harms

This patch makes man_lsfunc() search for the function prototypes,
instead of relying on the current manual page formatting,
which might change in the future, and break this function.
It also simplifies the code, by reusing man_section().

As a side effect, this change fixed some corner cases, where this
function failed to find a function, or listed a wrong function.

Create a new function sed_rm_ccomments(), which is needed by
man_lsfunc(), and may also be useful in other cases.

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
 scripts/bash_aliases | 40 ++++++++++++++++++++++------------------
 1 file changed, 22 insertions(+), 18 deletions(-)

diff --git a/scripts/bash_aliases b/scripts/bash_aliases
index d9b6047d1..12fb203e1 100644
--- a/scripts/bash_aliases
+++ b/scripts/bash_aliases
@@ -20,6 +20,21 @@
 EX_OK=0;
 EX_USAGE=64;
 
+########################################################################
+#	C
+
+#  sed_rm_ccomments()  removes C comments.
+# It can't handle multiple comments in a sinlge line correctly,
+# nor mixed or embedded //... and /*...*/ comments.
+# Use as a filter (see man_lsfunc() in this file).
+
+function sed_rm_ccomments()
+{
+	sed 's%/\*.*\*/%%' \
+	|sed -r '\%/\*%,\%\*/%{\%(\*/|/\*)%!d; s%/\*.*%%; s%.*\*/%%;}' \
+	|sed 's%//.*%%';
+}
+
 ########################################################################
 #	Linux kernel
 
@@ -106,25 +121,14 @@ function man_lsfunc()
 		return ${EX_USAGE};
 	fi
 
-	find "${@}" -type f \
-	|xargs grep -l "\.SH SYNOPSIS" \
-	|sort -V \
-	|while read -r manpage; do
-		<${manpage} \
-		sed -n \
-			-e '/^\.TH/,/^\.SH/{/^\.SH/!p}' \
-			-e "/^\.SH SYNOPSIS/p" \
-			-e "/^\.SH SYNOPSIS/,/^\.SH/{/^\.SH/!p}" \
-		|sed \
-			-e '/Feature/,$d' \
-			-e '/{/,/}/d' \
-		|man -P cat -l - 2>/dev/null;
+	for arg in "$@"; do
+		man_section "${arg}" "SYNOPSIS";
 	done \
-	|sed -n "/^SYNOPSIS/,/^\w/p" \
-	|grep '^       \w' \
-	|grep -v ':' \
-	|sed 's/^[^(]* \**\(\w*\)(.*/\1/' \
-	|grep '^\w' \
+	|sed_rm_ccomments \
+	|pcregrep -Mn \
+	  "(?s)^ [\w ]+ \**\w+\([\w\s(,)[\]*]+?(...)?\s*\); *$" \
+	|grep '^[0-9]' \
+	|sed -r 's/^[^(]+ +\**(\w+)\(.*/\1/' \
 	|uniq;
 }
 
-- 
2.30.1


^ permalink raw reply related	[flat|nested] 81+ messages in thread

end of thread, other threads:[~2021-05-11  7:34 UTC | newest]

Thread overview: 81+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-09 21:38 [PATCH] fflush.3: SEE ALSO: Add fpurge(3) Alejandro Colomar
2021-05-09 21:38 ` [PATCH] scripts/bash_aliases, scripts/modified_pages.sh: Move scripts/modified_pages.sh to a function man_gitstaged() Alejandro Colomar
2021-05-09 23:27   ` Michael Kerrisk (man-pages)
2021-05-09 21:38 ` [PATCH] scripts/bash_aliases: man_gitstaged(): Script around a porcelain git command Alejandro Colomar
2021-05-09 23:31   ` Michael Kerrisk (man-pages)
2021-05-09 21:38 ` [PATCH] basename.3: SYNOPSIS: Add missing 'const' Alejandro Colomar
2021-05-09 23:59   ` Michael Kerrisk (man-pages)
2021-05-11  7:34     ` Alejandro Colomar (man-pages)
2021-05-09 21:38 ` [PATCH] dladdr.3: " Alejandro Colomar
2021-05-09 23:20   ` Michael Kerrisk (man-pages)
2021-05-09 21:39 ` [PATCH] open.2: Fix bug in linkat(2) call example Alejandro Colomar
2021-05-10  0:50   ` Michael Kerrisk (man-pages)
2021-05-09 21:39 ` [PATCH] malloc_usable_size.3: ffix Alejandro Colomar
2021-05-09 23:10   ` Michael Kerrisk (man-pages)
2021-05-09 21:39 ` [PATCH] getutmp.3: ffix Alejandro Colomar
2021-05-09 23:10   ` Michael Kerrisk (man-pages)
2021-05-09 21:39 ` [PATCH] on_exit.3: ffix Alejandro Colomar
2021-05-09 23:11   ` Michael Kerrisk (man-pages)
2021-05-09 21:39 ` [PATCH] perror.3: ffix Alejandro Colomar
2021-05-09 23:12   ` Michael Kerrisk (man-pages)
2021-05-09 21:39 ` [PATCH] copy_file_range.2: Update cross-filesystem support for 5.12 Alejandro Colomar
2021-05-10  0:01   ` Michael Kerrisk (man-pages)
2021-05-10  4:26     ` Amir Goldstein
2021-05-10 16:34       ` Michael Kerrisk (man-pages)
2021-05-09 21:39 ` [PATCH] sched_get_priority_max.2, open_memstream.3: tfix Alejandro Colomar
2021-05-09 23:19   ` Michael Kerrisk (man-pages)
2021-05-09 21:39 ` [PATCH] __ppc_get_timebase.3: ffix Alejandro Colomar
2021-05-09 23:14   ` Michael Kerrisk (man-pages)
2021-05-09 21:39 ` [PATCH] scripts/bash_aliases: Make man_lsfunc() more robust; Add sed_rm_ccomments() Alejandro Colomar
2021-05-09 23:32   ` Michael Kerrisk (man-pages)
2021-05-09 21:39 ` [PATCH] scripts/bash_aliases: Add man_lsvar(), similar to man_lsfunc() but lists variables Alejandro Colomar
2021-05-09 23:32   ` Michael Kerrisk (man-pages)
2021-05-09 21:39 ` [PATCH] pthread_attr_setinheritsched.3: SYNOPSIS: Use 'restrict' in prototypes Alejandro Colomar
2021-05-09 23:53   ` Michael Kerrisk (man-pages)
2021-05-09 21:39 ` [PATCH] pthread_attr_setschedparam.3: " Alejandro Colomar
2021-05-09 23:53   ` Michael Kerrisk (man-pages)
2021-05-09 21:39 ` [PATCH] strsignal.3: ffix Alejandro Colomar
2021-05-09 23:14   ` Michael Kerrisk (man-pages)
2021-05-09 21:39 ` [PATCH] strsignal.3: SYNOPSIS: Add missing 'const' Alejandro Colomar
2021-05-09 23:16   ` Michael Kerrisk (man-pages)
2021-05-09 21:39 ` [PATCH] rpc.3: SYNOPSIS: Fix prototypes (misc.) Alejandro Colomar
2021-05-09 23:50   ` Michael Kerrisk (man-pages)
2021-05-09 21:39 ` [PATCH] pthread_getattr_default_np.3: SYNOPSIS: Add missing 'const' Alejandro Colomar
2021-05-09 23:19   ` Michael Kerrisk (man-pages)
2021-05-09 21:39 ` [PATCH] pthread_mutexattr_setrobust.3: SYNOPSIS: Remove incorrect 'const' Alejandro Colomar
2021-05-09 23:18   ` Michael Kerrisk (man-pages)
2021-05-09 21:39 ` [PATCH] tzset.3: ffix Alejandro Colomar
2021-05-09 23:16   ` Michael Kerrisk (man-pages)
2021-05-09 21:39 ` [PATCH] xdr.3: SYNOPSIS: Fix prototype types Alejandro Colomar
2021-05-09 23:51   ` Michael Kerrisk (man-pages)
2021-05-09 21:39 ` [PATCH] scripts/bash_aliases: man_section(): Accept multiple sections Alejandro Colomar
2021-05-09 23:33   ` Michael Kerrisk (man-pages)
2021-05-09 21:39 ` [PATCH] scripts/bash_aliases: Fix error messages Alejandro Colomar
2021-05-09 23:33   ` Michael Kerrisk (man-pages)
2021-05-09 21:39 ` [PATCH] epoll_wait.2: Move subsection to NOTES from BUGS Alejandro Colomar
2021-05-09 23:52   ` Michael Kerrisk (man-pages)
2021-05-09 21:39 ` [PATCH] bswap.3: bswap_*() are implemented using functions Alejandro Colomar
2021-05-09 23:55   ` Michael Kerrisk (man-pages)
2021-05-09 21:39 ` [PATCH] cpow.3: Use 'complex' after the type consistently Alejandro Colomar
2021-05-09 23:49   ` Michael Kerrisk (man-pages)
2021-05-09 21:39 ` [PATCH] clone.2: tfix Alejandro Colomar
2021-05-09 23:17   ` Michael Kerrisk (man-pages)
2021-05-09 21:39 ` [PATCH] scripts/bash_aliases: srcfix Alejandro Colomar
2021-05-09 23:34   ` Michael Kerrisk (man-pages)
2021-05-09 21:39 ` [PATCH] Makefile: Fix bug when running in parallel Alejandro Colomar
2021-05-09 23:39   ` Michael Kerrisk (man-pages)
2021-05-09 21:39 ` [PATCH] .gitignore: Add file Alejandro Colomar
2021-05-10  1:02   ` Michael Kerrisk (man-pages)
2021-05-10  7:15     ` Alejandro Colomar (man-pages)
2021-05-10 16:28       ` Michael Kerrisk (man-pages)
2021-05-09 21:39 ` [PATCH] system_data_types.7: tfix Alejandro Colomar
2021-05-09 23:46   ` Michael Kerrisk (man-pages)
2021-05-09 21:39 ` [PATCH] Makefile: Simplify error handling Alejandro Colomar
2021-05-09 23:45   ` Michael Kerrisk (man-pages)
2021-05-10  6:53     ` Alejandro Colomar (man-pages)
2021-05-10  1:03 ` [PATCH] fflush.3: SEE ALSO: Add fpurge(3) Michael Kerrisk (man-pages)
     [not found] ` <20210509213930.94120-33-alx.manpages@gmail.com>
     [not found]   ` <9f4a8c0c-ced3-4192-05a0-d126afda3285@gmail.com>
2021-05-10  7:13     ` [PATCH] Makefile: Use standard features (IMPORTANT: default prefix changed) Alejandro Colomar (man-pages)
2021-05-10 16:33       ` Michael Kerrisk (man-pages)
2021-05-10 16:41         ` Alejandro Colomar (man-pages)
  -- strict thread matches above, loose matches on Subject: below --
2021-03-07 19:56 [PATCH] scripts/bash_aliases: Make man_lsfunc() more robust; Add sed_rm_ccomments() Alejandro Colomar
2021-03-07 20:21 ` Alejandro Colomar (man-pages)

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.