From: Andrey Savchenko <bircoph@altlinux.org>
To: ALT Linux Team development discussions <devel@lists.altlinux.org>
Subject: Re: [devel] [PATCH] Verbose QueryTags prints whether tag is an extension
Date: Sat, 11 Apr 2020 13:46:55 +0300
Message-ID: <20200411134655.da40352c20a0e0bde65a474d@altlinux.org> (raw)
In-Reply-To: <20200410231917.1482336-1-vseleznv@altlinux.org>
[-- Attachment #1: Type: text/plain, Size: 1138 bytes --]
On Sat, 11 Apr 2020 02:19:17 +0300 Vladimir D. Seleznev wrote:
> Verbose QueryTags prints four field: tagname, tagvalue, tagtype and whether
> it is an extension. To make it possible QueryTags uses new function
> rpmTagIsExtension() that return 0 if tag is real, 1 if tag is an extension
> or 2 if tag is not found.
[...]
> diff --git a/lib/rpmtag.h b/lib/rpmtag.h
> index f74b451dc..8e860f927 100644
> --- a/lib/rpmtag.h
> +++ b/lib/rpmtag.h
> @@ -519,6 +519,13 @@ rpmTagType rpmTagGetTagType(rpmTagVal tag);
> */
> rpmTagReturnType rpmTagGetReturnType(rpmTagVal tag);
>
> +/** \ingroup rpmtag
> + * Return 0 if tag is real, 1 if tag is an extension, 2 on not found
> + * @param tag tag value
> + * @return 0 if tag is real, 1 if tag is an extension, 2 on not found
I prpopose to change the return code semantics: rpmTagIsExtension
is designed to return 3 possible values: yes, no or error.
1 is a good choise for yes, so it is OK
0 is a good choise for no, so it is OK
But for the error — not found — it is better to use -1 to comply
with commonly used semantics.
Best regards,
Andrew Savchenko
[-- Attachment #2: Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2020-04-11 10:46 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-10 23:19 Vladimir D. Seleznev
2020-04-11 10:46 ` Andrey Savchenko [this message]
2020-04-12 3:02 ` Vladimir D. Seleznev
2020-04-13 18:04 ` Dmitry V. Levin
2020-04-13 18:20 ` Vladimir D. Seleznev
2020-04-13 18:42 ` Dmitry V. Levin
2020-04-14 16:21 ` Vladimir D. Seleznev
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=20200411134655.da40352c20a0e0bde65a474d@altlinux.org \
--to=bircoph@altlinux.org \
--cc=devel@lists.altlinux.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
ALT Linux Team development discussions
This inbox may be cloned and mirrored by anyone:
git clone --mirror http://lore.altlinux.org/devel/0 devel/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 devel devel/ http://lore.altlinux.org/devel \
devel@altlinux.org devel@altlinux.ru devel@lists.altlinux.org devel@lists.altlinux.ru devel@linux.iplabs.ru mandrake-russian@linuxteam.iplabs.ru sisyphus@linuxteam.iplabs.ru
public-inbox-index devel
Example config snippet for mirrors.
Newsgroup available over NNTP:
nntp://lore.altlinux.org/org.altlinux.lists.devel
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git