git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Christian Couder <christian.couder@gmail.com>
To: Paolo Bonzini <bonzini@gnu.org>
Cc: git <git@vger.kernel.org>,
	Jonathan Tan <jonathantanmy@google.com>,
	Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [PATCH v2 2/3] trailers: export action enums and corresponding lookup functions
Date: Thu, 13 Jul 2017 08:00:22 +0200	[thread overview]
Message-ID: <CAP8UFD0LEHDutF83=V9zrDnFKy27dJSrq5DHV-8YV1=y=cPXqg@mail.gmail.com> (raw)
In-Reply-To: <20170712222116.7095-3-bonzini@gnu.org>

On Thu, Jul 13, 2017 at 12:21 AM, Paolo Bonzini <bonzini@gnu.org> wrote:

> diff --git a/trailer.h b/trailer.h
> index e90ba1270..f306bf059 100644
> --- a/trailer.h
> +++ b/trailer.h
> @@ -1,11 +1,33 @@
>  #ifndef TRAILER_H
>  #define TRAILER_H
>
> +enum action_where {
> +       WHERE_END,
> +       WHERE_AFTER,
> +       WHERE_BEFORE,
> +       WHERE_START
> +};
> +enum action_if_exists {
> +       EXISTS_ADD_IF_DIFFERENT_NEIGHBOR,
> +       EXISTS_ADD_IF_DIFFERENT,
> +       EXISTS_ADD,
> +       EXISTS_REPLACE,
> +       EXISTS_DO_NOTHING
> +};
> +enum action_if_missing {
> +       MISSING_ADD,
> +       MISSING_DO_NOTHING
> +};

As these enums are now in trailer.h, maybe more specific names like
"trailer_action_where" instead of "action_where" would be better.

>  struct trailer_opts {
>         int in_place;
>         int trim_empty;
>  };
>
> +int set_where(enum action_where *item, const char *value);
> +int set_if_exists(enum action_if_exists *item, const char *value);
> +int set_if_missing(enum action_if_missing *item, const char *value);

"trailer_" should perhaps be added at the beginning of the names of
the above functions too.

  reply	other threads:[~2017-07-13  6:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-12 22:21 [PATCH v2 0/3] interpret-trailers: add --where, --if-exists, --if-missing Paolo Bonzini
2017-07-12 22:21 ` [PATCH v2 1/3] trailers: create struct trailer_opts Paolo Bonzini
2017-07-12 22:21 ` [PATCH v2 2/3] trailers: export action enums and corresponding lookup functions Paolo Bonzini
2017-07-13  6:00   ` Christian Couder [this message]
2017-07-17 21:13     ` Junio C Hamano
2017-07-12 22:21 ` [PATCH v2 3/3] interpret-trailers: add options for actions Paolo Bonzini
2017-07-12 23:02 ` [PATCH v2 0/3] interpret-trailers: add --where, --if-exists, --if-missing Junio C Hamano
2017-07-12 23:42   ` Paolo Bonzini

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAP8UFD0LEHDutF83=V9zrDnFKy27dJSrq5DHV-8YV1=y=cPXqg@mail.gmail.com' \
    --to=christian.couder@gmail.com \
    --cc=bonzini@gnu.org \
    --cc=git@vger.kernel.org \
    --cc=jonathantanmy@google.com \
    --cc=pbonzini@redhat.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).