From: Mike Frysinger <vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org>
To: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Cc: linux-man <linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: For review: newlocale.3
Date: Thu, 13 Mar 2014 04:13:14 -0400 [thread overview]
Message-ID: <5663087.ED3DXCYTiR@vapier> (raw)
In-Reply-To: <CAKgNAkhAR_LSqav=Lz_u+xJarZgBr4ft-NBeJirmCw7rd4LFSA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 2105 bytes --]
On Wed 12 Mar 2014 16:47:43 Michael Kerrisk wrote:
> .SH DESCRIPTION
> The
> .BR newlocale ()
> function creates a new locale object, or modifies an existing object,
> returning a reference to the new or modified object as the function result.
> Whether the call creates a new object or modifies an existing object
> is determined by the value of
> .IR base :
you discuss the value of |base| first ...
> .PP
> The
> .I category_mask
... then the |category_mask| ...
> The following preset values of
> .I locale
... then the |locale| ...
(side note: shouldn't there be a .PP to start this portion ?)
> .PP
> If
> .I base
... then back to |base| ? generally i expect the discussion of each argument
to be together rather than split across paragraphs. if i were referring to
this for programming, i probably wouldn't have even made it this far.
> .B EINVAL
> One or more bits in
> .I category_mask
> does not correspond to a valid locale category.
does->do
> Having created and initialized the locale object,
> the program then applies it using
> .BR uselocale (),
shouldn't that be (3) ?
> Te Paraire, te 07 o Poutū-te-rangi, 2014 00:38:44 CET
> .fi
> .in
>
> .in +4n
> .nf
>
> .fi
> .in
> .SS Program source
this ends up rendering 3 blank lines before "Program source" when really only
one is needed
> .nf
> #define _XOPEN_SOURCE 700
> #include <stdio.h>
> #include <stdlib.h>
> #include <locale.h>
> #include <time.h>
>
> #define errExit(msg) do { perror(msg); exit(EXIT_FAILURE); \\
> } while (0)
not sure what standard you're aiming for, but if you include err.h, you don't
need this macro. you can just call err(1, msg).
> if (argc > 2) {
> nloc = newlocale(LC_TIME_MASK, argv[2], loc);
> if (loc == (locale_t) 0)
shouldn't you be testing nloc ?
if you're just going to exit on error, i wonder why even bother with nloc
indirection
> s = strftime(buf, BUF_SIZE, "%c", tm);
why not sizeof(buf) ? avoids needing BUF_SIZE at all.
-mike
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2014-03-13 8:13 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-12 15:47 For review: newlocale.3 Michael Kerrisk (man-pages)
[not found] ` <CAKgNAkhAR_LSqav=Lz_u+xJarZgBr4ft-NBeJirmCw7rd4LFSA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-03-13 8:13 ` Mike Frysinger [this message]
2014-03-14 9:55 ` Michael Kerrisk (man-pages)
2014-03-14 9:56 ` Michael Kerrisk (man-pages)
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=5663087.ED3DXCYTiR@vapier \
--to=vapier-abrp7r+bbdudnm+yrofe0a@public.gmane.org \
--cc=linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
/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