[00/14] man3: SYNOPSIS: Use 'restrict' in prototypes (batch 2)

Message ID 20210228004817.122463-1-alx.manpages@gmail.com
Headers
Series man3: SYNOPSIS: Use 'restrict' in prototypes (batch 2) |

Message

Alejandro Colomar Feb. 28, 2021, 12:48 a.m. UTC
  Hey Michael,

This is the second batch of pages in man3 that use 'restrict'.

I have already checked until getrpcport.3.

---

A few functions to automate the commit messages:

For functions that are restrict in POSIX and glibc:

function gitcommit_rp()
{
	local commafuncs="$(echo $@ |sed -e 's/\> \</(), /g' -e 's/$/()/')";
	local msg="\
$(man_gitstaged): SYNOPSIS: Use 'restrict' in prototypes

Both POSIX and glibc use 'restrict' in ${commafuncs}.
Let's use it here too.

$(echo "$@" \
  |xargs -n1 bash -c \
    'echo ".../glibc$ grep_glibc_prototype $@"; \
     echo "$(cd ~/src/gnu/glibc && grep_glibc_prototype $@)"' _)
.../glibc$";

	git commit -sm "$msg";
}

For functions that are restrict in glibc:

function gitcommit_rg()
{
	local commafuncs="$(echo $@ |sed -e 's/\> \</(), /g' -e 's/$/()/')";
	local msg="\
$(man_gitstaged): SYNOPSIS: Use 'restrict' in prototypes

glibc uses 'restrict' in ${commafuncs}.
Let's use it here too.

$(echo "$@" \
  |xargs -n1 bash -c \
    'echo ".../glibc$ grep_glibc_prototype $@"; \
     echo "$(cd ~/src/gnu/glibc && grep_glibc_prototype $@)"' _)
.../glibc$";

	git commit -sm "$msg";
}

---
Alejandro Colomar (14):
  getaddrinfo.3: SYNOPSIS: Use 'restrict' in prototypes
  getaddrinfo_a.3: SYNOPSIS: Use 'restrict' in prototypes
  getdate.3: SYNOPSIS: Use 'restrict' in prototypes
  getdirentries.3: SYNOPSIS: Use 'restrict' in prototypes
  getgrent_r.3: SYNOPSIS: Use 'restrict' in prototypes
  getgrnam.3: SYNOPSIS: Use 'restrict' in prototypes
  gethostbyname.3: SYNOPSIS: Use 'restrict' in prototypes
  getline.3: SYNOPSIS: Use 'restrict' in prototypes
  getmntent.3: SYNOPSIS: Use 'restrict' in prototypes
  getnameinfo.3: SYNOPSIS: Use 'restrict' in prototypes
  getnetent_r.3: SYNOPSIS: Use 'restrict' in prototypes
  getprotoent_r.3: SYNOPSIS: Use 'restrict' in prototypes
  getpwent_r.3: SYNOPSIS: Use 'restrict' in prototypes
  getpwnam.3: SYNOPSIS: Use 'restrict' in prototypes

 man3/getaddrinfo.3   | 11 ++++++-----
 man3/getaddrinfo_a.3 | 12 ++++++------
 man3/getdate.3       |  2 +-
 man3/getdirentries.3 |  4 ++--
 man3/getgrent_r.3    | 10 ++++++----
 man3/getgrnam.3      | 11 +++++++----
 man3/gethostbyname.3 | 31 ++++++++++++++++++++-----------
 man3/getline.3       |  7 ++++---
 man3/getmntent.3     |  8 +++++---
 man3/getnameinfo.3   |  8 +++++---
 man3/getnetent_r.3   | 23 +++++++++++++----------
 man3/getprotoent_r.3 | 17 ++++++++++-------
 man3/getpwent_r.3    | 11 +++++++----
 man3/getpwnam.3      | 11 +++++++----
 14 files changed, 99 insertions(+), 67 deletions(-)
  

Comments

Michael Kerrisk \(man-pages\) March 3, 2021, 10:25 p.m. UTC | #1
Hi Alex,

On 2/28/21 1:48 AM, Alejandro Colomar wrote:
> Hey Michael,
> 
> This is the second batch of pages in man3 that use 'restrict'.
> 
> I have already checked until getrpcport.3.

Thanks for doing all of this work!

I've applied all of these patches.

Cheers,

Michael

> 
> ---
> 
> A few functions to automate the commit messages:
> 
> For functions that are restrict in POSIX and glibc:
> 
> function gitcommit_rp()
> {
> 	local commafuncs="$(echo $@ |sed -e 's/\> \</(), /g' -e 's/$/()/')";
> 	local msg="\
> $(man_gitstaged): SYNOPSIS: Use 'restrict' in prototypes
> 
> Both POSIX and glibc use 'restrict' in ${commafuncs}.
> Let's use it here too.
> 
> $(echo "$@" \
>   |xargs -n1 bash -c \
>     'echo ".../glibc$ grep_glibc_prototype $@"; \
>      echo "$(cd ~/src/gnu/glibc && grep_glibc_prototype $@)"' _)
> .../glibc$";
> 
> 	git commit -sm "$msg";
> }
> 
> For functions that are restrict in glibc:
> 
> function gitcommit_rg()
> {
> 	local commafuncs="$(echo $@ |sed -e 's/\> \</(), /g' -e 's/$/()/')";
> 	local msg="\
> $(man_gitstaged): SYNOPSIS: Use 'restrict' in prototypes
> 
> glibc uses 'restrict' in ${commafuncs}.
> Let's use it here too.
> 
> $(echo "$@" \
>   |xargs -n1 bash -c \
>     'echo ".../glibc$ grep_glibc_prototype $@"; \
>      echo "$(cd ~/src/gnu/glibc && grep_glibc_prototype $@)"' _)
> .../glibc$";
> 
> 	git commit -sm "$msg";
> }
> 
> ---
> Alejandro Colomar (14):
>   getaddrinfo.3: SYNOPSIS: Use 'restrict' in prototypes
>   getaddrinfo_a.3: SYNOPSIS: Use 'restrict' in prototypes
>   getdate.3: SYNOPSIS: Use 'restrict' in prototypes
>   getdirentries.3: SYNOPSIS: Use 'restrict' in prototypes
>   getgrent_r.3: SYNOPSIS: Use 'restrict' in prototypes
>   getgrnam.3: SYNOPSIS: Use 'restrict' in prototypes
>   gethostbyname.3: SYNOPSIS: Use 'restrict' in prototypes
>   getline.3: SYNOPSIS: Use 'restrict' in prototypes
>   getmntent.3: SYNOPSIS: Use 'restrict' in prototypes
>   getnameinfo.3: SYNOPSIS: Use 'restrict' in prototypes
>   getnetent_r.3: SYNOPSIS: Use 'restrict' in prototypes
>   getprotoent_r.3: SYNOPSIS: Use 'restrict' in prototypes
>   getpwent_r.3: SYNOPSIS: Use 'restrict' in prototypes
>   getpwnam.3: SYNOPSIS: Use 'restrict' in prototypes
> 
>  man3/getaddrinfo.3   | 11 ++++++-----
>  man3/getaddrinfo_a.3 | 12 ++++++------
>  man3/getdate.3       |  2 +-
>  man3/getdirentries.3 |  4 ++--
>  man3/getgrent_r.3    | 10 ++++++----
>  man3/getgrnam.3      | 11 +++++++----
>  man3/gethostbyname.3 | 31 ++++++++++++++++++++-----------
>  man3/getline.3       |  7 ++++---
>  man3/getmntent.3     |  8 +++++---
>  man3/getnameinfo.3   |  8 +++++---
>  man3/getnetent_r.3   | 23 +++++++++++++----------
>  man3/getprotoent_r.3 | 17 ++++++++++-------
>  man3/getpwent_r.3    | 11 +++++++----
>  man3/getpwnam.3      | 11 +++++++----
>  14 files changed, 99 insertions(+), 67 deletions(-)
>